- 3.0.2 optimal control module.
ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR > Class Template Reference

interface class for optimal control algorithms More...

#include <OptconDiscreteSystemInterface.h>

Inheritance diagram for ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >:
ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >

Public Types

typedef Base::control_vector_t control_vector_t
 
typedef Base::state_vector_t state_vector_t
 
typedef Base::state_matrix_t state_matrix_t
 
typedef Base::state_control_matrix_t state_control_matrix_t
 
typedef Base::StateVectorArrayPtr StateVectorArrayPtr
 
typedef Base::StateSubsteps StateSubsteps
 
typedef Base::ControlVectorArrayPtr ControlVectorArrayPtr
 
typedef Base::ControlSubsteps ControlSubsteps
 
typedef Base::optConProblem_t optConProblem_t
 
typedef Base::settings_t settings_t
 
- Public Types inherited from ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >
typedef ct::core::StateVector< STATE_DIM, SCALARstate_vector_t
 
typedef ct::core::StateMatrix< STATE_DIM, SCALARstate_matrix_t
 
typedef ct::core::StateControlMatrix< STATE_DIM, CONTROL_DIM, SCALARstate_control_matrix_t
 
typedef ct::core::StateVectorArray< STATE_DIM, SCALARStateVectorArray
 
typedef std::shared_ptr< StateVectorArrayStateVectorArrayPtr
 
typedef std::vector< StateVectorArrayPtr, Eigen::aligned_allocator< StateVectorArrayPtr > > StateSubsteps
 
typedef std::shared_ptr< StateSubstepsStateSubstepsPtr
 
typedef ct::core::ControlVectorArray< CONTROL_DIM, SCALARControlVectorArray
 
typedef std::shared_ptr< ControlVectorArrayControlVectorArrayPtr
 
typedef std::vector< ControlVectorArrayPtr, Eigen::aligned_allocator< ControlVectorArrayPtr > > ControlSubsteps
 
typedef std::shared_ptr< ControlSubstepsControlSubstepsPtr
 
typedef ct::core::ConstantController< STATE_DIM, CONTROL_DIM, SCALARconstant_controller_t
 
typedef std::shared_ptr< constant_controller_tConstantControllerPtr
 
typedef DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALARoptConProblem_t
 
typedef NLOptConSettings settings_t
 

Public Member Functions

 OptconDiscreteSystemInterface (const optConProblem_t &problem, const settings_t &settings)
 constructor More...
 
virtual ~OptconDiscreteSystemInterface ()=default
 destructor More...
 
virtual void initialize () override
 perform necessary setup work More...
 
virtual void configure (const settings_t &settings) override
 
virtual void getAandB (const state_vector_t &x, const control_vector_t &u, const state_vector_t &x_next, const int n, size_t subSteps, state_matrix_t &A, state_control_matrix_t &B, const size_t threadId) override
 retrieve discrete-time linear system matrices A and B. More...
 
virtual void propagateControlledDynamics (const state_vector_t &state, const time_t n, const control_vector_t &control, state_vector_t &stateNext, const size_t threadId) override
 propagate discrete-time dynamics More...
 
virtual void changeNonlinearSystem (const typename optConProblem_t::DynamicsPtr_t &dyn) override
 
virtual void changeLinearSystem (const typename optConProblem_t::LinearPtr_t &lin) override
 
- Public Member Functions inherited from ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >
 OptconSystemInterface (const optConProblem_t &problem, const settings_t &settings)
 constructor More...
 
virtual void configure (const settings_t &settings)
 
virtual void getAandB (const state_vector_t &x, const control_vector_t &u, const state_vector_t &x_next, const int n, size_t subSteps, state_matrix_t &A, state_control_matrix_t &B, const size_t threadId)=0
 retrieve discrete-time linear system matrices A and B. More...
 
virtual void propagateControlledDynamics (const state_vector_t &state, const time_t n, const control_vector_t &control, state_vector_t &stateNext, const size_t threadId)=0
 propagate discrete-time dynamics More...
 
virtual void changeNumStages (const int numStages)
 set the number of stages/time steps More...
 
const optConProblem_tgetOptConProblem ()
 
std::vector< typename optConProblem_t::DynamicsPtr_t > & getNonlinearSystemsInstances ()
 
std::vector< typename optConProblem_t::LinearPtr_t > & getLinearSystemsInstances ()
 
virtual void changeNonlinearSystem (const typename optConProblem_t::DynamicsPtr_t &dyn)=0
 
virtual void changeLinearSystem (const typename optConProblem_t::LinearPtr_t &lin)=0
 
virtual void getSubstates (StateVectorArrayPtr &subStepsX, const size_t threadId)
 
virtual void getSubcontrols (ControlVectorArrayPtr &subStepsU, const size_t threadId)
 
virtual void setSubstepTrajectoryReference (const StateSubstepsPtr &xSubsteps, const ControlSubstepsPtr &uSubsteps, const size_t threadId)
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALARBase
 
- Public Attributes inherited from ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ct::core::ControlVector< CONTROL_DIM, SCALARcontrol_vector_t
 

Additional Inherited Members

- Protected Attributes inherited from ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >
std::vector< typename optConProblem_t::DynamicsPtr_tsystems_
 
std::vector< typename optConProblem_t::LinearPtr_tlinearSystems_
 
std::vector< ConstantControllerPtr, Eigen::aligned_allocator< ConstantControllerPtr > > controller_
 
optConProblem_t optConProblem_
 the constant controller for forward-integration during one time-step More...
 
settings_t settings_
 instance of the optconProblem More...
 

Detailed Description

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
class ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >

interface class for optimal control algorithms

Defines the unified interface for optimal control solvers used in conjuction with a discrete optimal control problem.

Template Parameters
STATE_DIMsize of state vector
CONTROL_DIMsize of input vector
SCALARthe underlying scalar type

Member Typedef Documentation

◆ control_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::control_vector_t ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::control_vector_t

◆ state_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::state_vector_t ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::state_vector_t

◆ state_matrix_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::state_matrix_t ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::state_matrix_t

◆ state_control_matrix_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::state_control_matrix_t ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::state_control_matrix_t

◆ StateVectorArrayPtr

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::StateVectorArrayPtr ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::StateVectorArrayPtr

◆ StateSubsteps

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::StateSubsteps ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::StateSubsteps

◆ ControlVectorArrayPtr

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::ControlVectorArrayPtr ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::ControlVectorArrayPtr

◆ ControlSubsteps

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::ControlSubsteps ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::ControlSubsteps

◆ optConProblem_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::optConProblem_t ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::optConProblem_t

◆ settings_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::settings_t ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::settings_t

Constructor & Destructor Documentation

◆ OptconDiscreteSystemInterface()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::OptconDiscreteSystemInterface ( const optConProblem_t problem,
const settings_t settings 
)

constructor

◆ ~OptconDiscreteSystemInterface()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::~OptconDiscreteSystemInterface ( )
virtualdefault

destructor

Member Function Documentation

◆ initialize()

◆ configure()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
void ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::configure ( const settings_t settings)
overridevirtual

◆ getAandB()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
void ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::getAandB ( const state_vector_t x,
const control_vector_t u,
const state_vector_t x_next,
const int  n,
size_t  subSteps,
state_matrix_t A,
state_control_matrix_t B,
const size_t  threadId 
)
overridevirtual

retrieve discrete-time linear system matrices A and B.

Parameters
xthe state setpoint
uthe control setpoint
x_nextthe next state
nthe time setpoint
subStepsnumber of substeps of trajectory for which to get the sensitivity for
Athe resulting linear system matrix A
Bthe resulting linear system matrix B
threadIdwhich thread specific instantiations to use

References ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::linearSystems_.

◆ propagateControlledDynamics()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
void ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::propagateControlledDynamics ( const state_vector_t state,
const time_t  n,
const control_vector_t control,
state_vector_t stateNext,
const size_t  threadId 
)
overridevirtual

propagate discrete-time dynamics

Parameters
statestart state to propagate from
ndiscrete time index to propagate the dynamics at
controlthe control input to apply. This is a constant control input applied during the discretization interval
stateNextthe resulting propagated state
threadIdwhich thread specific instantiations to use

References ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::controller_, and ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::systems_.

◆ changeNonlinearSystem()

◆ changeLinearSystem()

Member Data Documentation

◆ Base

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef OptconSystemInterface<STATE_DIM, CONTROL_DIM, DiscreteOptConProblem<STATE_DIM, CONTROL_DIM, SCALAR>, SCALAR> ct::optcon::OptconDiscreteSystemInterface< STATE_DIM, CONTROL_DIM, SCALAR >::Base

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