- 3.0.2 optimal control module.
|
Contains all the constraints using analytically calculated jacobians. More...
#include <ConstraintContainerAnalytical.h>
Public Types | |
typedef core::ControlVector< CONTROL_DIM, SCALAR > | input_vector_t |
typedef ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR > * | ConstraintContainerAnalytical_Raw_Ptr_t |
typedef Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > | VectorXs |
typedef Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > | MatrixXs |
Public Types inherited from ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR > | |
typedef core::ControlVector< CONTROL_DIM, SCALAR > | input_vector_t |
typedef LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR > * | LinearConstraintContainer_Raw_Ptr_t |
typedef Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > | VectorXs |
typedef Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > | MatrixXs |
Public Types inherited from ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR > | |
typedef core::ControlVector< CONTROL_DIM, SCALAR > | input_vector_t |
typedef ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR > * | ConstraintBase_Raw_Ptr_t |
typedef Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > | VectorXs |
Public Member Functions | |
ConstraintContainerAnalytical () | |
ConstraintContainerAnalytical (const state_vector_t &x, const input_vector_t &u, const SCALAR &t=0.0) | |
Constructor using state, control and time. More... | |
ConstraintContainerAnalytical (const ConstraintContainerAnalytical &arg) | |
Copy constructor. More... | |
virtual ConstraintContainerAnalytical_Raw_Ptr_t | clone () const override |
Deep-cloning of Constraint. More... | |
virtual | ~ConstraintContainerAnalytical () |
Destructor. More... | |
void | addIntermediateConstraint (std::shared_ptr< ConstraintBase< STATE_DIM, CONTROL_DIM, SCALAR >> constraint, bool verbose) |
Adds an intermedaite constraint. More... | |
void | addTerminalConstraint (std::shared_ptr< ConstraintBase< STATE_DIM, CONTROL_DIM, SCALAR >> constraint, bool verbose) |
Adds a terminal constraint. More... | |
virtual VectorXs | evaluateIntermediate () override |
Evaluates the intermediate constraints. More... | |
virtual VectorXs | evaluateTerminal () override |
Evaluates the terminal constraints. More... | |
virtual size_t | getIntermediateConstraintsCount () override |
Retrieves the number of intermediate constraints. More... | |
virtual size_t | getTerminalConstraintsCount () override |
Retrieves the number of final constraints. More... | |
virtual VectorXs | jacobianStateSparseIntermediate () override |
Evaluates the constraint jacobian wrt the state using sparse representation. More... | |
virtual MatrixXs | jacobianStateIntermediate () override |
Evaluates the constraint jacobian wrt the state. More... | |
virtual VectorXs | jacobianStateSparseTerminal () override |
Evaluates the constraint jacobian wrt the state using sparse representation. More... | |
virtual MatrixXs | jacobianStateTerminal () override |
Evaluates the constraint jacobian wrt the state. More... | |
virtual VectorXs | jacobianInputSparseIntermediate () override |
Evaluates the constraint jacobian wrt the control input using sparse representation. More... | |
virtual MatrixXs | jacobianInputIntermediate () override |
Evaluates the constraint jacobian wrt the control input. More... | |
virtual VectorXs | jacobianInputSparseTerminal () override |
Evaluates the constraint jacobian wrt the control input using sparse representation. More... | |
virtual MatrixXs | jacobianInputTerminal () override |
Evaluates the constraint jacobian wrt the control input. More... | |
virtual void | sparsityPatternStateIntermediate (Eigen::VectorXi &iRows, Eigen::VectorXi &jCols) override |
Returns the sparsity pattern for the jacobian wrt state. More... | |
virtual void | sparsityPatternStateTerminal (Eigen::VectorXi &iRows, Eigen::VectorXi &jCols) override |
Returns the sparsity pattern for the jacobian wrt state. More... | |
virtual void | sparsityPatternInputIntermediate (Eigen::VectorXi &iRows, Eigen::VectorXi &jCols) override |
Returns the sparsity pattern for the jacobian wrt control. More... | |
virtual void | sparsityPatternInputTerminal (Eigen::VectorXi &iRows, Eigen::VectorXi &jCols) override |
Returns the sparsity pattern for the jacobian wrt control. More... | |
virtual size_t | getJacobianStateNonZeroCountIntermediate () override |
Returns the number of non zero elements in the constraint jacobian wrt state. More... | |
virtual size_t | getJacobianStateNonZeroCountTerminal () override |
Returns the number of non zero elements in the constraint jacobian wrt state. More... | |
virtual size_t | getJacobianInputNonZeroCountIntermediate () override |
Returns the number of non zero elements in the constraint jacobian wrt input. More... | |
virtual size_t | getJacobianInputNonZeroCountTerminal () override |
Returns the number of non zero elements in the constraint jacobian wrt input. More... | |
virtual bool | initializeIntermediate () override |
Initializes the intermediate constraints. More... | |
virtual bool | initializeTerminal () override |
Initializes the terminal constraints. More... | |
Public Member Functions inherited from ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR > | |
LinearConstraintContainer () | |
Default constructor. More... | |
LinearConstraintContainer (const LinearConstraintContainer &arg) | |
Copy constructor. More... | |
virtual | ~LinearConstraintContainer () |
Destructor. More... | |
size_t | getJacNonZeroCount () |
Returns the number of non zeros in the constraint jacobian wrt to state and input. More... | |
void | initialize () |
Initializes the constraint container. More... | |
bool | isInitialized () |
Checks if the constraint container is initialized. More... | |
void | printout () |
Print out sparsity patterns, jacobians, etc. Serves for quick visual inspection. More... | |
Public Member Functions inherited from ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR > | |
ConstraintContainerBase () | |
Default constructor. More... | |
ConstraintContainerBase (const ConstraintContainerBase &arg) | |
copy constructor More... | |
virtual | ~ConstraintContainerBase () |
Destructor. More... | |
virtual void | setCurrentStateAndControl (const state_vector_t &x, const input_vector_t &u, const SCALAR t=SCALAR(0.0)) |
size_t | getConstraintsCount () |
Retrieves the total number of constraints. More... | |
VectorXs | getLowerBoundsIntermediate () const |
Retrieves the lower constraint bound on the intermediate constraints. More... | |
VectorXs | getLowerBoundsTerminal () const |
Retrieves the lower constraint bound on the terminal constraints. More... | |
VectorXs | getUpperBoundsIntermediate () const |
Retrieves the upper constraint bound on the intermediate constraints. More... | |
VectorXs | getUpperBoundsTerminal () const |
Retrieves the upper constraint bound on the terminal constraints. More... | |
VectorXs | getUpperBoundsViolationIntermediate () |
Retrieves the violation of the upper constraint bound on the intermediate constraints. More... | |
VectorXs | getLowerBoundsViolationIntermediate () |
Retrieves the violation of the lower constraint bound on the intermediate constraints. More... | |
VectorXs | getUpperBoundsViolationTerminal () |
Retrieves the violation of the upper constraint bound on the terminal constraints. More... | |
VectorXs | getLowerBoundsViolationTerminal () |
Retrieves the violation of the lower constraint bound on the terminal constraints. More... | |
VectorXs | getTotalBoundsViolationIntermediate () |
Retrieves the total violation of the constraints bounds on the intermediate constraints. More... | |
VectorXs | getTotalBoundsViolationTerminal () |
Retrieves the total violation of the constraints bounds on the terminal constraints. More... | |
Public Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef core::StateVector< STATE_DIM, SCALAR > | state_vector_t |
Public Attributes inherited from ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR > | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef core::StateVector< STATE_DIM, SCALAR > | state_vector_t |
Public Attributes inherited from ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR > | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef core::StateVector< STATE_DIM, SCALAR > | state_vector_t |
Additional Inherited Members | |
Protected Attributes inherited from ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR > | |
bool | initializedIntermediate_ |
bool | initializedTerminal_ |
Protected Attributes inherited from ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR > | |
state_vector_t | x_ |
input_vector_t | u_ |
SCALAR | t_ |
VectorXs | lowerBoundsIntermediate_ |
VectorXs | lowerBoundsTerminal_ |
VectorXs | upperBoundsIntermediate_ |
VectorXs | upperBoundsTerminal_ |
Contains all the constraints using analytically calculated jacobians.
STATE_DIM | The state dimension |
CONTROL_DIM | The control dimension |
typedef core::ControlVector<CONTROL_DIM, SCALAR> ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::input_vector_t |
typedef ConstraintContainerAnalytical<STATE_DIM, CONTROL_DIM, SCALAR>* ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::ConstraintContainerAnalytical_Raw_Ptr_t |
typedef Eigen::Matrix<SCALAR, Eigen::Dynamic, 1> ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::VectorXs |
typedef Eigen::Matrix<SCALAR, Eigen::Dynamic, Eigen::Dynamic> ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::MatrixXs |
ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::ConstraintContainerAnalytical | ( | ) |
ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::ConstraintContainerAnalytical | ( | const state_vector_t & | x, |
const input_vector_t & | u, | ||
const SCALAR & | t = 0.0 |
||
) |
Constructor using state, control and time.
x | state vector |
u | control vector |
t | time |
ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::ConstraintContainerAnalytical | ( | const ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR > & | arg | ) |
|
virtual |
Destructor.
|
overridevirtual |
Deep-cloning of Constraint.
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
void ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::addIntermediateConstraint | ( | std::shared_ptr< ConstraintBase< STATE_DIM, CONTROL_DIM, SCALAR >> | constraint, |
bool | verbose | ||
) |
Adds an intermedaite constraint.
[in] | constraint | The constraint to be added |
[in] | verbose | Flag indicating whether verbosity is on or off |
References ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializedIntermediate_.
void ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::addTerminalConstraint | ( | std::shared_ptr< ConstraintBase< STATE_DIM, CONTROL_DIM, SCALAR >> | constraint, |
bool | verbose | ||
) |
Adds a terminal constraint.
[in] | constraint | The constraint to be added |
[in] | verbose | Flag indicating whether verbosity is on or off |
References ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializedTerminal_.
|
overridevirtual |
Evaluates the intermediate constraints.
Implements ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::t_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::u_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::x_.
|
overridevirtual |
Evaluates the terminal constraints.
Implements ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::t_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::u_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::x_.
|
overridevirtual |
Retrieves the number of intermediate constraints.
Implements ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::initializeIntermediate().
|
overridevirtual |
Retrieves the number of final constraints.
Implements ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal().
|
overridevirtual |
Evaluates the constraint jacobian wrt the state using sparse representation.
jacVec | The sparse jacobian vector |
count | The size of jacVec |
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::t_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::u_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::x_.
|
overridevirtual |
Evaluates the constraint jacobian wrt the state.
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::t_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::u_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::x_.
|
overridevirtual |
Evaluates the constraint jacobian wrt the state using sparse representation.
jacVec | The sparse jacobian vector |
count | The size of jacVec |
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::t_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::u_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::x_.
|
overridevirtual |
Evaluates the constraint jacobian wrt the state.
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::t_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::u_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::x_.
|
overridevirtual |
Evaluates the constraint jacobian wrt the control input using sparse representation.
jacVec | The sparse jacobian vector |
count | The size of jacVec |
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::t_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::u_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::x_.
|
overridevirtual |
Evaluates the constraint jacobian wrt the control input.
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::t_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::u_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::x_.
|
overridevirtual |
Evaluates the constraint jacobian wrt the control input using sparse representation.
jacVec | The sparse jacobian vector |
count | The size of jacVec |
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::t_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::u_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::x_.
|
overridevirtual |
Evaluates the constraint jacobian wrt the control input.
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::t_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::u_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::x_.
|
overridevirtual |
Returns the sparsity pattern for the jacobian wrt state.
iRows | The vector of the row indices containing non zero elements in the constraint jacobian |
jCols | The vector of the column indices containing non zero elements in the constraint jacobian |
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
|
overridevirtual |
Returns the sparsity pattern for the jacobian wrt state.
iRows | The vector of the row indices containing non zero elements in the constraint jacobian |
jCols | The vector of the column indices containing non zero elements in the constraint jacobian |
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializedTerminal_.
|
overridevirtual |
Returns the sparsity pattern for the jacobian wrt control.
iRows | The vector of the row indices containing non zero elements in the constraint jacobian |
jCols | The vector of the column indices containing non zero elements in the constraint jacobian |
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
|
overridevirtual |
Returns the sparsity pattern for the jacobian wrt control.
iRows | The vector of the row indices containing non zero elements in the constraint jacobian |
jCols | The vector of the column indices containing non zero elements in the constraint jacobian |
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializedTerminal_.
|
overridevirtual |
Returns the number of non zero elements in the constraint jacobian wrt state.
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::initializeIntermediate().
|
overridevirtual |
Returns the number of non zero elements in the constraint jacobian wrt state.
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal().
|
overridevirtual |
Returns the number of non zero elements in the constraint jacobian wrt input.
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::initializeIntermediate().
|
overridevirtual |
Returns the number of non zero elements in the constraint jacobian wrt input.
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
Referenced by ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::initializeTerminal().
|
overridevirtual |
Initializes the intermediate constraints.
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::getIntermediateConstraintsCount(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::getJacobianInputNonZeroCountIntermediate(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::getJacobianStateNonZeroCountIntermediate(), ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::lowerBoundsIntermediate_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::upperBoundsIntermediate_.
|
overridevirtual |
Initializes the terminal constraints.
Implements ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >.
References ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::getJacobianInputNonZeroCountTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::getJacobianStateNonZeroCountTerminal(), ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::getTerminalConstraintsCount(), ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializedIntermediate_, ct::optcon::LinearConstraintContainer< STATE_DIM, CONTROL_DIM, SCALAR >::initializedTerminal_, ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::lowerBoundsTerminal_, and ct::optcon::ConstraintContainerBase< STATE_DIM, CONTROL_DIM, SCALAR >::upperBoundsTerminal_.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef core::StateVector<STATE_DIM, SCALAR> ct::optcon::ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR >::state_vector_t |