26 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR =
double>
30 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
36 typedef Eigen::Matrix<SCALAR, Eigen::Dynamic, 1>
VectorXs;
37 typedef Eigen::Matrix<SCALAR, Eigen::Dynamic, Eigen::Dynamic>
MatrixXs;
62 virtual ConstraintContainerAnalytical_Raw_Ptr_t
clone()
const override;
133 virtual void update()
override;
139 void checkIntermediateConstraints();
145 void checkTerminalConstraints();
148 std::vector<std::shared_ptr<ConstraintBase<STATE_DIM, CONTROL_DIM, SCALAR>>> constraintsIntermediate_;
149 std::vector<std::shared_ptr<ConstraintBase<STATE_DIM, CONTROL_DIM, SCALAR>>> constraintsTerminal_;
151 VectorXs evalIntermediate_;
152 VectorXs evalJacSparseStateIntermediate_;
153 VectorXs evalJacSparseInputIntermediate_;
154 MatrixXs evalJacDenseStateIntermediate_;
155 MatrixXs evalJacDenseInputIntermediate_;
157 VectorXs evalTerminal_;
158 VectorXs evalJacSparseStateTerminal_;
159 VectorXs evalJacSparseInputTerminal_;
160 MatrixXs evalJacDenseStateTerminal_;
161 MatrixXs evalJacDenseInputTerminal_;
core::ControlVector< CONTROL_DIM, SCALAR > input_vector_t
Definition: ConstraintContainerAnalytical.h:33
virtual void sparsityPatternInputTerminal(Eigen::VectorXi &iRows, Eigen::VectorXi &jCols) override
Returns the sparsity pattern for the jacobian wrt control.
Definition: ConstraintContainerAnalytical-impl.h:421
virtual ConstraintContainerAnalytical_Raw_Ptr_t clone() const override
Deep-cloning of Constraint.
Definition: ConstraintContainerAnalytical-impl.h:56
virtual MatrixXs jacobianStateIntermediate() override
Evaluates the constraint jacobian wrt the state.
Definition: ConstraintContainerAnalytical-impl.h:172
virtual size_t getJacobianInputNonZeroCountIntermediate() override
Returns the number of non zero elements in the constraint jacobian wrt input.
Definition: ConstraintContainerAnalytical-impl.h:479
virtual VectorXs jacobianStateSparseTerminal() override
Evaluates the constraint jacobian wrt the state using sparse representation.
Definition: ConstraintContainerAnalytical-impl.h:191
virtual void sparsityPatternStateTerminal(Eigen::VectorXi &iRows, Eigen::VectorXi &jCols) override
Returns the sparsity pattern for the jacobian wrt state.
Definition: ConstraintContainerAnalytical-impl.h:346
A base function for linear constraint functions which have a first derivative.
Definition: LinearConstraintContainer.h:27
void addTerminalConstraint(std::shared_ptr< ConstraintBase< STATE_DIM, CONTROL_DIM, SCALAR >> constraint, bool verbose)
Adds a terminal constraint.
Definition: ConstraintContainerAnalytical-impl.h:82
virtual size_t getJacobianInputNonZeroCountTerminal() override
Returns the number of non zero elements in the constraint jacobian wrt input.
Definition: ConstraintContainerAnalytical-impl.h:489
ct::core::ControlVector< control_dim > u
Definition: LoadFromFileTest.cpp:21
virtual bool initializeTerminal() override
Initializes the terminal constraints.
Definition: ConstraintContainerAnalytical-impl.h:534
virtual MatrixXs jacobianStateTerminal() override
Evaluates the constraint jacobian wrt the state.
Definition: ConstraintContainerAnalytical-impl.h:212
virtual VectorXs jacobianInputSparseIntermediate() override
Evaluates the constraint jacobian wrt the control input using sparse representation.
Definition: ConstraintContainerAnalytical-impl.h:230
virtual size_t getIntermediateConstraintsCount() override
Retrieves the number of intermediate constraints.
Definition: ConstraintContainerAnalytical-impl.h:129
virtual size_t getTerminalConstraintsCount() override
Retrieves the number of final constraints.
Definition: ConstraintContainerAnalytical-impl.h:140
virtual VectorXs evaluateTerminal() override
Evaluates the terminal constraints.
Definition: ConstraintContainerAnalytical-impl.h:114
virtual VectorXs jacobianStateSparseIntermediate() override
Evaluates the constraint jacobian wrt the state using sparse representation.
Definition: ConstraintContainerAnalytical-impl.h:151
virtual void sparsityPatternInputIntermediate(Eigen::VectorXi &iRows, Eigen::VectorXi &jCols) override
Returns the sparsity pattern for the jacobian wrt control.
Definition: ConstraintContainerAnalytical-impl.h:384
void addIntermediateConstraint(std::shared_ptr< ConstraintBase< STATE_DIM, CONTROL_DIM, SCALAR >> constraint, bool verbose)
Adds an intermedaite constraint.
Definition: ConstraintContainerAnalytical-impl.h:67
virtual VectorXs evaluateIntermediate() override
Evaluates the intermediate constraints.
Definition: ConstraintContainerAnalytical-impl.h:98
clear all close all load ct GNMSLog0 mat reformat t
Definition: gnmsPlot.m:6
virtual void sparsityPatternStateIntermediate(Eigen::VectorXi &iRows, Eigen::VectorXi &jCols) override
Returns the sparsity pattern for the jacobian wrt state.
Definition: ConstraintContainerAnalytical-impl.h:308
Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > VectorXs
Definition: ConstraintContainerAnalytical.h:36
CppAD::AD< CppAD::cg::CG< double > > SCALAR
virtual VectorXs jacobianInputSparseTerminal() override
Evaluates the constraint jacobian wrt the control input using sparse representation.
Definition: ConstraintContainerAnalytical-impl.h:269
virtual size_t getJacobianStateNonZeroCountIntermediate() override
Returns the number of non zero elements in the constraint jacobian wrt state.
Definition: ConstraintContainerAnalytical-impl.h:459
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > MatrixXs
Definition: ConstraintContainerAnalytical.h:37
ConstraintContainerAnalytical()
Definition: ConstraintContainerAnalytical-impl.h:12
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef core::StateVector< STATE_DIM, SCALAR > state_vector_t
Definition: ConstraintContainerAnalytical.h:32
Contains all the constraints using analytically calculated jacobians.
Definition: ConstraintContainerAnalytical.h:27
ct::core::StateVector< state_dim > x
Definition: LoadFromFileTest.cpp:20
virtual MatrixXs jacobianInputIntermediate() override
Evaluates the constraint jacobian wrt the control input.
Definition: ConstraintContainerAnalytical-impl.h:251
virtual bool initializeIntermediate() override
Initializes the intermediate constraints.
Definition: ConstraintContainerAnalytical-impl.h:499
ConstraintContainerAnalytical< STATE_DIM, CONTROL_DIM, SCALAR > * ConstraintContainerAnalytical_Raw_Ptr_t
Definition: ConstraintContainerAnalytical.h:35
virtual size_t getJacobianStateNonZeroCountTerminal() override
Returns the number of non zero elements in the constraint jacobian wrt state.
Definition: ConstraintContainerAnalytical-impl.h:469
virtual ~ConstraintContainerAnalytical()
Destructor.
Definition: ConstraintContainerAnalytical-impl.h:62
virtual MatrixXs jacobianInputTerminal() override
Evaluates the constraint jacobian wrt the control input.
Definition: ConstraintContainerAnalytical-impl.h:290
const bool verbose
Definition: ConstraintComparison.h:18
Base class for the constraints used in this toolbox.
Definition: ConstraintBase.h:21