Template Class ResidualModelStateTpl
Defined in File state.hpp
Inheritance Relationships
Base Type
public crocoddyl::ResidualModelAbstractTpl< _Scalar >(Template Class ResidualModelAbstractTpl)
Class Documentation
-
template<typename _Scalar>
class ResidualModelStateTpl : public crocoddyl::ResidualModelAbstractTpl<_Scalar> State residual.
This residual function defines the state tracking as \(\mathbf{r}=\mathbf{x}\ominus\mathbf{x}^*\), where \(\mathbf{x},\mathbf{x}^*\in~\mathcal{X}\) are the current and reference states, respectively, which belong to the state manifold \(\mathcal{X}\). Note that the dimension of the residual vector is obtained from
StateAbstract::get_ndx(). Furthermore, the Jacobians of the residual function are computed analytically.As described in
ResidualModelAbstractTpl(), the residual value and its derivatives are calculated bycalcandcalcDiff, respectively.See also
Public Types
-
typedef MathBaseTpl<Scalar> MathBase
-
typedef ResidualModelAbstractTpl<Scalar> Base
-
typedef StateMultibodyTpl<Scalar> StateMultibody
-
typedef ResidualDataAbstractTpl<Scalar> ResidualDataAbstract
-
typedef CostDataAbstractTpl<Scalar> CostDataAbstract
-
typedef ActivationDataAbstractTpl<Scalar> ActivationDataAbstract
-
typedef DataCollectorAbstractTpl<Scalar> DataCollectorAbstract
Public Functions
Initialize the state residual model.
- Parameters:
state – [in] State of the multibody system
xref – [in] Reference state
nu – [in] Dimension of the control vector
Initialize the state residual model.
The default
nuvalue is obtained fromStateAbstractTpl::get_nv().- Parameters:
state – [in] State of the multibody system
xref – [in] Reference state
Initialize the state residual model.
The default reference state is obtained from
StateAbstractTpl::zero().- Parameters:
state – [in] State of the multibody system
nu – [in] Dimension of the control vector
Initialize the state residual model.
The default state reference is obtained from
StateAbstractTpl::zero(), andnufromStateAbstractTpl::get_nv().- Parameters:
state – [in] State of the multibody system
activation – [in] Activation model
-
virtual ~ResidualModelStateTpl() = default
Compute the state residual.
- Parameters:
data – [in] State residual data
x – [in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)
u – [in] Control input \(\mathbf{u}\in\mathbb{R}^{nu}\)
Compute the Jacobians of the state residual.
- Parameters:
data – [in] State residual data
x – [in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)
u – [in] Control input \(\mathbf{u}\in\mathbb{R}^{nu}\)
Compute the derivative of the state-cost function and store it in cost data.
This function assumes that the derivatives of the activation and residual are computed via calcDiff functions.
- Parameters:
cdata – Cost data
rdata – Residual data
adata – Activation data
update_u – Update the derivative of the cost function w.r.t. to the control if True.
-
template<typename NewScalar>
ResidualModelStateTpl<NewScalar> cast() const Cast the state residual model to a different scalar type.
It is useful for operations requiring different precision or scalar types.
- Template Parameters:
NewScalar – The new scalar type to cast to.
- Returns:
ResidualModelStateTpl<NewScalar> A residual model with the new scalar type.
-
virtual void print(std::ostream &os) const override
Print relevant information of the state residual.
- Parameters:
os – [out] Output stream object
Public Members
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
Protected Attributes
-
std::size_t nr_
Residual vector dimension.
-
std::size_t nu_
Control dimension.
-
std::shared_ptr<StateAbstract> state_
State description.
-
bool u_dependent_
Label that indicates if the residual function depends on u
-
typedef MathBaseTpl<Scalar> MathBase