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 , where
are the current and reference spatial forces, respectively. The current spatial forces
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 and its Jacobians
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 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 ![]() |
[in] | u | Control input ![]() |
|
virtual |
Compute the derivatives of the contact force residual.
The CoP residual is computed based on the 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 ![]() |
[in] | u | Control input ![]() |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar sobec::newcontacts::ResidualModelContactForceTpl< _Scalar >::Scalar |