24 template <
size_t POS_DIM,
size_t VEL_DIM,
size_t CONTROL_DIM,
typename SCALAR =
double>
28 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
30 typedef typename Base::time_t
time_t;
46 : Base(controller, type)
76 computePdot(state, state.tail(VEL_DIM), control, pDot);
77 computeVdot(state, state.head(POS_DIM), control, vDot);
79 derivative << pDot, vDot;
96 this->
controller_->computeControl(x, 0.0, controlAction);
98 controlAction.setZero();
116 this->
controller_->computeControl(x, 0.0, controlAction);
118 controlAction.setZero();
void computePdot(const StateVector< POS_DIM+VEL_DIM, SCALAR > &x, const StateVector< VEL_DIM, SCALAR > &v, StateVector< POS_DIM, SCALAR > &pDot)
Computes the derivative of the position.
Definition: SymplecticSystem.h:90
virtual bool isSymplectic() const override
Determines if the system is in symplectic form.
Definition: SymplecticSystem.h:67
Definition: ControlVector.h:12
CppAD::AD< CppAD::cg::CG< double > > SCALAR
void computeVdot(const StateVector< POS_DIM+VEL_DIM, SCALAR > &x, const StateVector< POS_DIM, SCALAR > &p, StateVector< VEL_DIM, SCALAR > &vDot)
Computes the derivative of the velocity.
Definition: SymplecticSystem.h:110
Base::time_t time_t
Definition: SymplecticSystem.h:30
SymplecticSystem(std::shared_ptr< ct::core::Controller< POS_DIM+VEL_DIM, CONTROL_DIM, SCALAR >> controller, const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
Constructor.
Definition: SymplecticSystem.h:44
ct::core::StateVector< state_dim > x
SymplecticSystem(const SymplecticSystem &arg)
Copy constructor.
Definition: SymplecticSystem.h:55
std::shared_ptr< Controller< STATE_DIM, CONTROL_DIM, SCALAR > > controller_
the controller instance
Definition: ControlledSystem.h:145
virtual ~SymplecticSystem()
Destructor.
Definition: SymplecticSystem.h:59
SYSTEM_TYPE
type of system
Definition: System.h:15
any non-specific system
Definition: System.h:17
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ControlledSystem< POS_DIM+VEL_DIM, CONTROL_DIM, SCALAR > Base
Definition: SymplecticSystem.h:29
virtual void computeControlledDynamics(const StateVector< POS_DIM+VEL_DIM, SCALAR > &state, const time_t &t, const ControlVector< CONTROL_DIM, SCALAR > &control, StateVector< POS_DIM+VEL_DIM, SCALAR > &derivative) override
Definition: SymplecticSystem.h:68
The base class for the implementation of a symplectic system. In a symplectic system, the position and the velocity update can be separated. During integration, the velocity gets update first and the position update uses the updated velocity.
Definition: SymplecticSystem.h:25
SymplecticSystem(const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
Constructor.
Definition: SymplecticSystem.h:37
virtual SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR > * clone() const override=0
Creates a new instance of the object with same properties than original.
A general, non-linear dynamic system with a control input.
Definition: ControlledSystem.h:46
Interface class for all controllers.
Definition: Controller.h:26