1#ifndef ROBOTOC_DISCRETE_EVENT_HPP_
2#define ROBOTOC_DISCRETE_EVENT_HPP_
71 return (exist_impact_ || exist_lift_);
97 return impact_status_;
105 return pre_contact_status_;
113 return post_contact_status_;
135 const Eigen::Vector3d& contact_position);
148 const Eigen::Vector3d& contact_position,
149 const Eigen::Matrix3d& contact_rotation);
159 const std::vector<Eigen::Vector3d>& contact_positions);
169 const std::vector<Eigen::Vector3d>& contact_positions,
170 const std::vector<Eigen::Matrix3d>& contact_rotations);
186 const double friction_coefficient);
200 return max_num_contacts_;
214 void disp(std::ostream& os)
const;
222 int max_num_contacts_;
224 bool exist_impact_, exist_lift_;
Discrete event composed by impact and lift.
Definition: discrete_event.hpp:26
void setDiscreteEvent(const ContactStatus &pre_contact_status, const ContactStatus &post_contact_status)
Sets the contact status from two sequential contact status.
bool existLift() const
Returns true if lift exists in this discrete event. Returns false if not.
Definition: discrete_event.hpp:88
void setFrictionCoefficients(const std::vector< double > &friction_coefficients)
Sets the friction coefficints.
void setFrictionCoefficient(const int contact_index, const double friction_coefficient)
Gets the friction coefficint.
DiscreteEventType eventType() const
Returns the event type of this discrete event.
Definition: discrete_event.hpp:207
DiscreteEvent & operator=(const DiscreteEvent &)=default
Default copy assign operator.
DiscreteEvent(const ContactStatus &pre_contact_status, const ContactStatus &post_contact_status)
Constructs discrete event from two sequential contact status.
DiscreteEvent(const DiscreteEvent &)=default
Default copy constructor.
const ContactStatus & postContactStatus() const
Gets the contact status after this discrete event.
Definition: discrete_event.hpp:112
DiscreteEvent()
Default constructor.
void setContactPlacements(const std::vector< Eigen::Vector3d > &contact_positions, const std::vector< Eigen::Matrix3d > &contact_rotations)
Sets contact placements.
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,...
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 ...
void disp(std::ostream &os) const
Displays the discrete event onto a ostream.
~DiscreteEvent()=default
Destructor.
bool existDiscreteEvent() const
Returns true if this discrete event exists. Returns false if not.
Definition: discrete_event.hpp:70
friend std::ostream & operator<<(std::ostream &os, const DiscreteEvent &discrete_event)
DiscreteEvent(DiscreteEvent &&) noexcept=default
Default move constructor.
const ImpactStatus & impactStatus() const
Returns const reference to impact status.
Definition: discrete_event.hpp:96
const ContactStatus & preContactStatus() const
Gets the contact status before this discrete event.
Definition: discrete_event.hpp:104
int maxNumContacts() const
Returns the maximum number of the contacts.
Definition: discrete_event.hpp:199
void setContactPlacements(const aligned_vector< SE3 > &contact_placements)
Sets contact placements.
bool existImpact() const
Returns true if impact exists in this discrete event. Returns false if not.
Definition: discrete_event.hpp:79
void setContactPlacements(const std::vector< Eigen::Vector3d > &contact_positions)
Sets contact placements. The rotation of each contact is set to Eigen::Matrix3d::Identity(),...
Impact status of robot model. Wrapper of ContactStatus to treat impacts.
Definition: impact_status.hpp:21
Definition: constraint_component_base.hpp:17
DiscreteEventType
Type of the discrete events.
Definition: discrete_event.hpp:16
std::vector< T, Eigen::aligned_allocator< T > > aligned_vector
std vector with Eigen::aligned_allocator.
Definition: aligned_vector.hpp:14