OCS2 Manual  v1.0.0
OCS2 Documentation
ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM > Class Template Referenceabstract

#include <ControlledSystemBase.h>

Detailed Description

template<size_t STATE_DIM, size_t INPUT_DIM>
class ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >

The base class for non-autonomous system dynamics.

Template Parameters
STATE_DIMDimension of the state space.
INPUT_DIMDimension of the control input space.
Inheritance diagram for ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >:
ocs2::OdeBase< STATE_DIM > ocs2::RolloutSensitivityEquations< STATE_DIM, INPUT_DIM > ocs2::SystemDynamicsBase< STATE_DIM, INPUT_DIM, NUM_MODES > ocs2::SystemDynamicsBase< STATE_DIM, INPUT_DIM > ocs2::SystemDynamicsBase< STATE_DIM, INPUT_DIM, 1 > ocs2::SystemDynamicsBaseAD< STATE_DIM, INPUT_DIM, NUM_MODES > ocs2::SystemDynamicsBaseAD< cartpole::STATE_DIM_, cartpole::INPUT_DIM_, 1 > ocs2::LinearSystemDynamics< STATE_DIM, INPUT_DIM > ocs2::SystemDynamicsBaseAD< ballbot::STATE_DIM_, ballbot::INPUT_DIM_ > ocs2::cartpole::CartPoleSytemDynamics ocs2::ballbot::BallbotSystemDynamics

Public Types

using Ptr = std::shared_ptr< ControlledSystemBase< STATE_DIM, INPUT_DIM > >
 
using ConstPtr = std::shared_ptr< const ControlledSystemBase< STATE_DIM, INPUT_DIM > >
 
using BASE = OdeBase< STATE_DIM >
 
using DIMENSIONS = Dimensions< STATE_DIM, INPUT_DIM >
 
using scalar_t = typename DIMENSIONS::scalar_t
 
using scalar_array_t = typename DIMENSIONS::scalar_array_t
 
using state_vector_t = typename DIMENSIONS::state_vector_t
 
using state_vector_array_t = typename DIMENSIONS::state_vector_array_t
 
using input_vector_t = typename DIMENSIONS::input_vector_t
 
using input_vector_array_t = typename DIMENSIONS::input_vector_array_t
 
using input_state_matrix_t = typename DIMENSIONS::input_state_matrix_t
 
using input_state_matrix_array_t = typename DIMENSIONS::input_state_matrix_array_t
 
using constraint1_vector_t = typename DIMENSIONS::constraint1_vector_t
 
using constraint2_vector_t = typename DIMENSIONS::constraint2_vector_t
 
using dynamic_vector_t = typename DIMENSIONS::dynamic_vector_t
 
using controller_t = ControllerBase< STATE_DIM, INPUT_DIM >
 
- Public Types inherited from ocs2::OdeBase< STATE_DIM >
using DIMENSIONS = Dimensions< STATE_DIM, 0 >
 
using scalar_t = typename DIMENSIONS::scalar_t
 
using state_vector_t = typename DIMENSIONS::state_vector_t
 
using dynamic_vector_t = typename DIMENSIONS::dynamic_vector_t
 

Public Member Functions

 ControlledSystemBase ()
 
 ControlledSystemBase (const ControlledSystemBase &rhs)
 
virtual ~ControlledSystemBase ()=default
 
virtual void reset ()
 
void setController (controller_t *controllerPtr)
 
void computeFlowMap (const scalar_t &t, const state_vector_t &x, state_vector_t &dxdt) override
 
virtual ControlledSystemBase< STATE_DIM, INPUT_DIM > * clone () const =0
 
virtual void computeFlowMap (const scalar_t &t, const state_vector_t &x, const input_vector_t &u, state_vector_t &dxdt)=0
 
controller_tcontrollerPtr () const
 
- Public Member Functions inherited from ocs2::OdeBase< STATE_DIM >
 OdeBase ()
 
virtual ~OdeBase ()=default
 
 OdeBase (const OdeBase &rhs)
 
int getNumFunctionCalls ()
 
void resetNumFunctionCalls ()
 
virtual void computeJumpMap (const scalar_t &time, const state_vector_t &state, state_vector_t &mappedState)
 
virtual void computeGuardSurfaces (const scalar_t &time, const state_vector_t &state, dynamic_vector_t &guardSurfacesValue)
 

Private Attributes

controller_tcontrollerPtr_
 

Additional Inherited Members

- Protected Attributes inherited from ocs2::OdeBase< STATE_DIM >
int numFunctionCalls_
 

Member Typedef Documentation

◆ BASE

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::BASE = OdeBase<STATE_DIM>

◆ ConstPtr

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::ConstPtr = std::shared_ptr<const ControlledSystemBase<STATE_DIM, INPUT_DIM> >

◆ constraint1_vector_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::constraint1_vector_t = typename DIMENSIONS::constraint1_vector_t

◆ constraint2_vector_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::constraint2_vector_t = typename DIMENSIONS::constraint2_vector_t

◆ controller_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::controller_t = ControllerBase<STATE_DIM, INPUT_DIM>

◆ DIMENSIONS

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::DIMENSIONS = Dimensions<STATE_DIM, INPUT_DIM>

◆ dynamic_vector_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::dynamic_vector_t = typename DIMENSIONS::dynamic_vector_t

◆ input_state_matrix_array_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::input_state_matrix_array_t = typename DIMENSIONS::input_state_matrix_array_t

◆ input_state_matrix_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::input_state_matrix_t = typename DIMENSIONS::input_state_matrix_t

◆ input_vector_array_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::input_vector_array_t = typename DIMENSIONS::input_vector_array_t

◆ input_vector_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::input_vector_t = typename DIMENSIONS::input_vector_t

◆ Ptr

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::Ptr = std::shared_ptr<ControlledSystemBase<STATE_DIM, INPUT_DIM> >

◆ scalar_array_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::scalar_array_t = typename DIMENSIONS::scalar_array_t

◆ scalar_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::scalar_t = typename DIMENSIONS::scalar_t

◆ state_vector_array_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::state_vector_array_t = typename DIMENSIONS::state_vector_array_t

◆ state_vector_t

template<size_t STATE_DIM, size_t INPUT_DIM>
using ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::state_vector_t = typename DIMENSIONS::state_vector_t

Constructor & Destructor Documentation

◆ ControlledSystemBase() [1/2]

template<size_t STATE_DIM, size_t INPUT_DIM>
ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::ControlledSystemBase ( )
inline

Default constructor.

◆ ControlledSystemBase() [2/2]

template<size_t STATE_DIM, size_t INPUT_DIM>
ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::ControlledSystemBase ( const ControlledSystemBase< STATE_DIM, INPUT_DIM > &  rhs)
inline

Copy constructor.

◆ ~ControlledSystemBase()

template<size_t STATE_DIM, size_t INPUT_DIM>
virtual ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::~ControlledSystemBase ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ clone()

◆ computeFlowMap() [1/2]

template<size_t STATE_DIM, size_t INPUT_DIM>
void ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::computeFlowMap ( const scalar_t t,
const state_vector_t x,
state_vector_t dxdt 
)
inlineoverridevirtual

Computes derivative of the autonomous system dynamics with the given control policy.

Parameters
[in]tCurrent time.
[in]xCurrent state.
[out]dxdtCurrent state time derivative.

Implements ocs2::OdeBase< STATE_DIM >.

◆ computeFlowMap() [2/2]

◆ controllerPtr()

template<size_t STATE_DIM, size_t INPUT_DIM>
controller_t* ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::controllerPtr ( ) const
inline

Returns the controller pointer.

Returns
A pointer to controller.

◆ reset()

template<size_t STATE_DIM, size_t INPUT_DIM>
virtual void ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::reset ( )
inlinevirtual

Resets the internal classes.

◆ setController()

template<size_t STATE_DIM, size_t INPUT_DIM>
void ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::setController ( controller_t controllerPtr)
inline

Sets the control policy using the controller class.

Parameters
[in]controllerPtrA pointer to the control policy.

Member Data Documentation

◆ controllerPtr_

template<size_t STATE_DIM, size_t INPUT_DIM>
controller_t* ocs2::ControlledSystemBase< STATE_DIM, INPUT_DIM >::controllerPtr_
private

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