robotoc
robotoc - efficient ROBOT Optimal Control solvers
|
Contact status of robot model. More...
#include <contact_status.hpp>
Public Member Functions | |
ContactStatus (const std::vector< ContactType > &contact_types, const std::vector< std::string > &contact_frame_names, const double default_friction_coefficient=0.7) | |
Constructor. More... | |
ContactStatus () | |
Default constructor. More... | |
~ContactStatus ()=default | |
Default destructor. More... | |
ContactStatus (const ContactStatus &)=default | |
Default copy constructor. More... | |
ContactStatus & | operator= (const ContactStatus &)=default |
Default copy assign operator. More... | |
ContactStatus (ContactStatus &&) noexcept=default | |
Default move constructor. More... | |
ContactStatus & | operator= (ContactStatus &&) noexcept=default |
Default move assign operator. More... | |
bool | operator== (const ContactStatus &other) const |
Defines a comparison operator. More... | |
bool | operator!= (const ContactStatus &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... | |
const std::string & | contactFrameName (const int contact_index) const |
Returns the name of the contact frame. More... | |
const std::vector< std::string > & | contactFrameNames () const |
Returns the names of the contact frames. More... | |
bool | isContactActive (const int contact_index) const |
Returns true if a contact is active and false if not. More... | |
bool | isContactActive (const std::string &contact_frame_name) const |
Returns true if a contact is active and false if not. More... | |
const std::vector< bool > & | isContactActive () const |
Returns the activity of the contacts. More... | |
bool | hasActiveContacts () const |
Returns true if there are active contacts and false if not. More... | |
int | dimf () const |
Returns the dimension of the active contact forces. More... | |
int | maxNumContacts () const |
Returns the maximum number of the contacts. More... | |
void | activateContact (const int contact_index) |
Activates a contact. More... | |
void | activateContact (const std::string &contact_frame_name) |
Activates a contact. More... | |
void | deactivateContact (const int contact_index) |
Deactivates a contact. More... | |
void | deactivateContact (const std::string &contact_frame_name) |
Deactivates a contact. More... | |
void | activateContacts (const std::vector< int > &contact_indices) |
Activates contacts. More... | |
void | activateContacts (const std::vector< std::string > &contact_frame_names) |
Activates contacts. More... | |
void | deactivateContacts (const std::vector< int > &contact_indices) |
Deactivates contacts. More... | |
void | deactivateContacts (const std::vector< std::string > &contact_frame_names) |
Deactivates contacts. 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 std::string &contact_frame_name, 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 std::string &contact_frame_name, 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 | setContactPlacement (const std::string &contact_frame_name, 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::unordered_map< std::string, 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 std::unordered_map< std::string, Eigen::Vector3d > &contact_positions, const std::unordered_map< std::string, Eigen::Matrix3d > &contact_rotations) |
Sets contact placements. More... | |
void | setContactPlacements (const aligned_vector< SE3 > &contact_placements) |
Sets contact placements. More... | |
void | setContactPlacements (const aligned_unordered_map< std::string, SE3 > &contact_placements) |
Sets contact placements. More... | |
const SE3 & | contactPlacement (const int contact_index) const |
Gets the contact placement. More... | |
const SE3 & | contactPlacement (const std::string &contact_frame_name) const |
Gets the contact placement. More... | |
const Eigen::Vector3d & | contactPosition (const int contact_index) const |
Gets the contact position. More... | |
const Eigen::Vector3d & | contactPosition (const std::string &contact_frame_name) const |
Gets the contact position. More... | |
const Eigen::Matrix3d & | contactRotation (const int contact_index) const |
Gets the contact rotation. More... | |
const Eigen::Matrix3d & | contactRotation (const std::string &contact_frame_name) 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... | |
int | findContactIndex (const std::string &contact_frame_name) const |
Finds the contact index correspoinding to the input contact frame name. More... | |
void | setRandom () |
Fills contact status randomly. More... | |
void | disp (std::ostream &os) const |
Displays the contact status onto a ostream. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const ContactStatus &contact_status) |
Contact status of robot model.
|
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 contact.
[in] | contact_index | Index of the contact that is activated. |
|
inline |
Activates a contact.
[in] | contact_frame_name | Name of the contact frame that is activated. |
|
inline |
Activates contacts.
[in] | contact_indices | Indices of the contacts that are activated. |
|
inline |
Activates contacts.
[in] | contact_frame_names | Frame names of the contacts that are activated. |
|
inline |
Returns the name of the contact frame.
[in] | contact_index | Index of a contact of interedted. |
|
inline |
Returns the names of the contact frames.
|
inline |
Gets the contact placement.
[in] | contact_index | Index of the contact . |
|
inline |
Gets the contact placement.
[in] | contact_frame_name | Name of the contact frame. |
|
inline |
Gets the contact placements.
|
inline |
Gets the contact position.
[in] | contact_index | Index of the contact . |
|
inline |
Gets the contact position.
[in] | contact_frame_name | Name of the contact frame. |
|
inline |
Gets the contact positions.
|
inline |
Gets the contact rotation.
[in] | contact_index | Index of the contact . |
|
inline |
Gets the contact rotation.
[in] | contact_frame_name | Name of the contact frame. |
|
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 contact.
[in] | contact_index | Index of the contact that is deactivated. |
|
inline |
Deactivates a contact.
[in] | contact_frame_name | Name of the contact frame that is deactivated. |
|
inline |
Deactivates contacts.
[in] | contact_indices | Indices of the contacts that are deactivated. |
|
inline |
Deactivates contacts.
[in] | contact_frame_names | Frame names of the contacts that are deactivated. |
|
inline |
Returns the dimension of the active contact forces.
void robotoc::ContactStatus::disp | ( | std::ostream & | os | ) | const |
Displays the contact status onto a ostream.
|
inline |
Finds the contact index correspoinding to the input contact frame name.
[in] | contact_frame_name | Name of the contact frame. |
|
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 contacts and false if not.
|
inline |
Returns the activity of the contacts.
|
inline |
Returns true if a contact is active and false if not.
[in] | contact_index | Index of a contact of interedted. |
|
inline |
Returns true if a contact is active and false if not.
[in] | contact_frame_name | Name of the contact frame that is activated. |
|
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 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_frame_name | Name of the contact frame. |
[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_frame_name | Name of the contact frame. |
[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_frame_name | Name of the contact frame. |
[in] | contact_placement | Contact placement. |
|
inline |
Sets contact placements.
[in] | contact_placements | Contact placements. Size must be ContactStatus::maxNumContacts(). |
|
inline |
Sets contact placements.
[in] | contact_placements | Contact placements. Size must be ContactStatus::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 ContactStatus::maxNumContacts(). |
|
inline |
Sets contact placements.
[in] | contact_positions | Contact positions. Size must be ContactStatus::maxNumContacts(). |
[in] | contact_rotations | Contact rotations. Size must be ContactStatus::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 ContactStatus::maxNumContacts(). |
|
inline |
Sets contact placements.
[in] | contact_positions | Contact positions. Size must be ContactStatus::maxNumContacts(). |
[in] | contact_rotations | Contact rotations. Size must be ContactStatus::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 contact status randomly.
|
friend |