Define a stack of contact models. More...
#include <crocoddyl/multibody/contacts/multiple-contacts.hpp>
Public Types | |
typedef ContactDataAbstractTpl< Scalar > | ContactDataAbstract |
typedef std::map< std::string, boost::shared_ptr< ContactDataAbstract > > | ContactDataContainer |
typedef ContactDataMultipleTpl< Scalar > | ContactDataMultiple |
typedef ContactItemTpl< Scalar > | ContactItem |
typedef ContactModelAbstractTpl< Scalar > | ContactModelAbstract |
typedef std::map< std::string, boost::shared_ptr< ContactItem > > | ContactModelContainer |
typedef pinocchio::container::aligned_vector< pinocchio::ForceTpl< Scalar > >::iterator | ForceIterator |
typedef MathBaseTpl< Scalar > | MathBase |
typedef MathBase::MatrixXs | MatrixXs |
typedef StateMultibodyTpl< Scalar > | StateMultibody |
typedef MathBase::Vector2s | Vector2s |
typedef MathBase::Vector3s | Vector3s |
typedef MathBase::VectorXs | VectorXs |
Public Member Functions | |
ContactModelMultipleTpl (boost::shared_ptr< StateMultibody > state) | |
Initialize the multi-contact model. More... | |
ContactModelMultipleTpl (boost::shared_ptr< StateMultibody > state, const std::size_t nu) | |
Initialize the multi-contact model. More... | |
void | addContact (const std::string &name, boost::shared_ptr< ContactModelAbstract > contact, const bool active=true) |
Add contact item. More... | |
void | calc (const boost::shared_ptr< ContactDataMultiple > &data, const Eigen::Ref< const VectorXs > &x) |
Compute the contact Jacobian and contact acceleration. More... | |
void | calcDiff (const boost::shared_ptr< ContactDataMultiple > &data, const Eigen::Ref< const VectorXs > &x) |
Compute the derivatives of the contact holonomic constraint. More... | |
void | changeContactStatus (const std::string &name, const bool active) |
Change the contact status. More... | |
boost::shared_ptr< ContactDataMultiple > | createData (pinocchio::DataTpl< Scalar > *const data) |
Create the multi-contact data. More... | |
DEPRECATED ("get_active() is deprecated and will be replaced with get_active_set()", const std::vector< std::string > &get_active() { active_.clear();active_.reserve(active_set_.size());for(const auto &contact :active_set_) { active_.push_back(contact);} return active_;};) DEPRECATED("get_inactive() is deprecated and will be replaced with get_inactive_set()" | |
const std::set< std::string > & | get_active_set () const |
Return the names of the set of active contacts. | |
const ContactModelContainer & | get_contacts () const |
Return the contact models. | |
const std::vector< std::string > & | get_inactive () |
const std::set< std::string > & | get_inactive_set () const |
Return the names of the set of inactive contacts. | |
std::size_t | get_nc () const |
Return the dimension of active contacts. | |
std::size_t | get_nc_total () const |
Return the dimension of all contacts. | |
std::size_t | get_nu () const |
Return the dimension of control vector. | |
const boost::shared_ptr< StateMultibody > & | get_state () const |
Return the multibody state. | |
bool | getContactStatus (const std::string &name) const |
Return the status of a given contact name. | |
void | removeContact (const std::string &name) |
Remove contact item. More... | |
void | updateAcceleration (const boost::shared_ptr< ContactDataMultiple > &data, const VectorXs &dv) const |
Update the constrained system acceleration. More... | |
void | updateAccelerationDiff (const boost::shared_ptr< ContactDataMultiple > &data, const MatrixXs &ddv_dx) const |
Update the Jacobian of the constrained system acceleration. More... | |
void | updateForce (const boost::shared_ptr< ContactDataMultiple > &data, const VectorXs &force) |
Update the spatial force defined in frame coordinate. More... | |
void | updateForceDiff (const boost::shared_ptr< ContactDataMultiple > &data, const MatrixXs &df_dx, const MatrixXs &df_du) const |
Update the Jacobian of the spatial force defined in frame coordinate. More... | |
Public Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar | Scalar |
Friends | |
template<class Scalar > | |
std::ostream & | operator<< (std::ostream &os, const ContactModelMultipleTpl< Scalar > &model) |
Print information on the contact models. | |
Define a stack of contact models.
The contact models can be defined with active and inactive status. The idea behind this design choice is to be able to create a mechanism that allocates the entire data needed for the computations. Then, there are designed routines that update the only active contacts.
Definition at line 55 of file multiple-contacts.hpp.
typedef MathBaseTpl<Scalar> MathBase |
Definition at line 60 of file multiple-contacts.hpp.
typedef StateMultibodyTpl<Scalar> StateMultibody |
Definition at line 61 of file multiple-contacts.hpp.
typedef ContactDataAbstractTpl<Scalar> ContactDataAbstract |
Definition at line 62 of file multiple-contacts.hpp.
typedef ContactDataMultipleTpl<Scalar> ContactDataMultiple |
Definition at line 63 of file multiple-contacts.hpp.
typedef ContactModelAbstractTpl<Scalar> ContactModelAbstract |
Definition at line 64 of file multiple-contacts.hpp.
typedef ContactItemTpl<Scalar> ContactItem |
Definition at line 66 of file multiple-contacts.hpp.
typedef MathBase::Vector2s Vector2s |
Definition at line 68 of file multiple-contacts.hpp.
typedef MathBase::Vector3s Vector3s |
Definition at line 69 of file multiple-contacts.hpp.
typedef MathBase::VectorXs VectorXs |
Definition at line 70 of file multiple-contacts.hpp.
typedef MathBase::MatrixXs MatrixXs |
Definition at line 71 of file multiple-contacts.hpp.
typedef std::map<std::string, boost::shared_ptr<ContactItem> > ContactModelContainer |
Definition at line 73 of file multiple-contacts.hpp.
typedef std::map<std::string, boost::shared_ptr<ContactDataAbstract> > ContactDataContainer |
Definition at line 74 of file multiple-contacts.hpp.
typedef pinocchio::container::aligned_vector<pinocchio::ForceTpl<Scalar>>::iterator ForceIterator |
Definition at line 75 of file multiple-contacts.hpp.
ContactModelMultipleTpl | ( | boost::shared_ptr< StateMultibody > | state, |
const std::size_t | nu | ||
) |
Initialize the multi-contact model.
[in] | state | Multibody state |
[in] | nu | Dimension of control vector |
ContactModelMultipleTpl | ( | boost::shared_ptr< StateMultibody > | state | ) |
Initialize the multi-contact model.
[in] | state | Multibody state |
void addContact | ( | const std::string & | name, |
boost::shared_ptr< ContactModelAbstract > | contact, | ||
const bool | active = true |
||
) |
Add contact item.
Note that the memory is allocated for inactive contacts as well.
[in] | name | Contact name |
[in] | contact | Contact model |
[in] | active | Contact status (active by default) |
void removeContact | ( | const std::string & | name | ) |
Remove contact item.
[in] | name | Contact name |
void changeContactStatus | ( | const std::string & | name, |
const bool | active | ||
) |
Change the contact status.
[in] | name | Contact name |
[in] | active | Contact status (True for active) |
void calc | ( | const boost::shared_ptr< ContactDataMultiple > & | data, |
const Eigen::Ref< const VectorXs > & | x | ||
) |
Compute the contact Jacobian and contact acceleration.
[in] | data | Multi-contact data |
[in] | x | State point \(\mathbf{x}\in\mathbb{R}^{ndx}\) |
void calcDiff | ( | const boost::shared_ptr< ContactDataMultiple > & | data, |
const Eigen::Ref< const VectorXs > & | x | ||
) |
Compute the derivatives of the contact holonomic constraint.
[in] | data | Multi-contact data |
[in] | x | State point \(\mathbf{x}\in\mathbb{R}^{ndx}\) |
void updateAcceleration | ( | const boost::shared_ptr< ContactDataMultiple > & | data, |
const VectorXs & | dv | ||
) | const |
Update the constrained system acceleration.
[in] | data | Multi-contact data |
[in] | dv | Constrained system acceleration \(\dot{\mathbf{v}}\in\mathbb{R}^{nv}\) |
void updateForce | ( | const boost::shared_ptr< ContactDataMultiple > & | data, |
const VectorXs & | force | ||
) |
Update the spatial force defined in frame coordinate.
[in] | data | Multi-contact data |
[in] | force | Spatial force defined in frame coordinate \({}^o\underline{\boldsymbol{\lambda}}_c\in\mathbb{R}^{nc}\) |
void updateAccelerationDiff | ( | const boost::shared_ptr< ContactDataMultiple > & | data, |
const MatrixXs & | ddv_dx | ||
) | const |
Update the Jacobian of the constrained system acceleration.
[in] | data | Multi-contact data |
[in] | ddv_dx | Jacobian of the system acceleration in generalized coordinates \(\frac{\partial\dot{\mathbf{v}}}{\partial\mathbf{x}}\in\mathbb{R}^{nv\times ndx}\) |
void updateForceDiff | ( | const boost::shared_ptr< ContactDataMultiple > & | data, |
const MatrixXs & | df_dx, | ||
const MatrixXs & | df_du | ||
) | const |
Update the Jacobian of the spatial force defined in frame coordinate.
[in] | data | Multi-contact data |
[in] | df_dx | Jacobian of the spatial impulse defined in frame coordinate \(\frac{\partial{}^o\underline{\boldsymbol{\lambda}}_c}{\partial\mathbf{x}}\in\mathbb{R}^{nc\times{ndx}}\) |
[in] | df_du | Jacobian of the spatial impulse defined in frame coordinate \(\frac{\partial{}^o\underline{\boldsymbol{\lambda}}_c}{\partial\mathbf{u}}\in\mathbb{R}^{nc\times{nu}}\) |
boost::shared_ptr< ContactDataMultiple > createData | ( | pinocchio::DataTpl< Scalar > *const | data | ) |
Create the multi-contact data.
[in] | data | Pinocchio data |
|
inline |
Definition at line 227 of file multiple-contacts.hpp.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar |
Definition at line 59 of file multiple-contacts.hpp.