- 3.0.2 optimal control module.
|
interface class for optimal control algorithms More...
#include <OptconContinuousSystemInterface.h>
Public Member Functions | |
OptconContinuousSystemInterface (const optConProblem_t &problem, const settings_t &settings) | |
constructor More... | |
virtual | ~OptconContinuousSystemInterface () |
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 |
virtual void | changeNumStages (const int numStages) override |
set the number of stages/time steps More... | |
virtual void | getSubstates (StateVectorArrayPtr &subStepsX, const size_t threadId) override |
virtual void | getSubcontrols (ControlVectorArrayPtr &subStepsU, const size_t threadId) override |
virtual void | setSubstepTrajectoryReference (const StateSubstepsPtr &xSubsteps, const ControlSubstepsPtr &uSubsteps, const size_t threadId) override |
Public Member Functions inherited from ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< 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... | |
const optConProblem_t & | getOptConProblem () |
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, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR > | Base |
Public Attributes inherited from ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR > | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ct::core::ControlVector< CONTROL_DIM, SCALAR > | control_vector_t |
Additional Inherited Members | |
Protected Attributes inherited from ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR > | |
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... | |
interface class for optimal control algorithms
Defines the unified interface for optimal control solvers used in conjuction with a continuous optimal control problem. It bundles the optcon problem with system integrators and sensitivities.
STATE_DIM | size of state vector |
CONTROL_DIM | size of input vector |
P_DIM | size for symplectic integrator |
V_DIM | size for symplectic integrator |
SCALAR | the underlying scalar type |
typedef Base::control_vector_t ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::control_vector_t |
typedef Base::state_vector_t ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::state_vector_t |
typedef Base::state_matrix_t ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::state_matrix_t |
typedef Base::state_control_matrix_t ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::state_control_matrix_t |
typedef ct::core::SystemDiscretizer<STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR> ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::discretizer_t |
typedef std::shared_ptr<discretizer_t> ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::system_discretizer_ptr_t |
typedef ct::core::Sensitivity<STATE_DIM, CONTROL_DIM, SCALAR> ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::Sensitivity_t |
typedef std::shared_ptr<Sensitivity_t> ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::SensitivityPtr |
typedef Base::StateVectorArrayPtr ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::StateVectorArrayPtr |
typedef Base::StateSubstepsPtr ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::StateSubstepsPtr |
typedef Base::ControlVectorArrayPtr ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::ControlVectorArrayPtr |
typedef Base::ControlSubstepsPtr ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::ControlSubstepsPtr |
typedef Base::optConProblem_t ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::optConProblem_t |
typedef Base::settings_t ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::settings_t |
ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::OptconContinuousSystemInterface | ( | const optConProblem_t & | problem, |
const settings_t & | settings | ||
) |
constructor
|
inlinevirtual |
destructor
References ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::changeLinearSystem(), ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::changeNonlinearSystem(), ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::changeNumStages(), ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::configure(), ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::getAandB(), ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::getSubcontrols(), ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::getSubstates(), ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::initialize(), n, ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::propagateControlledDynamics(), ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::setSubstepTrajectoryReference(), u, and x.
|
overridevirtual |
perform necessary setup work
Reimplemented from ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >.
References ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::controller_, ct::optcon::NLOptConSettings::discretization, ct::optcon::NLOptConSettings::dt, ct::optcon::OptConProblemBase< STATE_DIM, CONTROL_DIM, SYSTEM_T, LINEAR_SYSTEM_T, LINEARIZER_T, SCALAR >::getLinearSystem(), ct::optcon::OptConProblemBase< STATE_DIM, CONTROL_DIM, SYSTEM_T, LINEAR_SYSTEM_T, LINEARIZER_T, SCALAR >::getNonlinearSystem(), ct::optcon::NLOptConSettings::getSimulationTimestep(), i, ct::optcon::NLOptConSettings::integrator, ct::optcon::NLOptConSettings::K_sim, ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::linearSystems_, ct::optcon::NLOptConSettings::nThreads, ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::optConProblem_, ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::settings_, ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::systems_, ct::optcon::NLOptConSettings::timeVaryingDiscretization, and ct::optcon::NLOptConSettings::useSensitivityIntegrator.
Referenced by ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::~OptconContinuousSystemInterface().
|
overridevirtual |
|
overridevirtual |
retrieve discrete-time linear system matrices A and B.
x | the state setpoint |
u | the control setpoint |
x_next | the next state |
n | the time setpoint |
subSteps | number of substeps of trajectory for which to get the sensitivity for |
A | the resulting linear system matrix A |
B | the resulting linear system matrix B |
threadId | which thread specific instantiations to use |
Referenced by ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::~OptconContinuousSystemInterface().
|
overridevirtual |
propagate discrete-time dynamics
state | start state to propagate from |
n | discrete time index to propagate the dynamics at |
control | the control input to apply. This is a constant control input applied during the discretization interval |
stateNext | the resulting propagated state |
threadId | which thread specific instantiations to use |
Referenced by ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::~OptconContinuousSystemInterface().
|
overridevirtual |
References ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::controller_, ct::optcon::NLOptConSettings::dt, i, ct::optcon::NLOptConSettings::integrator, ct::optcon::NLOptConSettings::K_sim, ct::optcon::NLOptConSettings::nThreads, ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::settings_, and ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::systems_.
Referenced by ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::~OptconContinuousSystemInterface().
|
overridevirtual |
References i, ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::linearSystems_, ct::optcon::NLOptConSettings::nThreads, and ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >::settings_.
Referenced by ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::~OptconContinuousSystemInterface().
|
overridevirtual |
set the number of stages/time steps
Reimplemented from ct::optcon::OptconSystemInterface< STATE_DIM, CONTROL_DIM, ContinuousOptConProblem< STATE_DIM, CONTROL_DIM, SCALAR >, SCALAR >.
Referenced by ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::~OptconContinuousSystemInterface().
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef OptconSystemInterface<STATE_DIM, CONTROL_DIM, ContinuousOptConProblem<STATE_DIM, CONTROL_DIM, SCALAR>, SCALAR> ct::optcon::OptconContinuousSystemInterface< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >::Base |