crocoddyl  1.9.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
ImpulseModelMultipleTpl< _Scalar > Class Template Reference

Define a stack of impulse models. More...

#include <crocoddyl/multibody/impulses/multiple-impulses.hpp>

Public Types

typedef pinocchio::container::aligned_vector< pinocchio::ForceTpl< Scalar > >::iterator ForceIterator
 
typedef ImpulseDataAbstractTpl< Scalar > ImpulseDataAbstract
 
typedef std::map< std::string, boost::shared_ptr< ImpulseDataAbstract > > ImpulseDataContainer
 
typedef ImpulseDataMultipleTpl< Scalar > ImpulseDataMultiple
 
typedef ImpulseItemTpl< Scalar > ImpulseItem
 
typedef ImpulseModelAbstractTpl< Scalar > ImpulseModelAbstract
 
typedef std::map< std::string, boost::shared_ptr< ImpulseItem > > ImpulseModelContainer
 
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

 ImpulseModelMultipleTpl (boost::shared_ptr< StateMultibody > state)
 Initialize the multi-impulse model. More...
 
void addImpulse (const std::string &name, boost::shared_ptr< ImpulseModelAbstract > impulse, const bool active=true)
 Add impulse item. More...
 
void calc (const boost::shared_ptr< ImpulseDataMultiple > &data, const Eigen::Ref< const VectorXs > &x)
 Compute the total contact Jacobian and contact acceleration. More...
 
void calcDiff (const boost::shared_ptr< ImpulseDataMultiple > &data, const Eigen::Ref< const VectorXs > &x)
 Compute the derivatives of the contact holonomic constraint. More...
 
void changeImpulseStatus (const std::string &name, const bool active)
 Change the impulse status. More...
 
boost::shared_ptr< ImpulseDataMultiplecreateData (pinocchio::DataTpl< Scalar > *const data)
 Create the multi-impulse 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 ImpulseModelContainer & get_impulses () const
 Return the impulse models.
 
const std::vector< std::string > & get_inactive ()
 
DEPRECATED("Use get_nc().", std::size_t get_ni() const ;) std const DEPRECATED("Use get_nc_total().", std::size_t get_ni_total() const ;) const std std::set< std::string > & get_inactive_set () const
 Return the dimension of all impulses. More...
 
std::size_t get_nc () const
 Return the dimension of active impulses.
 
const boost::shared_ptr< StateMultibody > & get_state () const
 Return the multibody state.
 
bool getImpulseStatus (const std::string &name) const
 Return the status of a given impulse name.
 
void removeImpulse (const std::string &name)
 Remove impulse item. More...
 
void updateForce (const boost::shared_ptr< ImpulseDataMultiple > &data, const VectorXs &impulse)
 Update the spatial impulse defined in frame coordinate. More...
 
void updateForceDiff (const boost::shared_ptr< ImpulseDataMultiple > &data, const MatrixXs &df_dx) const
 Update the Jacobian of the spatial impulse defined in frame coordinate. More...
 
void updateVelocity (const boost::shared_ptr< ImpulseDataMultiple > &data, const VectorXs &vnext) const
 Update the system velocity after impulse. More...
 
void updateVelocityDiff (const boost::shared_ptr< ImpulseDataMultiple > &data, const MatrixXs &dvnext_dx) const
 Update the Jacobian of the system velocity after impulse. More...
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
 

Friends

template<class Scalar >
std::ostream & operator<< (std::ostream &os, const ImpulseModelMultipleTpl< Scalar > &model)
 Print information on the impulse models.
 

Detailed Description

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

Define a stack of impulse models.

The impulse 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 impulse.

Definition at line 343 of file fwd.hpp.

Constructor & Destructor Documentation

◆ ImpulseModelMultipleTpl()

ImpulseModelMultipleTpl ( boost::shared_ptr< StateMultibody state)
explicit

Initialize the multi-impulse model.

Parameters
[in]stateMultibody state

Member Function Documentation

◆ addImpulse()

void addImpulse ( const std::string &  name,
boost::shared_ptr< ImpulseModelAbstract impulse,
const bool  active = true 
)

Add impulse item.

Note that the memory is allocated for inactive impulses as well.

Parameters
[in]nameImpulse name
[in]contactImpulse model
[in]activeImpulse status (active by default)

◆ removeImpulse()

void removeImpulse ( const std::string &  name)

Remove impulse item.

Parameters
[in]nameImpulse name

◆ changeImpulseStatus()

void changeImpulseStatus ( const std::string &  name,
const bool  active 
)

Change the impulse status.

Parameters
[in]nameImpulse name
[in]activeImpulse status (True for active)

◆ calc()

void calc ( const boost::shared_ptr< ImpulseDataMultiple > &  data,
const Eigen::Ref< const VectorXs > &  x 
)

Compute the total contact Jacobian and contact acceleration.

Parameters
[in]dataMulti-impulse data
[in]xState point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

◆ calcDiff()

void calcDiff ( const boost::shared_ptr< ImpulseDataMultiple > &  data,
const Eigen::Ref< const VectorXs > &  x 
)

Compute the derivatives of the contact holonomic constraint.

Parameters
[in]dataMulti-impulse data
[in]xState point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

◆ updateVelocity()

void updateVelocity ( const boost::shared_ptr< ImpulseDataMultiple > &  data,
const VectorXs &  vnext 
) const

Update the system velocity after impulse.

Parameters
[in]dataMulti-impulse data
[in]vnextSystem velocity after impulse \(\mathbf{v}'\in\mathbb{R}^{nv}\)

◆ updateForce()

void updateForce ( const boost::shared_ptr< ImpulseDataMultiple > &  data,
const VectorXs &  impulse 
)

Update the spatial impulse defined in frame coordinate.

Parameters
[in]dataMulti-impulse data
[in]impulseSpatial impulse defined in frame coordinate \({}^o\underline{\boldsymbol{\Lambda}}_c\in\mathbb{R}^{nc}\)

◆ updateVelocityDiff()

void updateVelocityDiff ( const boost::shared_ptr< ImpulseDataMultiple > &  data,
const MatrixXs &  dvnext_dx 
) const

Update the Jacobian of the system velocity after impulse.

Parameters
[in]dataMulti-impulse data
[in]dvnext_dxJacobian of the system velocity after impact in generalized coordinates \(\frac{\partial\dot{\mathbf{v}'}}{\partial\mathbf{x}}\in\mathbb{R}^{nv\times{ndx}}\)

◆ updateForceDiff()

void updateForceDiff ( const boost::shared_ptr< ImpulseDataMultiple > &  data,
const MatrixXs &  df_dx 
) const

Update the Jacobian of the spatial impulse defined in frame coordinate.

Parameters
[in]dataMulti-contact data
[in]df_dxJacobian of the spatial impulse defined in frame coordinate \(\frac{\partial{}^o\underline{\boldsymbol{\Lambda}}_c}{\partial\mathbf{x}}\in\mathbb{R}^{nc\times{ndx}}\)

◆ createData()

boost::shared_ptr<ImpulseDataMultiple> createData ( pinocchio::DataTpl< Scalar > *const  data)

Create the multi-impulse data.

Parameters
[in]dataPinocchio data
Returns
the multi-impulse data.

◆ get_inactive_set()

DEPRECATED ("Use get_nc().", std::size_t get_ni() const;) std const DEPRECATED ("Use get_nc_total().", std::size_t get_ni_total() const;) const std std::set<std::string>& get_inactive_set ( ) const

Return the dimension of all impulses.

Return the names of the set of active contacts

Return the names of the set of inactive contacts


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