11 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
15 Base::lb_.resize(STATE_DIM);
16 Base::ub_.resize(STATE_DIM);
18 Base::lb_.setConstant(
SCALAR(0.0));
19 Base::ub_.setConstant(
SCALAR(0.0));
22 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
28 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
30 :
Base(arg), xF_(arg.xF_)
34 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
39 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
45 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
55 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
56 Eigen::Matrix<ct::core::ADCGScalar, Eigen::Dynamic, 1>
60 ct::core::ADCGScalar
t)
62 return x - xF_.template cast<ct::core::ADCGScalar>();
66 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
72 return Eigen::Matrix<SCALAR, STATE_DIM, STATE_DIM>::Identity();
75 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
81 return Eigen::Matrix<SCALAR, STATE_DIM, CONTROL_DIM>::Zero();
84 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
90 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
96 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
105 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
virtual MatrixXs jacobianInput(const state_vector_t &x, const control_vector_t &u, const SCALAR t) override
Returns the constraint jacobian wrt input.
Definition: TerminalConstraint-impl.h:77
ct::core::ControlVector< control_dim > u
Definition: LoadFromFileTest.cpp:21
static void genDiagonalIndices(const size_t num_elements, Eigen::VectorXi &iRow_vec, Eigen::VectorXi &jCol_vec)
upper bound on the constraints
Definition: ConstraintBase-impl.h:136
virtual size_t getConstraintSize() const override
The evaluate method used for jit compilation in constraint container ad.
Definition: TerminalConstraint-impl.h:40
virtual TerminalConstraint< STATE_DIM, CONTROL_DIM, SCALAR > * clone() const override
Creates a new instance of the object with same properties than original.
Definition: TerminalConstraint-impl.h:23
clear all close all load ct GNMSLog0 mat reformat t
Definition: gnmsPlot.m:6
virtual ~TerminalConstraint()
Definition: TerminalConstraint-impl.h:35
virtual void sparsityPatternState(VectorXi &rows, VectorXi &cols) override
Definition: TerminalConstraint-impl.h:106
CppAD::AD< CppAD::cg::CG< double > > SCALAR
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > MatrixXs
Definition: TerminalConstraint.h:33
Eigen::Matrix< int, Eigen::Dynamic, 1 > VectorXi
Definition: TerminalConstraint.h:31
ct::core::StateVector< state_dim > x
Definition: LoadFromFileTest.cpp:20
virtual VectorXs evaluate(const state_vector_t &x, const control_vector_t &u, const SCALAR t) override
The evaluation of the constraint violation. Note this method is SCALAR typed.
Definition: TerminalConstraint-impl.h:47
virtual size_t getNumNonZerosJacobianInput() const override
Returns the number of nonzeros in the jacobian wrt control input. The default implementation assumes ...
Definition: TerminalConstraint-impl.h:91
virtual VectorXs jacobianStateSparse(const state_vector_t &x, const control_vector_t &u, const SCALAR t) override
Returns the constraint jacobian wrt state in sparse structure. The default implementation maps the Ja...
Definition: TerminalConstraint-impl.h:98
Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 > VectorXs
Definition: TerminalConstraint.h:32
virtual size_t getNumNonZerosJacobianState() const override
Returns the number of nonzeros in the jacobian wrt state. The default implementation assumes a dense ...
Definition: TerminalConstraint-impl.h:85
TerminalConstraint(const core::StateVector< STATE_DIM, SCALAR > xf)
Custom constructor.
Definition: TerminalConstraint-impl.h:12
Base class for the constraints used in this toolbox.
Definition: ConstraintBase.h:21
virtual MatrixXs jacobianState(const state_vector_t &x, const control_vector_t &u, const SCALAR t) override
Returns the constraint jacobian wrt state.
Definition: TerminalConstraint-impl.h:68
Class for terminal constraint.
Definition: TerminalConstraint.h:21