Template Class ResidualModelJointAccelerationTpl
Defined in File joint-acceleration.hpp
Inheritance Relationships
Base Type
public crocoddyl::ResidualModelAbstractTpl< _Scalar >(Template Class ResidualModelAbstractTpl)
Class Documentation
-
template<typename _Scalar>
class ResidualModelJointAccelerationTpl : public crocoddyl::ResidualModelAbstractTpl<_Scalar> Define a joint-acceleration residual.
This residual function is defined as \(\mathbf{r}=\mathbf{u}-\mathbf{u}^*\), where \(\mathbf{u},\mathbf{u}^*\in~\mathbb{R}^{nu}\) are the current and reference joint acceleration, respectively. Note that the dimension of the residual vector is obtained from
StateAbstract::nv, as it represents the generalized acceleration.Both residual and residual Jacobians are computed analytically.
As described in ResidualModelAbstractTpl(), the residual value and its Jacobians are calculated by
calcandcalcDiff, respectively.See also
Public Types
-
typedef MathBaseTpl<Scalar> MathBase
-
typedef ResidualModelAbstractTpl<Scalar> Base
-
typedef ResidualDataJointAccelerationTpl<Scalar> Data
-
typedef ResidualDataAbstractTpl<Scalar> ResidualDataAbstract
-
typedef DataCollectorAbstractTpl<Scalar> DataCollectorAbstract
-
typedef StateAbstractTpl<Scalar> StateAbstract
-
typedef ActuationModelAbstractTpl<Scalar> ActuationModelAbstract
Public Functions
Initialize the joint-acceleration residual model.
- Parameters:
state – [in] State description
aref – [in] Reference joint acceleration
nu – [in] Dimension of the control vector
Initialize the joint-acceleration residual model.
The default
nuvalue is obtained fromStateAbstractTpl::get_nv().- Parameters:
state – [in] State description
aref – [in] Reference joint acceleration
Initialize the joint-acceleration residual model.
The default reference joint acceleration is obtained from
MathBaseTpl<>::VectorXs::Zero(state->get_nv()).- Parameters:
state – [in] State description
nu – [in] Dimension of the control vector
Initialize the joint-acceleration residual model.
The default reference joint acceleration is obtained from
MathBaseTpl<>::VectorXs::Zero(state->get_nv()). The defaultnuvalue is obtained fromStateAbstractTpl::get_nv().- Parameters:
state – [in] State description
-
virtual ~ResidualModelJointAccelerationTpl() = default
Compute the joint-acceleration residual.
- Parameters:
data – [in] Joint-acceleration residual data
x – [in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)
u – [in] Control input \(\mathbf{u}\in\mathbb{R}^{nu}\)
Compute the residual vector for nodes that depends only on the state.
It updates the residual vector based on the state only. This function is used in the terminal nodes of an optimal control problem.
- Parameters:
data – [in] Residual data
x – [in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)
Compute the derivatives of the joint-acceleration residual.
- Parameters:
data – [in] Joint-acceleration residual data
x – [in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)
u – [in] Control input \(\mathbf{u}\in\mathbb{R}^{nu}\)
-
virtual std::shared_ptr<ResidualDataAbstract> createData(DataCollectorAbstract *const data) override
Create the joint-acceleration residual data.
-
template<typename NewScalar>
ResidualModelJointAccelerationTpl<NewScalar> cast() const Cast the joint-acceleration 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:
ResidualModelJointAccelerationTpl<NewScalar> A residual model with the new scalar type.
-
virtual void print(std::ostream &os) const override
Print relevant information of the joint-acceleration 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.
-
typedef MathBaseTpl<Scalar> MathBase