11 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
20 x_deviation_.setZero();
21 u_deviation_.setZero();
24 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
31 : x_nominal_(x_nominal), Q_(Q), u_nominal_(u_nominal), R_(R), x_final_(x_final), Q_final_(Q_final)
37 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
42 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
57 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
64 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
77 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
85 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
92 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
99 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
106 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
113 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
117 return control_state_matrix_t::Zero();
120 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
124 return SCALAR(0.5) * x_deviation_final.transpose() *
Q_final_ * x_deviation_final;
127 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
132 return Q_final_ * x_deviation_final;
135 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
142 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
148 template <
size_t STATE_DIM,
size_t CONTROL_DIM,
typename SCALAR>
virtual SCALAR evaluateTerminal() override
evaluate terminal costs
Definition: CostFunctionQuadraticSimple-impl.hpp:121
state_vector_t x_
Definition: CostFunction.hpp:103
state_matrix_t Q_
Definition: CostFunctionQuadraticSimple.hpp:94
ct::core::ControlVector< control_dim > u
Definition: LoadFromFileTest.cpp:21
virtual void updateReferenceState(const state_vector_t &x_ref) override
update the reference state for intermediate cost terms
Definition: CostFunctionQuadraticSimple-impl.hpp:143
virtual void setCurrentStateAndControl(const state_vector_t &x, const control_vector_t &u, const SCALAR &t) override
Definition: CostFunctionQuadraticSimple-impl.hpp:65
Eigen::Matrix< SCALAR, CONTROL_DIM, STATE_DIM > control_state_matrix_t
Definition: CostFunctionQuadraticSimple.hpp:30
CostFunctionQuadraticSimple< STATE_DIM, CONTROL_DIM, SCALAR > * clone() const override
Definition: CostFunctionQuadraticSimple-impl.hpp:59
SCALAR t_
Definition: CostFunction.hpp:105
virtual state_vector_t stateDerivativeIntermediate() override
Computes intermediate-cost first-order derivative with respect to state.
Definition: CostFunctionQuadraticSimple-impl.hpp:87
A simple quadratic cost function.
Definition: CostFunctionQuadraticSimple.hpp:23
virtual control_matrix_t controlSecondDerivativeIntermediate() override
Computes intermediate-cost second-order derivative with respect to input.
Definition: CostFunctionQuadraticSimple-impl.hpp:108
clear all close all load ct GNMSLog0 mat reformat t
Definition: gnmsPlot.m:6
control_vector_t u_nominal_
Definition: CostFunctionQuadraticSimple.hpp:97
state_matrix_t Q_final_
Definition: CostFunctionQuadraticSimple.hpp:101
state_vector_t x_deviation_
Definition: CostFunctionQuadraticSimple.hpp:92
virtual state_vector_t stateDerivativeTerminal() override
Definition: CostFunctionQuadraticSimple-impl.hpp:129
CppAD::AD< CppAD::cg::CG< double > > SCALAR
virtual state_matrix_t stateSecondDerivativeTerminal() override
Computes final-cost second-order derivative with respect to state.
Definition: CostFunctionQuadraticSimple-impl.hpp:137
virtual void updateFinalState(const state_vector_t &x_final) override
update the reference state for final cost terms
Definition: CostFunctionQuadraticSimple-impl.hpp:149
Eigen::Matrix< SCALAR, CONTROL_DIM, CONTROL_DIM > control_matrix_t
Definition: CostFunctionQuadraticSimple.hpp:29
ct::core::StateVector< state_dim > x
Definition: LoadFromFileTest.cpp:20
control_matrix_t R_
Definition: CostFunctionQuadraticSimple.hpp:98
Eigen::Matrix< SCALAR, CONTROL_DIM, CONTROL_DIM > control_matrix_t
Definition: CostFunctionQuadratic.hpp:35
virtual SCALAR evaluateIntermediate() override
evaluate intermediate costs
Definition: CostFunctionQuadraticSimple-impl.hpp:78
control_vector_t u_
Definition: CostFunction.hpp:104
virtual ~CostFunctionQuadraticSimple()
Definition: CostFunctionQuadraticSimple-impl.hpp:38
Eigen::Matrix< double, nStates, nStates > state_matrix_t
control_vector_t u_deviation_
Definition: CostFunctionQuadraticSimple.hpp:96
state_vector_t x_final_
Definition: CostFunctionQuadraticSimple.hpp:100
virtual state_matrix_t stateSecondDerivativeIntermediate() override
Computes intermediate-cost second-order derivative with respect to state.
Definition: CostFunctionQuadraticSimple-impl.hpp:94
virtual control_vector_t controlDerivativeIntermediate() override
Computes intermediate-cost first-order derivative with respect to control.
Definition: CostFunctionQuadraticSimple-impl.hpp:101
virtual control_state_matrix_t stateControlDerivativeIntermediate() override
Computes intermediate-cost derivative with respect to state and control.
Definition: CostFunctionQuadraticSimple-impl.hpp:115
CostFunctionQuadraticSimple()
Definition: CostFunctionQuadraticSimple-impl.hpp:12
state_vector_t x_nominal_
Definition: CostFunctionQuadraticSimple.hpp:93