- 3.0.2 optimal control module.
ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR > Class Template Referenceabstract

interface base class for optimal control algorithms More...

#include <OptconSystemInterface.h>

Public Types

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 OPTCONPROBLEM optConProblem_t
 
typedef NLOptConSettings settings_t
 

Public Member Functions

 OptconSystemInterface (const optConProblem_t &problem, const settings_t &settings)
 constructor More...
 
virtual void initialize ()
 perform any required setup work 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 ct::core::ControlVector< CONTROL_DIM, SCALARcontrol_vector_t
 

Protected Attributes

std::vector< typename optConProblem_t::DynamicsPtr_t > systems_
 
std::vector< typename optConProblem_t::LinearPtr_t > linearSystems_
 
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 OPTCONPROBLEM, typename SCALAR = double>
class ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >

interface base class for optimal control algorithms

Defines the unified interface for optimal control solvers. It bundles the optimal control problem with required tools to propagate the system dynamics and provide corresponding sensitivities.

Template Parameters
STATE_DIMsize of state vector
CONTROL_DIMsize of input vector
OPTCONPROBLEMtype of the optConProblem (continuous or discrete)
SCALARthe underlying scalar type

Member Typedef Documentation

◆ state_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef ct::core::StateVector<STATE_DIM, SCALAR> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::state_vector_t

◆ state_matrix_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef ct::core::StateMatrix<STATE_DIM, SCALAR> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::state_matrix_t

◆ state_control_matrix_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef ct::core::StateControlMatrix<STATE_DIM, CONTROL_DIM, SCALAR> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::state_control_matrix_t

◆ StateVectorArray

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef ct::core::StateVectorArray<STATE_DIM, SCALAR> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::StateVectorArray

◆ StateVectorArrayPtr

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef std::shared_ptr<StateVectorArray> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::StateVectorArrayPtr

◆ StateSubsteps

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef std::vector<StateVectorArrayPtr, Eigen::aligned_allocator<StateVectorArrayPtr> > ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::StateSubsteps

◆ StateSubstepsPtr

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef std::shared_ptr<StateSubsteps> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::StateSubstepsPtr

◆ ControlVectorArray

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef ct::core::ControlVectorArray<CONTROL_DIM, SCALAR> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::ControlVectorArray

◆ ControlVectorArrayPtr

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef std::shared_ptr<ControlVectorArray> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::ControlVectorArrayPtr

◆ ControlSubsteps

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef std::vector<ControlVectorArrayPtr, Eigen::aligned_allocator<ControlVectorArrayPtr> > ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::ControlSubsteps

◆ ControlSubstepsPtr

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef std::shared_ptr<ControlSubsteps> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::ControlSubstepsPtr

◆ constant_controller_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef ct::core::ConstantController<STATE_DIM, CONTROL_DIM, SCALAR> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::constant_controller_t

◆ ConstantControllerPtr

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef std::shared_ptr<constant_controller_t> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::ConstantControllerPtr

◆ optConProblem_t

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

◆ settings_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
typedef NLOptConSettings ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::settings_t

Constructor & Destructor Documentation

◆ OptconSystemInterface()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::OptconSystemInterface ( const optConProblem_t problem,
const settings_t settings 
)
inline

constructor

Member Function Documentation

◆ initialize()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
virtual void ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::initialize ( )
inlinevirtual

◆ configure()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
virtual void ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::configure ( const settings_t settings)
inlinevirtual

◆ getAandB()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
virtual void ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, 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 
)
pure virtual

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

Referenced by ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::configure().

◆ propagateControlledDynamics()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
virtual void ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::propagateControlledDynamics ( const state_vector_t state,
const time_t  n,
const control_vector_t control,
state_vector_t stateNext,
const size_t  threadId 
)
pure virtual

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

Referenced by ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::configure().

◆ changeNumStages()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
virtual void ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::changeNumStages ( const int  numStages)
inlinevirtual

◆ getOptConProblem()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
const optConProblem_t& ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::getOptConProblem ( )
inline

◆ getNonlinearSystemsInstances()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
std::vector<typename optConProblem_t::DynamicsPtr_t>& ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::getNonlinearSystemsInstances ( )
inline

◆ getLinearSystemsInstances()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
std::vector<typename optConProblem_t::LinearPtr_t>& ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::getLinearSystemsInstances ( )
inline

◆ changeNonlinearSystem()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
virtual void ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::changeNonlinearSystem ( const typename optConProblem_t::DynamicsPtr_t &  dyn)
pure virtual

◆ changeLinearSystem()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
virtual void ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::changeLinearSystem ( const typename optConProblem_t::LinearPtr_t &  lin)
pure virtual

◆ getSubstates()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
virtual void ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::getSubstates ( StateVectorArrayPtr subStepsX,
const size_t  threadId 
)
inlinevirtual

◆ getSubcontrols()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
virtual void ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::getSubcontrols ( ControlVectorArrayPtr subStepsU,
const size_t  threadId 
)
inlinevirtual

◆ setSubstepTrajectoryReference()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
virtual void ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::setSubstepTrajectoryReference ( const StateSubstepsPtr xSubsteps,
const ControlSubstepsPtr uSubsteps,
const size_t  threadId 
)
inlinevirtual

Member Data Documentation

◆ control_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ct::core::ControlVector<CONTROL_DIM, SCALAR> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::control_vector_t

◆ systems_

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
std::vector<typename optConProblem_t::DynamicsPtr_t> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::systems_
protected

of the following objects, we have nThreads+1 instantiations in form of a vector. Every instantiation is dedicated to a certain thread in the multi-thread implementation

Referenced by ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, DiscreteOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::getNonlinearSystemsInstances().

◆ linearSystems_

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
std::vector<typename optConProblem_t::LinearPtr_t> ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::linearSystems_
protected

◆ controller_

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
std::vector<ConstantControllerPtr, Eigen::aligned_allocator<ConstantControllerPtr> > ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::controller_
protected

◆ optConProblem_

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
optConProblem_t ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::optConProblem_
protected

◆ settings_

template<size_t STATE_DIM, size_t CONTROL_DIM, typename OPTCONPROBLEM, typename SCALAR = double>
settings_t ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, OPTCONPROBLEM, SCALAR >::settings_
protected

instance of the optconProblem


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