Crocoddyl
Loading...
Searching...
No Matches
ContactModelNumDiffTpl< _Scalar > Class Template Reference
Inheritance diagram for ContactModelNumDiffTpl< _Scalar >:
ContactModelAbstractTpl< _Scalar >ContactModelBase

Public Types

typedef ContactModelAbstractTpl< Scalar > Base
typedef ContactDataAbstractTpl< Scalar > ContactDataAbstract
typedef ContactDataNumDiffTpl< Scalar > Data
typedef MathBaseTpl< Scalar > MathBase
typedef boost::function< void(const VectorXs &, const VectorXs &)> ReevaluationFunction
typedef MathBaseTpl< Scalar >::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

 ContactModelNumDiffTpl (const std::shared_ptr< Base > &model)
 Construct a new ContactModelNumDiff object from a ContactModelAbstract.
virtual ~ContactModelNumDiffTpl ()=default
 Default destructor of the ContactModelNumDiff object.
void calc (const std::shared_ptr< ContactDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) override
 Compute the contact Jacobian and acceleration drift.
void calcDiff (const std::shared_ptr< ContactDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) override
 Compute the derivatives of the acceleration-based contact.
template<typename NewScalar>
ContactModelNumDiffTpl< NewScalar > cast () const
std::shared_ptr< ContactDataAbstractcreateData (pinocchio::DataTpl< Scalar > *const data) override
 Create a Data object.
const Scalar get_disturbance () const
 Return the disturbance constant used in the numerical differentiation routine.
const std::shared_ptr< Base > & get_model () const
 Return the acton model that we use to numerical differentiate.
void set_disturbance (const Scalar disturbance)
 Modify the disturbance constant used in the numerical differentiation routine.
void set_reevals (const std::vector< ReevaluationFunction > &reevals)
 Register functions that take a pinocchio model, a pinocchio data, a state and a control. The updated data is used to evaluate of the gradient and Hessian.
void updateForce (const std::shared_ptr< ContactDataAbstract > &data, const VectorXs &force) override
 Convert the force into a stack of spatial forces.
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.
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.
virtual void print (std::ostream &os) const
 Print relevant information of the contact model.
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.
void setZeroForceDiff (const std::shared_ptr< ContactDataAbstract > &data) const
 Set the stack of spatial forces Jacobians to zero.
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.

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

Scalar e_jac_
std::shared_ptr< Basemodel_
 contact model to differentiate
std::size_t nc_
std::size_t nu_
std::vector< ReevaluationFunction > reevals_
 functions that need execution before calc or calcDiff
std::shared_ptr< StateMultibodystate_
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::ContactModelNumDiffTpl< _Scalar >

Definition at line 21 of file contact.hpp.

Member Typedef Documentation

◆ ContactDataAbstract

template<typename _Scalar>
typedef ContactDataAbstractTpl<Scalar> ContactDataAbstract

Definition at line 27 of file contact.hpp.

◆ Base

template<typename _Scalar>
typedef ContactModelAbstractTpl<Scalar> Base

Definition at line 28 of file contact.hpp.

◆ Data

template<typename _Scalar>
typedef ContactDataNumDiffTpl<Scalar> Data

Definition at line 29 of file contact.hpp.

◆ MathBase

template<typename _Scalar>
typedef MathBaseTpl<Scalar> MathBase

Definition at line 30 of file contact.hpp.

◆ VectorXs

template<typename _Scalar>
typedef MathBaseTpl<Scalar>::VectorXs VectorXs

Definition at line 31 of file contact.hpp.

◆ ReevaluationFunction

template<typename _Scalar>
typedef boost::function<void(const VectorXs&, const VectorXs&)> ReevaluationFunction

Definition at line 33 of file contact.hpp.

Constructor & Destructor Documentation

◆ ContactModelNumDiffTpl()

template<typename _Scalar>
ContactModelNumDiffTpl(const std::shared_ptr< Base > &model)
explicit

Construct a new ContactModelNumDiff object from a ContactModelAbstract.

Parameters
model

Member Function Documentation

◆ calc()

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

Compute the contact Jacobian and acceleration drift.

Parameters
[in]dataContact data
[in]xState point $\mathbf{x}\in\mathbb{R}^{ndx}$
[in]uControl input $\mathbf{u}\in\mathbb{R}^{nu}$

Implements ContactModelAbstractTpl< _Scalar >.

◆ calcDiff()

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

Compute the derivatives of the acceleration-based contact.

Parameters
[in]dataContact data
[in]xState point $\mathbf{x}\in\mathbb{R}^{ndx}$
[in]uControl input $\mathbf{u}\in\mathbb{R}^{nu}$

Implements ContactModelAbstractTpl< _Scalar >.

◆ updateForce()

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

Convert the force into a stack of spatial forces.

Parameters
[in]dataContact data
[in]forceContact force

Implements ContactModelAbstractTpl< _Scalar >.

◆ createData()

template<typename _Scalar>
std::shared_ptr< ContactDataAbstract > createData(pinocchio::DataTpl< Scalar > *constdata)
overridevirtual

Create a Data object.

Parameters
datais the Pinocchio data
Returns
std::shared_ptr<ContactModelAbstract>

Reimplemented from ContactModelAbstractTpl< _Scalar >.

◆ set_reevals()

template<typename _Scalar>
void set_reevals(const std::vector< ReevaluationFunction > &reevals)

Register functions that take a pinocchio model, a pinocchio data, a state and a control. The updated data is used to evaluate of the gradient and Hessian.

Parameters
reevalsare the registered functions.

Member Data Documentation

◆ Scalar

template<typename _Scalar>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Definition at line 26 of file contact.hpp.

◆ model_

template<typename _Scalar>
std::shared_ptr<Base> model_
protected

contact model to differentiate

Definition at line 109 of file contact.hpp.

◆ e_jac_

template<typename _Scalar>
Scalar e_jac_
protected

Constant used for computing disturbances in Jacobian calculation

Definition at line 110 of file contact.hpp.

◆ reevals_

template<typename _Scalar>
std::vector<ReevaluationFunction> reevals_
protected

functions that need execution before calc or calcDiff

Definition at line 113 of file contact.hpp.

◆ nc_

template<typename _Scalar>
std::size_t nc_
protected

Definition at line 175 of file contact-base.hpp.

◆ nu_

template<typename _Scalar>
std::size_t nu_
protected

Definition at line 176 of file contact-base.hpp.

◆ state_

template<typename _Scalar>
std::shared_ptr<StateMultibody> state_
protected

Definition at line 174 of file contact-base.hpp.


The documentation for this class was generated from the following files:
  • /build/source/include/crocoddyl/multibody/fwd.hpp
  • /build/source/include/crocoddyl/multibody/numdiff/contact.hpp