Define a contact force residual function. More...
#include <sobec/crocomplements/contact/contact-force.hpp>
Public Types | |
typedef crocoddyl::MathBaseTpl< Scalar > | MathBase |
typedef crocoddyl::ResidualModelContactForceTpl< Scalar > | Base |
typedef crocoddyl::ResidualDataContactForceTpl< Scalar > | Data |
typedef crocoddyl::StateMultibodyTpl< Scalar > | StateMultibody |
typedef crocoddyl::ResidualDataAbstractTpl< Scalar > | ResidualDataAbstract |
typedef pinocchio::ForceTpl< Scalar > | Force |
typedef MathBase::VectorXs | VectorXs |
typedef MathBase::MatrixXs | MatrixXs |
Public Member Functions | |
ResidualModelContactForceTpl (boost::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const Force &fref, const std::size_t nc, const std::size_t nu) | |
Initialize the contact force residual model. More... | |
ResidualModelContactForceTpl (boost::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const Force &fref, const std::size_t nc) | |
Initialize the contact force residual model. More... | |
virtual | ~ResidualModelContactForceTpl () |
virtual void | calc (const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) |
Compute the contact force residual. More... | |
virtual void | calcDiff (const boost::shared_ptr< ResidualDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) |
Compute the derivatives of the contact force residual. More... | |
Public Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar | Scalar |
Define a contact force residual function.
This residual function is defined as \(\mathbf{r}=\boldsymbol{\lambda}-\boldsymbol{\lambda}^*\), where \(\boldsymbol{\lambda}, \boldsymbol{\lambda}^*\) are the current and reference spatial forces, respectively. The current spatial forces \(\boldsymbol{\lambda}\in\mathbb{R}^{nc}\) is computed by DifferentialActionModelContactFwdDynamicsTpl
or ActionModelImpulseFwdDynamicTpl
, with nc
as the dimension of the contact.
Both residual and residual Jacobians are computed analytically, where the force vector \(\boldsymbol{\lambda}\) and its Jacobians \(\left(\frac{\partial\boldsymbol{\lambda}}{\partial\mathbf{x}}, \frac{\partial\boldsymbol{\lambda}}{\partial\mathbf{u}}\right)\) are computed by DifferentialActionModelContactFwdDynamicsTpl
or ActionModelImpulseFwdDynamicTpl
. These values are stored in a shared data (i.e., DataCollectorContactTpl
or DataCollectorImpulseTpl
). Note that this residual function cannot be used with other action models.
ResidualModelAbstractTpl
, calc()
, calcDiff()
, createData()
, DifferentialActionModelContactFwdDynamicsTpl
, ActionModelImpulseFwdDynamicTpl
, DataCollectorContactTpl
, DataCollectorImpulseTpl
typedef crocoddyl::ResidualModelContactForceTpl<Scalar> sobec::newcontacts::ResidualModelContactForceTpl< _Scalar >::Base |
typedef crocoddyl::ResidualDataContactForceTpl<Scalar> sobec::newcontacts::ResidualModelContactForceTpl< _Scalar >::Data |
typedef pinocchio::ForceTpl<Scalar> sobec::newcontacts::ResidualModelContactForceTpl< _Scalar >::Force |
typedef crocoddyl::MathBaseTpl<Scalar> sobec::newcontacts::ResidualModelContactForceTpl< _Scalar >::MathBase |
typedef MathBase::MatrixXs sobec::newcontacts::ResidualModelContactForceTpl< _Scalar >::MatrixXs |
typedef crocoddyl::ResidualDataAbstractTpl<Scalar> sobec::newcontacts::ResidualModelContactForceTpl< _Scalar >::ResidualDataAbstract |
typedef crocoddyl::StateMultibodyTpl<Scalar> sobec::newcontacts::ResidualModelContactForceTpl< _Scalar >::StateMultibody |
typedef MathBase::VectorXs sobec::newcontacts::ResidualModelContactForceTpl< _Scalar >::VectorXs |
sobec::newcontacts::ResidualModelContactForceTpl< Scalar >::ResidualModelContactForceTpl | ( | boost::shared_ptr< StateMultibody > | state, |
const pinocchio::FrameIndex | id, | ||
const Force & | fref, | ||
const std::size_t | nc, | ||
const std::size_t | nu | ||
) |
Initialize the contact force residual model.
[in] | state | Multibody state |
[in] | id | Reference frame id |
[in] | fref | Reference spatial contact force in the contact coordinates |
[in] | nc | Dimension of the contact force (nc <= 6) |
[in] | nu | Dimension of control vector |
sobec::newcontacts::ResidualModelContactForceTpl< Scalar >::ResidualModelContactForceTpl | ( | boost::shared_ptr< StateMultibody > | state, |
const pinocchio::FrameIndex | id, | ||
const Force & | fref, | ||
const std::size_t | nc | ||
) |
Initialize the contact force residual model.
The default nu
is obtained from StateAbstractTpl::get_nv()
.
[in] | state | Multibody state |
[in] | id | Reference frame id |
[in] | fref | Reference spatial contact force in the contact coordinates |
[in] | nc | Dimension of the contact force (nc <= 6) |
|
virtual |
|
virtual |
Compute the contact force residual.
The CoP residual is computed based on the \(\mathbf{A}\) matrix, the force vector is computed by DifferentialActionModelContactFwdDynamicsTpl
or ActionModelImpulseFwdDynamicTpl
which is stored in DataCollectorContactTpl
or DataCollectorImpulseTpl
.
[in] | data | Contact force data |
[in] | x | State point \(\mathbf{x}\in\mathbb{R}^{ndx}\) |
[in] | u | Control input \(\mathbf{u}\in\mathbb{R}^{nu}\) |
|
virtual |
Compute the derivatives of the contact force residual.
The CoP residual is computed based on the \(\mathbf{A}\) matrix, the force vector is computed by DifferentialActionModelContactFwdDynamicsTpl
or ActionModelImpulseFwdDynamicTpl
which is stored in DataCollectorContactTpl
or DataCollectorImpulseTpl
.
[in] | data | Contact force data |
[in] | x | State point \(\mathbf{x}\in\mathbb{R}^{ndx}\) |
[in] | u | Control input \(\mathbf{u}\in\mathbb{R}^{nu}\) |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar sobec::newcontacts::ResidualModelContactForceTpl< _Scalar >::Scalar |