robotoc
robotoc - efficient ROBOT Optimal Control solvers
|
Impact status of robot model. Wrapper of ContactStatus to treat impacts. More...
#include <impact_status.hpp>
Public Member Functions | |
ImpactStatus (const std::vector< ContactType > &contact_types, const std::vector< std::string > &contact_frame_names, const double default_friction_coefficient=0.7) | |
Constructor. More... | |
ImpactStatus () | |
Default constructor. More... | |
~ImpactStatus ()=default | |
Default destructor. More... | |
ImpactStatus (const ImpactStatus &)=default | |
Default copy constructor. More... | |
ImpactStatus & | operator= (const ImpactStatus &)=default |
Default copy assign operator. More... | |
ImpactStatus (ImpactStatus &&) noexcept=default | |
Default move constructor. More... | |
ImpactStatus & | operator= (ImpactStatus &&) noexcept=default |
Default move assign operator. More... | |
bool | operator== (const ImpactStatus &other) const |
Defines a comparison operator. More... | |
bool | operator!= (const ImpactStatus &other) const |
Defines a comparison operator. More... | |
ContactType | contactType (const int contact_index) const |
Returns the type of the contact. More... | |
const std::vector< ContactType > & | contactTypes () const |
Returns the types of the contacts. More... | |
bool | isImpactActive (const int contact_index) const |
Returns true if a contact is active and false if not. More... | |
const std::vector< bool > & | isImpactActive () const |
Returns the activity of the impacts. More... | |
bool | hasActiveImpact () const |
Returns true if there are active impacts and false if not. More... | |
int | dimf () const |
Returns the dimension of the active impact forces. More... | |
int | maxNumContacts () const |
Returns the maximum number of the contacts. More... | |
void | activateImpact (const int contact_index) |
Activates a impact. More... | |
void | deactivateImpact (const int contact_index) |
Deactivates a impact. More... | |
void | activateImpacts (const std::vector< int > &impact_indices) |
Activates impacts. More... | |
void | deactivateImpacts (const std::vector< int > &impact_indices) |
Deactivates impacts. More... | |
void | setContactPlacement (const int contact_index, const Eigen::Vector3d &contact_position) |
Sets a contact placement, that is, the position and rotation of the contact. The contact rotation is set to Eigen::Matrix3d::Identity(), which represents the vertical direction to the ground. For the point contacts, the rotation is only used in the friction cone constraints. For the surface contacts, the rotation represents the rotational contact constraints on the contact frame of the robot. More... | |
void | setContactPlacement (const int contact_index, const Eigen::Vector3d &contact_position, const Eigen::Matrix3d &contact_rotation) |
Sets a contact placement, that is, the position and rotation of the contact. For the point contacts, the rotation is only used in the friction cone constraints. For the surface contacts, the rotation represents the rotational contact constraints on the contact frame of the robot. More... | |
void | setContactPlacement (const int contact_index, const SE3 &contact_placement) |
Sets a contact placement, that is, the position and rotation of the contact. For the point contacts, the rotation is only used in the friction cone constraints. For the surface contacts, the rotation represents the rotational contact constraints on the contact frame of the robot. More... | |
void | setContactPlacements (const std::vector< Eigen::Vector3d > &contact_positions) |
Sets contact placements. The rotation of each contact is set to Eigen::Matrix3d::Identity(), which represents the vertical direction to the ground. More... | |
void | setContactPlacements (const std::vector< Eigen::Vector3d > &contact_positions, const std::vector< Eigen::Matrix3d > &contact_rotations) |
Sets contact placements. More... | |
void | setContactPlacements (const aligned_vector< SE3 > &contact_placements) |
Sets contact placements. More... | |
const SE3 & | contactPlacement (const int contact_index) const |
Gets the contact placement. More... | |
const Eigen::Vector3d & | contactPosition (const int contact_index) const |
Gets the contact position. More... | |
const Eigen::Matrix3d & | contactRotation (const int contact_index) const |
Gets the contact rotation. More... | |
const aligned_vector< SE3 > & | contactPlacements () const |
Gets the contact placements. More... | |
const std::vector< Eigen::Vector3d > & | contactPositions () const |
Gets the contact positions. More... | |
const std::vector< Eigen::Matrix3d > & | contactRotations () const |
Gets the contact rotations. More... | |
void | setFrictionCoefficient (const int contact_index, const double friction_coefficient) |
Gets the friction coefficint. More... | |
void | setFrictionCoefficient (const std::string &contact_frame_name, const double friction_coefficient) |
Gets the friction coefficint. More... | |
void | setFrictionCoefficients (const std::vector< double > &friction_coefficients) |
Sets the friction coefficints. More... | |
void | setFrictionCoefficients (const std::unordered_map< std::string, double > &friction_coefficients) |
Sets the friction coefficints. More... | |
double | frictionCoefficient (const int contact_index) const |
Gets the friction coefficint. Default value is 0.7. More... | |
double | frictionCoefficient (const std::string &contact_frame_name) const |
Gets the friction coefficint. Default value is 0.7. More... | |
const std::vector< double > & | frictionCoefficients () const |
Gets the friction coefficints. Default value is 0.7. More... | |
void | setRandom () |
Fills impact status randomly. More... | |
void | disp (std::ostream &os) const |
Displays the impact status onto a ostream. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const ImpactStatus &impact_status) |
Impact status of robot model. Wrapper of ContactStatus to treat impacts.
|
inline |
Constructor.
[in] | contact_types | Types of contacts. |
[in] | contact_frame_names | Names of contact frames. |
[in] | default_friction_coefficient | Default friction coefficitn. Must be positive. Default is 0.7. |
|
inline |
Default constructor.
|
default |
Default destructor.
|
default |
Default copy constructor.
|
defaultnoexcept |
Default move constructor.
|
inline |
Activates a impact.
[in] | contact_index | Index of the contact that is activated. |
|
inline |
Activates impacts.
[in] | impact_indices | Indices of the impacts that are activated. |
|
inline |
Gets the contact placement.
[in] | contact_index | Index of the contact . |
|
inline |
Gets the contact placements.
|
inline |
Gets the contact position.
[in] | contact_index | Index of the contact . |
|
inline |
Gets the contact positions.
|
inline |
Gets the contact rotation.
[in] | contact_index | Index of the contact . |
|
inline |
Gets the contact rotations.
|
inline |
Returns the type of the contact.
[in] | contact_index | Index of a contact of interedted. |
|
inline |
Returns the types of the contacts.
|
inline |
Deactivates a impact.
[in] | contact_index | Index of the contact that is deactivated. |
|
inline |
Deactivates impacts.
[in] | impact_indices | Indices of the impacts that are deactivated. |
|
inline |
Returns the dimension of the active impact forces.
void robotoc::ImpactStatus::disp | ( | std::ostream & | os | ) | const |
Displays the impact status onto a ostream.
|
inline |
Gets the friction coefficint. Default value is 0.7.
[in] | contact_index | Index of the contact. |
|
inline |
Gets the friction coefficint. Default value is 0.7.
[in] | contact_frame_name | Name of the contact frame. |
|
inline |
Gets the friction coefficints. Default value is 0.7.
|
inline |
Returns true if there are active impacts and false if not.
|
inline |
Returns the activity of the impacts.
|
inline |
Returns true if a contact is active and false if not.
[in] | contact_index | Index of a contact of interedted. |
|
inline |
Returns the maximum number of the contacts.
|
inline |
Defines a comparison operator.
|
default |
Default copy assign operator.
|
defaultnoexcept |
Default move assign operator.
|
inline |
Defines a comparison operator.
|
inline |
Sets a contact placement, that is, the position and rotation of the contact. The contact rotation is set to Eigen::Matrix3d::Identity(), which represents the vertical direction to the ground. For the point contacts, the rotation is only used in the friction cone constraints. For the surface contacts, the rotation represents the rotational contact constraints on the contact frame of the robot.
[in] | contact_index | Index of the contact. |
[in] | contact_position | Contact position. |
|
inline |
Sets a contact placement, that is, the position and rotation of the contact. For the point contacts, the rotation is only used in the friction cone constraints. For the surface contacts, the rotation represents the rotational contact constraints on the contact frame of the robot.
[in] | contact_index | Index of the contact. |
[in] | contact_position | Contact position. |
[in] | contact_rotation | Contact rotation. |
|
inline |
Sets a contact placement, that is, the position and rotation of the contact. For the point contacts, the rotation is only used in the friction cone constraints. For the surface contacts, the rotation represents the rotational contact constraints on the contact frame of the robot.
[in] | contact_index | Index of the contact. |
[in] | contact_placement | Contact placement. |
|
inline |
Sets contact placements.
[in] | contact_placements | Contact placements. Size must be ImpactStatus::maxNumContacts(). |
|
inline |
Sets contact placements. The rotation of each contact is set to Eigen::Matrix3d::Identity(), which represents the vertical direction to the ground.
[in] | contact_positions | Contact positions. Size must be ImpactStatus::maxNumContacts(). |
|
inline |
Sets contact placements.
[in] | contact_positions | Contact positions. Size must be ImpactStatus::maxNumContacts(). |
[in] | contact_rotations | Contact rotations. Size must be ImpactStatus::maxNumContacts(). |
|
inline |
Gets the friction coefficint.
[in] | contact_index | Index of the contact. |
[in] | friction_coefficient | Friction coefficient. Must be positive. |
|
inline |
Gets the friction coefficint.
[in] | contact_frame_name | Name of the contact frame. |
[in] | friction_coefficient | Friction coefficient. Must be positive. |
|
inline |
Sets the friction coefficints.
[in] | friction_coefficients | Friction coefficients. Size must be ContactStatus::maxNumContacts() and each element must be positive. |
|
inline |
Sets the friction coefficints.
[in] | friction_coefficients | Friction coefficients. Size must be ContactStatus::maxNumContacts() and each element must be positive. |
|
inline |
Fills impact status randomly.
|
friend |