1#ifndef ROBOTOC_IMPACT_STATUS_HXX_
2#define ROBOTOC_IMPACT_STATUS_HXX_
13 const std::vector<ContactType>& contact_types,
14 const std::vector<std::string>& contact_frame_names,
15 const double default_friction_coefficients)
16 : contact_status_(contact_types, contact_frame_names,
17 default_friction_coefficients) {
41 return !(*
this == other);
71 return contact_status_.
dimf();
91 const std::vector<int>& impact_indices) {
97 const std::vector<int>& impact_indices) {
103 const int contact_index,
const Eigen::Vector3d& contact_position) {
109 const int contact_index,
const Eigen::Vector3d& contact_position,
110 const Eigen::Matrix3d& contact_rotation) {
117 const SE3& contact_placement) {
123 const std::vector<Eigen::Vector3d>& contact_positions) {
129 const std::vector<Eigen::Vector3d>& contact_positions,
130 const std::vector<Eigen::Matrix3d>& contact_rotations) {
142 const int contact_index)
const {
148 const int contact_index)
const {
154 const int contact_index)
const {
164inline const std::vector<Eigen::Vector3d>&
170inline const std::vector<Eigen::Matrix3d>&
177 const double friction_coefficient) {
183 const double friction_coefficient) {
189 const std::vector<double>& friction_coefficients) {
195 const std::unordered_map<std::string, double>& friction_coefficients) {
206 const std::string& contact_frame_name)
const {
Impact status of robot model. Wrapper of ContactStatus to treat impacts.
Definition: impact_status.hpp:21
const std::vector< Eigen::Matrix3d > & contactRotations() const
Gets the contact rotations.
Definition: impact_status.hxx:171
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 ...
Definition: impact_status.hxx:102
bool operator!=(const ImpactStatus &other) const
Defines a comparison operator.
Definition: impact_status.hxx:40
ImpactStatus()
Default constructor.
Definition: impact_status.hxx:21
ContactType contactType(const int contact_index) const
Returns the type of the contact.
Definition: impact_status.hxx:45
void setFrictionCoefficients(const std::vector< double > &friction_coefficients)
Sets the friction coefficints.
Definition: impact_status.hxx:188
void setContactPlacements(const std::vector< Eigen::Vector3d > &contact_positions)
Sets contact placements. The rotation of each contact is set to Eigen::Matrix3d::Identity(),...
Definition: impact_status.hxx:122
int dimf() const
Returns the dimension of the active impact forces.
Definition: impact_status.hxx:70
const SE3 & contactPlacement(const int contact_index) const
Gets the contact placement.
Definition: impact_status.hxx:141
const std::vector< double > & frictionCoefficients() const
Gets the friction coefficints. Default value is 0.7.
Definition: impact_status.hxx:211
void setFrictionCoefficient(const int contact_index, const double friction_coefficient)
Gets the friction coefficint.
Definition: impact_status.hxx:176
void deactivateImpact(const int contact_index)
Deactivates a impact.
Definition: impact_status.hxx:85
double frictionCoefficient(const int contact_index) const
Gets the friction coefficint. Default value is 0.7.
Definition: impact_status.hxx:200
const std::vector< Eigen::Vector3d > & contactPositions() const
Gets the contact positions.
Definition: impact_status.hxx:165
const std::vector< bool > & isImpactActive() const
Returns the activity of the impacts.
Definition: impact_status.hxx:60
const std::vector< ContactType > & contactTypes() const
Returns the types of the contacts.
Definition: impact_status.hxx:50
const Eigen::Matrix3d & contactRotation(const int contact_index) const
Gets the contact rotation.
Definition: impact_status.hxx:153
const aligned_vector< SE3 > & contactPlacements() const
Gets the contact placements.
Definition: impact_status.hxx:159
int maxNumContacts() const
Returns the maximum number of the contacts.
Definition: impact_status.hxx:75
void setRandom()
Fills impact status randomly.
Definition: impact_status.hxx:216
bool hasActiveImpact() const
Returns true if there are active impacts and false if not.
Definition: impact_status.hxx:65
void activateImpact(const int contact_index)
Activates a impact.
Definition: impact_status.hxx:80
void activateImpacts(const std::vector< int > &impact_indices)
Activates impacts.
Definition: impact_status.hxx:90
void deactivateImpacts(const std::vector< int > &impact_indices)
Deactivates impacts.
Definition: impact_status.hxx:96
bool operator==(const ImpactStatus &other) const
Defines a comparison operator.
Definition: impact_status.hxx:26
bool isImpactActive(const int contact_index) const
Returns true if a contact is active and false if not.
Definition: impact_status.hxx:55
const Eigen::Vector3d & contactPosition(const int contact_index) const
Gets the contact position.
Definition: impact_status.hxx:147
Definition: constraint_component_base.hpp:17
ContactType
Types of contacts.
Definition: contact_status.hpp:22
std::vector< T, Eigen::aligned_allocator< T > > aligned_vector
std vector with Eigen::aligned_allocator.
Definition: aligned_vector.hpp:14
pinocchio::SE3 SE3
Using pinocchio::SE3 without its namespace.
Definition: se3.hpp:15