robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
robotoc::DiscreteEvent Class Reference

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...
 
DiscreteEventoperator= (const DiscreteEvent &)=default
 Default copy assign operator. More...
 
 DiscreteEvent (DiscreteEvent &&) noexcept=default
 Default move constructor. More...
 
DiscreteEventoperator= (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 ImpactStatusimpactStatus () const
 Returns const reference to impact status. More...
 
const ContactStatuspreContactStatus () const
 Gets the contact status before this discrete event. More...
 
const ContactStatuspostContactStatus () 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)
 

Detailed Description

Discrete event composed by impact and lift.

Constructor & Destructor Documentation

◆ DiscreteEvent() [1/4]

robotoc::DiscreteEvent::DiscreteEvent ( const ContactStatus pre_contact_status,
const ContactStatus post_contact_status 
)

Constructs discrete event from two sequential contact status.

Parameters
[in]pre_contact_statusContact status before this discrete event.
[in]post_contact_statusContact status after this discrete event.

◆ DiscreteEvent() [2/4]

robotoc::DiscreteEvent::DiscreteEvent ( )

Default constructor.

◆ ~DiscreteEvent()

robotoc::DiscreteEvent::~DiscreteEvent ( )
default

Destructor.

◆ DiscreteEvent() [3/4]

robotoc::DiscreteEvent::DiscreteEvent ( const DiscreteEvent )
default

Default copy constructor.

◆ DiscreteEvent() [4/4]

robotoc::DiscreteEvent::DiscreteEvent ( DiscreteEvent &&  )
defaultnoexcept

Default move constructor.

Member Function Documentation

◆ disp()

void robotoc::DiscreteEvent::disp ( std::ostream &  os) const

Displays the discrete event onto a ostream.

◆ eventType()

DiscreteEventType robotoc::DiscreteEvent::eventType ( ) const
inline

Returns the event type of this discrete event.

Returns
Event type of this discrete event.

◆ existDiscreteEvent()

bool robotoc::DiscreteEvent::existDiscreteEvent ( ) const
inline

Returns true if this discrete event exists. Returns false if not.

Returns
true if this discrete event exists. false if not.

◆ existImpact()

bool robotoc::DiscreteEvent::existImpact ( ) const
inline

Returns true if impact exists in this discrete event. Returns false if not.

Returns
true if impact exists. false if not.

◆ existLift()

bool robotoc::DiscreteEvent::existLift ( ) const
inline

Returns true if lift exists in this discrete event. Returns false if not.

Returns
true if lift exists. false if not.

◆ impactStatus()

const ImpactStatus & robotoc::DiscreteEvent::impactStatus ( ) const
inline

Returns const reference to impact status.

Returns
const reference to impact status.

◆ maxNumContacts()

int robotoc::DiscreteEvent::maxNumContacts ( ) const
inline

Returns the maximum number of the contacts.

Returns
The maximum number of the contacts.

◆ operator=() [1/2]

DiscreteEvent & robotoc::DiscreteEvent::operator= ( const DiscreteEvent )
default

Default copy assign operator.

◆ operator=() [2/2]

DiscreteEvent & robotoc::DiscreteEvent::operator= ( DiscreteEvent &&  )
defaultnoexcept

Default move assign operator.

◆ postContactStatus()

const ContactStatus & robotoc::DiscreteEvent::postContactStatus ( ) const
inline

Gets the contact status after this discrete event.

Returns
const reference to the post contact status.

◆ preContactStatus()

const ContactStatus & robotoc::DiscreteEvent::preContactStatus ( ) const
inline

Gets the contact status before this discrete event.

Returns
const reference to the pre contact status.

◆ setContactPlacement() [1/2]

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.

Parameters
[in]contact_indexIndex of the contact.
[in]contact_positionContact position.

◆ setContactPlacement() [2/2]

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.

Parameters
[in]contact_indexIndex of the contact.
[in]contact_positionContact position.
[in]contact_rotationContact rotation.

◆ setContactPlacements() [1/3]

void robotoc::DiscreteEvent::setContactPlacements ( const aligned_vector< SE3 > &  contact_placements)

Sets contact placements.

Parameters
[in]contact_placementsContact placements. Size must be DiscreteEvent::maxNumContacts().

◆ setContactPlacements() [2/3]

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.

Parameters
[in]contact_positionsContact positions. Size must be DiscreteEvent::maxNumContacts().

◆ setContactPlacements() [3/3]

void robotoc::DiscreteEvent::setContactPlacements ( const std::vector< Eigen::Vector3d > &  contact_positions,
const std::vector< Eigen::Matrix3d > &  contact_rotations 
)

Sets contact placements.

Parameters
[in]contact_positionsContact positions. Size must be DiscreteEvent::maxNumContacts().
[in]contact_rotationsContact rotations. Size must be DiscreteEvent::maxNumContacts().

◆ setDiscreteEvent()

void robotoc::DiscreteEvent::setDiscreteEvent ( const ContactStatus pre_contact_status,
const ContactStatus post_contact_status 
)

Sets the contact status from two sequential contact status.

Parameters
[in]pre_contact_statusContact status before this discrete event.
[in]post_contact_statusContact status after this discrete event.

◆ setFrictionCoefficient()

void robotoc::DiscreteEvent::setFrictionCoefficient ( const int  contact_index,
const double  friction_coefficient 
)

Gets the friction coefficint.

Parameters
[in]contact_indexIndex of the contact.
[in]friction_coefficientFriction coefficient. Must be positive.

◆ setFrictionCoefficients()

void robotoc::DiscreteEvent::setFrictionCoefficients ( const std::vector< double > &  friction_coefficients)

Sets the friction coefficints.

Parameters
[in]friction_coefficientsFriction coefficients. Size must be ContactStatus::maxNumContacts() and each element must be positive.

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const DiscreteEvent discrete_event 
)
friend

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