Template Class ContactModel6DTpl

Inheritance Relationships

Base Type

Class Documentation

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

Public Types

typedef MathBaseTpl<Scalar> MathBase
typedef ContactModelAbstractTpl<Scalar> Base
typedef ContactData6DTpl<Scalar> Data
typedef StateMultibodyTpl<Scalar> StateMultibody
typedef ContactDataAbstractTpl<Scalar> ContactDataAbstract
typedef pinocchio::SE3Tpl<Scalar> SE3
typedef MathBase::Vector2s Vector2s
typedef MathBase::Vector3s Vector3s
typedef MathBase::VectorXs VectorXs
typedef MathBase::Matrix3s Matrix3s

Public Functions

ContactModel6DTpl(std::shared_ptr<StateMultibody> state, const pinocchio::FrameIndex id, const SE3 &pref, const pinocchio::ReferenceFrame type, const std::size_t nu, const Vector2s &gains = Vector2s::Zero())

Initialize the 6d 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

  • pref[in] Contact placement used for the Baumgarte stabilization

  • type[in] Type of contact

  • nu[in] Dimension of the control vector

  • gains[in] Baumgarte stabilization gains

ContactModel6DTpl(std::shared_ptr<StateMultibody> state, const pinocchio::FrameIndex id, const SE3 &pref, const pinocchio::ReferenceFrame type, const Vector2s &gains = Vector2s::Zero())

Initialize the 6d 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

  • pref[in] Contact placement 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", ContactModel6DTpl(std::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const SE3 &pref, const std::size_t nu, const Vector2s &gains=Vector2s::Zero());) DEPRECATED("Use const ructor that passes the type type of contact
this assumes is ContactModel6DTpl (std::shared_ptr< StateMultibody > state, const pinocchio::FrameIndex id, const SE3 &pref, const Vector2s &gains=Vector2s::Zero())
virtual ~ContactModel6DTpl() = 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 6d contact holonomic constraint.

Parameters:
  • data[in] 6d 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] 6d contact data

  • force[in] 6d force

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

Create the 6d contact data.

template<typename NewScalar>
ContactModel6DTpl<NewScalar> cast() const

Cast the contact-6d 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:

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

const SE3 &get_reference() const

Return the reference frame placement.

const Vector2s &get_gains() const

Return the Baumgarte stabilization gains.

void set_reference(const SE3 &reference)

Modify the reference frame placement.

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

Print relevant information of the 6d 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.