Crocoddyl
ContactModel3DTpl< _Scalar > Class Template Reference
Inheritance diagram for ContactModel3DTpl< _Scalar >:
ContactModelAbstractTpl< _Scalar > ContactModelBase

Public Types

typedef ContactModelAbstractTpl< Scalar > Base
 
typedef ContactDataAbstractTpl< Scalar > ContactDataAbstract
 
typedef ContactData3DTpl< Scalar > Data
 
typedef MathBaseTpl< Scalar > MathBase
 
typedef MathBase::Matrix3s Matrix3s
 
typedef StateMultibodyTpl< Scalar > StateMultibody
 
typedef MathBase::Vector2s Vector2s
 
typedef MathBase::Vector3s Vector3s
 
typedef MathBase::VectorXs VectorXs
 
- Public Types inherited from ContactModelAbstractTpl< _Scalar >
typedef ContactDataAbstractTpl< Scalar > ContactDataAbstract
 
typedef MathBaseTpl< Scalar > MathBase
 
typedef MathBase::MatrixXs MatrixXs
 
typedef StateMultibodyTpl< Scalar > StateMultibody
 
typedef MathBase::VectorXs VectorXs
 

Public Member Functions

 ContactModel3DTpl (std::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const Vector3s &xref, const pinocchio::ReferenceFrame type, const std::size_t nu, const Vector2s &gains=Vector2s::Zero())
 Initialize the 3d contact model. More...
 
 ContactModel3DTpl (std::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const Vector3s &xref, const pinocchio::ReferenceFrame type, const Vector2s &gains=Vector2s::Zero())
 Initialize the 3d contact model. More...
 
this assumes is ContactModel3DTpl (std::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const Vector3s &xref, const Vector2s &gains=Vector2s::Zero())
 
virtual void calc (const std::shared_ptr< ContactDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) override
 Compute the 3d contact Jacobian and drift. More...
 
virtual void calcDiff (const std::shared_ptr< ContactDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) override
 Compute the derivatives of the 3d contact holonomic constraint. More...
 
template<typename NewScalar >
ContactModel3DTpl< NewScalar > cast () const
 Cast the contact-3d model to a different scalar type. More...
 
virtual std::shared_ptr< ContactDataAbstractcreateData (pinocchio::DataTpl< Scalar > *const data) override
 Create the 3d contact data.
 
 DEPRECATED ("Use constructor that passes the type type of contact, this assumes is " "pinocchio::LOCAL", ContactModel3DTpl(std::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const Vector3s &xref, const std::size_t nu, const Vector2s &gains=Vector2s::Zero());) DEPRECATED("Use const ructor that passes the type type of contact
 
const Vector2s & get_gains () const
 Return the Baumgarte stabilization gains.
 
const Vector3s & get_reference () const
 Return the reference frame translation.
 
virtual void print (std::ostream &os) const override
 Print relevant information of the 3d contact model. More...
 
void set_reference (const Vector3s &reference)
 Modify the reference frame translation.
 
virtual void updateForce (const std::shared_ptr< ContactDataAbstract > &data, const VectorXs &force) override
 Convert the force into a stack of spatial forces. More...
 
- Public Member Functions inherited from ContactModelAbstractTpl< _Scalar >
 ContactModelAbstractTpl (std::shared_ptr< StateMultibody > state, const pinocchio::ReferenceFrame type, const std::size_t nc)
 
 ContactModelAbstractTpl (std::shared_ptr< StateMultibody > state, const pinocchio::ReferenceFrame type, const std::size_t nc, const std::size_t nu)
 Initialize the contact abstraction. More...
 
this assumes is ContactModelAbstractTpl (std::shared_ptr< StateMultibody > state, const std::size_t nc)
 
 DEPRECATED ("Use constructor that passes the type type of contact, this assumes is " "pinocchio::LOCAL", ContactModelAbstractTpl(std::shared_ptr< StateMultibody > state, const std::size_t nc, const std::size_t nu);) DEPRECATED("Use const ructor that passes the type type of contact
 
pinocchio::FrameIndex get_id () const
 Return the reference frame id.
 
std::size_t get_nc () const
 Return the dimension of the contact.
 
std::size_t get_nu () const
 Return the dimension of the control vector.
 
const std::shared_ptr< StateMultibody > & get_state () const
 Return the state.
 
pinocchio::ReferenceFrame get_type () const
 Return the type of contact.
 
void set_id (const pinocchio::FrameIndex id)
 Modify the reference frame id.
 
void set_type (const pinocchio::ReferenceFrame type)
 Modify the type of contact.
 
void setZeroForce (const std::shared_ptr< ContactDataAbstract > &data) const
 Set the stack of spatial forces to zero. More...
 
void setZeroForceDiff (const std::shared_ptr< ContactDataAbstract > &data) const
 Set the stack of spatial forces Jacobians to zero. More...
 
void updateForceDiff (const std::shared_ptr< ContactDataAbstract > &data, const MatrixXs &df_dx, const MatrixXs &df_du) const
 Convert the force into a stack of spatial forces. More...
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
 
- Public Attributes inherited from ContactModelAbstractTpl< _Scalar >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
 

Protected Attributes

pinocchio::FrameIndex id_
 Reference frame id of the contact.
 
std::size_t nc_
 
std::size_t nu_
 
std::shared_ptr< StateMultibodystate_
 
pinocchio::ReferenceFrame type_
 Type of contact.
 
- Protected Attributes inherited from ContactModelAbstractTpl< _Scalar >
pinocchio::FrameIndex id_
 Reference frame id of the contact.
 
std::size_t nc_
 
std::size_t nu_
 
std::shared_ptr< StateMultibodystate_
 
pinocchio::ReferenceFrame type_
 Type of contact.
 

Detailed Description

template<typename _Scalar>
class crocoddyl::ContactModel3DTpl< _Scalar >

Definition at line 20 of file contact-3d.hpp.

Constructor & Destructor Documentation

◆ ContactModel3DTpl() [1/2]

ContactModel3DTpl ( std::shared_ptr< StateMultibody state,
const pinocchio::FrameIndex  id,
const Vector3s &  xref,
const pinocchio::ReferenceFrame  type,
const std::size_t  nu,
const Vector2s &  gains = Vector2s::Zero() 
)

Initialize the 3d contact model.

To learn more about the computation of the contact derivatives in different frames see S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary Frames: Application to Polishing with Talos, ICHR 2022

Parameters
[in]stateState of the multibody system
[in]idReference frame id of the contact
[in]xrefContact position used for the Baumgarte stabilization
[in]typeType of contact
[in]nuDimension of the control vector
[in]gainsBaumgarte stabilization gains

◆ ContactModel3DTpl() [2/2]

ContactModel3DTpl ( std::shared_ptr< StateMultibody state,
const pinocchio::FrameIndex  id,
const Vector3s &  xref,
const pinocchio::ReferenceFrame  type,
const Vector2s &  gains = Vector2s::Zero() 
)

Initialize the 3d contact model.

The default nu is obtained from StateAbstractTpl::get_nv(). To learn more about the computation of the contact derivatives in different frames see S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary Frames: Application to Polishing with Talos, ICHR 2022

Parameters
[in]stateState of the multibody system
[in]idReference frame id of the contact
[in]xrefContact position used for the Baumgarte stabilization
[in]typeType of contact
[in]gainsBaumgarte stabilization gains

Member Function Documentation

◆ calc()

virtual void calc ( const std::shared_ptr< ContactDataAbstract > &  data,
const Eigen::Ref< const VectorXs > &  x 
)
overridevirtual

Compute the 3d contact Jacobian and drift.

Parameters
[in]data3d contact data
[in]xState point \(\mathbf{x}\in\mathbb{R}^{ndx}\)
[in]uControl input \(\mathbf{u}\in\mathbb{R}^{nu}\)

Implements ContactModelAbstractTpl< _Scalar >.

◆ calcDiff()

virtual void calcDiff ( const std::shared_ptr< ContactDataAbstract > &  data,
const Eigen::Ref< const VectorXs > &  x 
)
overridevirtual

Compute the derivatives of the 3d contact holonomic constraint.

Parameters
[in]data3d contact data
[in]xState point \(\mathbf{x}\in\mathbb{R}^{ndx}\)
[in]uControl input \(\mathbf{u}\in\mathbb{R}^{nu}\)

Implements ContactModelAbstractTpl< _Scalar >.

◆ updateForce()

virtual void updateForce ( const std::shared_ptr< ContactDataAbstract > &  data,
const VectorXs &  force 
)
overridevirtual

Convert the force into a stack of spatial forces.

Parameters
[in]data3d contact data
[in]force3d force

Implements ContactModelAbstractTpl< _Scalar >.

◆ cast()

ContactModel3DTpl<NewScalar> cast ( ) const

Cast the contact-3d model to a different scalar type.

It is useful for operations requiring different precision or scalar types.

Template Parameters
NewScalarThe new scalar type to cast to.
Returns
ContactModel3DTpl<NewScalar> A contact model with the new scalar type.

◆ print()

virtual void print ( std::ostream &  os) const
overridevirtual

Print relevant information of the 3d contact model.

Parameters
[out]osOutput stream object

Reimplemented from ContactModelAbstractTpl< _Scalar >.


The documentation for this class was generated from the following file: