robotoc
robotoc - efficient ROBOT Optimal Control solvers
|
Discrete event composed by impact and lift. More...
#include <discrete_event.hpp>
Public Member Functions | |
DiscreteEvent (const ContactStatus &pre_contact_status, const ContactStatus &post_contact_status) | |
Constructs discrete event from two sequential contact status. More... | |
DiscreteEvent () | |
Default constructor. More... | |
~DiscreteEvent ()=default | |
Destructor. More... | |
DiscreteEvent (const DiscreteEvent &)=default | |
Default copy constructor. More... | |
DiscreteEvent & | operator= (const DiscreteEvent &)=default |
Default copy assign operator. More... | |
DiscreteEvent (DiscreteEvent &&) noexcept=default | |
Default move constructor. More... | |
DiscreteEvent & | operator= (DiscreteEvent &&) noexcept=default |
Default move assign operator. More... | |
bool | existDiscreteEvent () const |
Returns true if this discrete event exists. Returns false if not. More... | |
bool | existImpact () const |
Returns true if impact exists in this discrete event. Returns false if not. More... | |
bool | existLift () const |
Returns true if lift exists in this discrete event. Returns false if not. More... | |
const ImpactStatus & | impactStatus () const |
Returns const reference to impact status. More... | |
const ContactStatus & | preContactStatus () const |
Gets the contact status before this discrete event. More... | |
const ContactStatus & | postContactStatus () const |
Gets the contact status after this discrete event. More... | |
void | setDiscreteEvent (const ContactStatus &pre_contact_status, const ContactStatus &post_contact_status) |
Sets the contact status from two sequential contact status. 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 | 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... | |
void | setFrictionCoefficient (const int contact_index, const double friction_coefficient) |
Gets the friction coefficint. More... | |
void | setFrictionCoefficients (const std::vector< double > &friction_coefficients) |
Sets the friction coefficints. More... | |
int | maxNumContacts () const |
Returns the maximum number of the contacts. More... | |
DiscreteEventType | eventType () const |
Returns the event type of this discrete event. More... | |
void | disp (std::ostream &os) const |
Displays the discrete event onto a ostream. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const DiscreteEvent &discrete_event) |
Discrete event composed by impact and lift.
robotoc::DiscreteEvent::DiscreteEvent | ( | const ContactStatus & | pre_contact_status, |
const ContactStatus & | post_contact_status | ||
) |
Constructs discrete event from two sequential contact status.
[in] | pre_contact_status | Contact status before this discrete event. |
[in] | post_contact_status | Contact status after this discrete event. |
robotoc::DiscreteEvent::DiscreteEvent | ( | ) |
Default constructor.
|
default |
Destructor.
|
default |
Default copy constructor.
|
defaultnoexcept |
Default move constructor.
void robotoc::DiscreteEvent::disp | ( | std::ostream & | os | ) | const |
Displays the discrete event onto a ostream.
|
inline |
Returns the event type of this discrete event.
|
inline |
Returns true if this discrete event exists. Returns false if not.
|
inline |
Returns true if impact exists in this discrete event. Returns false if not.
|
inline |
Returns true if lift exists in this discrete event. Returns false if not.
|
inline |
Returns const reference to impact status.
|
inline |
Returns the maximum number of the contacts.
|
default |
Default copy assign operator.
|
defaultnoexcept |
Default move assign operator.
|
inline |
Gets the contact status after this discrete event.
|
inline |
Gets the contact status before this discrete event.
void robotoc::DiscreteEvent::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.
[in] | contact_index | Index of the contact. |
[in] | contact_position | Contact position. |
void robotoc::DiscreteEvent::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.
[in] | contact_index | Index of the contact. |
[in] | contact_position | Contact position. |
[in] | contact_rotation | Contact rotation. |
void robotoc::DiscreteEvent::setContactPlacements | ( | const aligned_vector< SE3 > & | contact_placements | ) |
Sets contact placements.
[in] | contact_placements | Contact placements. Size must be DiscreteEvent::maxNumContacts(). |
void robotoc::DiscreteEvent::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.
[in] | contact_positions | Contact positions. Size must be DiscreteEvent::maxNumContacts(). |
void robotoc::DiscreteEvent::setContactPlacements | ( | const std::vector< Eigen::Vector3d > & | contact_positions, |
const std::vector< Eigen::Matrix3d > & | contact_rotations | ||
) |
Sets contact placements.
[in] | contact_positions | Contact positions. Size must be DiscreteEvent::maxNumContacts(). |
[in] | contact_rotations | Contact rotations. Size must be DiscreteEvent::maxNumContacts(). |
void robotoc::DiscreteEvent::setDiscreteEvent | ( | const ContactStatus & | pre_contact_status, |
const ContactStatus & | post_contact_status | ||
) |
Sets the contact status from two sequential contact status.
[in] | pre_contact_status | Contact status before this discrete event. |
[in] | post_contact_status | Contact status after this discrete event. |
void robotoc::DiscreteEvent::setFrictionCoefficient | ( | const int | contact_index, |
const double | friction_coefficient | ||
) |
Gets the friction coefficint.
[in] | contact_index | Index of the contact. |
[in] | friction_coefficient | Friction coefficient. Must be positive. |
void robotoc::DiscreteEvent::setFrictionCoefficients | ( | const std::vector< double > & | friction_coefficients | ) |
Sets the friction coefficints.
[in] | friction_coefficients | Friction coefficients. Size must be ContactStatus::maxNumContacts() and each element must be positive. |
|
friend |