Template Class ContactModel3DTpl

Inheritance Relationships

Base Type

Class Documentation

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

Public Types

typedef MathBaseTpl<Scalar> MathBase
typedef ContactModelAbstractTpl<Scalar> Base
typedef ContactData3DTpl<Scalar> Data
typedef StateMultibodyTpl<Scalar> StateMultibody
typedef ContactDataAbstractTpl<Scalar> ContactDataAbstract
typedef MathBase::Matrix3s Matrix3s
typedef MathBase::Vector2s Vector2s
typedef MathBase::Vector3s Vector3s
typedef MathBase::VectorXs VectorXs

Public 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.

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:
  • state[in] State of the multibody system

  • id[in] Reference frame id of the contact

  • xref[in] Contact position used for the Baumgarte stabilization

  • type[in] Type of contact

  • nu[in] Dimension of the control vector

  • gains[in] Baumgarte stabilization gains

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:
  • state[in] State of the multibody system

  • id[in] Reference frame id of the contact

  • xref[in] Contact position used for the Baumgarte stabilization

  • type[in] Type of contact

  • gains[in] Baumgarte stabilization gains

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
this assumes is ContactModel3DTpl (std::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const Vector3s &xref, const Vector2s &gains=Vector2s::Zero())
virtual ~ContactModel3DTpl() = default
virtual void calc(const std::shared_ptr<ContactDataAbstract> &data, const Eigen::Ref<const VectorXs> &x) override

Compute the 3d contact Jacobian and drift.

Parameters:
  • data[in] 3d contact data

  • x[in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

  • u[in] Control input \(\mathbf{u}\in\mathbb{R}^{nu}\)

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.

Parameters:
  • data[in] 3d contact data

  • x[in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

  • u[in] Control input \(\mathbf{u}\in\mathbb{R}^{nu}\)

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

Convert the force into a stack of spatial forces.

Parameters:
  • data[in] 3d contact data

  • force[in] 3d force

virtual std::shared_ptr<ContactDataAbstract> createData(pinocchio::DataTpl<Scalar> *const data) override

Create the 3d contact data.

template<typename NewScalar>
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:

NewScalar – The new scalar type to cast to.

Returns:

ContactModel3DTpl<NewScalar> A contact model with the new scalar type.

const Vector3s &get_reference() const

Return the reference frame translation.

const Vector2s &get_gains() const

Return the Baumgarte stabilization gains.

void set_reference(const Vector3s &reference)

Modify the reference frame translation.

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

Print relevant information of the 3d contact model.

Parameters:

os[out] Output stream object

Public Members

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<StateMultibody> state_
pinocchio::ReferenceFrame type_

Type of contact.