- 3.0.2 core module.
CustomController Class Reference

an example controller class that takes a 2-dimensional state and outputs a 1-dimensional control action More...

#include <CustomController.h>

Inheritance diagram for CustomController:
ct::core::Controller< 2, 1 >

Public Member Functions

 CustomController (const ct::core::ControlVector< control_dim > &uff, const double &kp, const double &kd)
 default constructor More...
 
 ~CustomController ()
 destructor More...
 
 CustomController (const CustomController &other)
 copy constructor More...
 
CustomControllerclone () const override
 clone method, needs to be implemented, overrides ct::core::Controller::clone() More...
 
void computeControl (const ct::core::StateVector< state_dim > &state, const double &t, ct::core::ControlVector< control_dim > &controlAction) override
 override the compute control method with a custom control law More...
 
- Public Member Functions inherited from ct::core::Controller< 2, 1 >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Controller ()
 Default constructor. More...
 
 Controller (const Controller &other)
 Copy constructor. More...
 
virtual ~Controller ()
 Destructor. More...
 
virtual void computeControl (const StateVector< STATE_DIM, double > &state, const double &t, ControlVector< CONTROL_DIM, double > &controlAction)=0
 Compute control signal. More...
 
virtual ControlMatrix< CONTROL_DIM, double > getDerivativeU0 (const StateVector< STATE_DIM, double > &state, const double time)
 Returns the the derivative of the control with respect to the initial control input u0. More...
 
virtual ControlMatrix< CONTROL_DIM, double > getDerivativeUf (const StateVector< STATE_DIM, double > &state, const double time)
 Returns the the derivative of the control with respect to the final control input uF. More...
 

Static Public Attributes

static const size_t state_dim = 2
 
static const size_t control_dim = 1
 

Detailed Description

an example controller class that takes a 2-dimensional state and outputs a 1-dimensional control action

Examples:
CustomController.h, and DampedOscillatorCustomController.cpp.

Constructor & Destructor Documentation

◆ CustomController() [1/2]

CustomController::CustomController ( const ct::core::ControlVector< control_dim > &  uff,
const double &  kp,
const double &  kd 
)
inline

default constructor

Examples:
CustomController.h.

Referenced by clone().

◆ ~CustomController()

CustomController::~CustomController ( )
inline

destructor

Examples:
CustomController.h.

◆ CustomController() [2/2]

CustomController::CustomController ( const CustomController other)
inline

copy constructor

Member Function Documentation

◆ clone()

CustomController* CustomController::clone ( ) const
inlineoverridevirtual

clone method, needs to be implemented, overrides ct::core::Controller::clone()

Implements ct::core::Controller< 2, 1 >.

Examples:
CustomController.h.

References CustomController().

◆ computeControl()

void CustomController::computeControl ( const ct::core::StateVector< state_dim > &  state,
const double &  t,
ct::core::ControlVector< control_dim > &  controlAction 
)
inlineoverride

override the compute control method with a custom control law

Examples:
CustomController.h.

Member Data Documentation

◆ state_dim

const size_t CustomController::state_dim = 2
static
Examples:
CustomController.h.

◆ control_dim

const size_t CustomController::control_dim = 1
static
Examples:
CustomController.h.

The documentation for this class was generated from the following file: