15 #include <Eigen/Eigen> 26 enum class ContactType { FreeContact = 0, FlatContact = 1, FullContact = 2 };
43 int& terrainId() {
return terrain_id_; }
44 int& optimizationId() {
return optimization_id_; }
45 ContactType& contactType() {
return contact_type_; }
46 double& contactActivationTime() {
return time_ini_; }
47 double& contactDeactivationTime() {
return time_end_; }
48 bool& selectedAsActive() {
return selected_as_active_; }
49 Eigen::Vector3d& contactPosition() {
return position_; }
50 Eigen::Quaternion<double>& contactOrientation() {
return orientation_; }
52 void contactActivationTime(
const double& time_ini) { time_ini_ = time_ini; }
53 void contactDeactivationTime(
const double& time_end) { time_end_ = time_end; }
54 void contactPosition(
const Eigen::Vector3d& position) { position_ = position; }
55 void contactOrientation(
const Eigen::Quaternion<double>& orientation) { orientation_ = orientation; }
56 void contactType(
const ContactType& contact_type) { contact_type_ = contact_type; }
57 void contactPlacement(
const Eigen::Matrix<double, 4, 4>& placement);
58 void selectedAsActive(
const bool& active){selected_as_active_ = active;}
60 const int& terrainId()
const {
return terrain_id_; }
61 const int& optimizationId()
const {
return optimization_id_; }
62 const ContactType& contactType()
const {
return contact_type_; }
63 const double& contactActivationTime()
const {
return time_ini_; }
64 const double& contactDeactivationTime()
const {
return time_end_; }
65 const bool& selectedAsActive()
const {
return selected_as_active_; }
66 const Eigen::Vector3d& contactPosition()
const {
return position_; }
67 const Eigen::Quaternion<double>& contactOrientation()
const {
return orientation_; }
68 const Eigen::Matrix<double, 4, 4> contactPlacement()
const;
71 std::string toString()
const;
72 friend std::ostream& operator<<(std::ostream &os,
const ContactState& obj) {
return os << obj.toString(); }
76 ContactState(
const Eigen::VectorXd& parameters,
const int optimization_id);
79 bool selected_as_active_;
80 Eigen::Vector3d position_;
82 double time_ini_, time_end_;
83 int optimization_id_, terrain_id_;
84 Eigen::Quaternion<double> orientation_;
94 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
100 const int numOptimizationContacts() {
return num_optimization_contacts_; }
101 const int numEndeffectorContacts(
int eff_id)
const {
return endeffector_contacts_[eff_id].size(); }
102 void loadFromFile(
const std::string cfg_file,
const std::string contact_plan_name =
"contact_plan");
103 std::vector<ContactState>& endeffectorContacts(
int eff_id) {
return endeffector_contacts_[eff_id]; }
104 const std::vector<ContactState>& endeffectorContacts(
int eff_id)
const {
return endeffector_contacts_[eff_id]; }
105 void endeffectorContacts(
int eff_id,
const std::vector<ContactState>& endeffector_contacts) { endeffector_contacts_[eff_id] = endeffector_contacts; }
106 const long endeffectorNum() {
return endeffector_contacts_.size(); }
108 std::string toString()
const;
109 friend std::ostream& operator<<(std::ostream &os,
const ContactSequence& obj) {
return os << obj.toString(); }
112 int num_optimization_contacts_;
125 int& viapointId() {
return viapoint_id_; }
126 Eigen::Vector3d& viapointPosition() {
return position_; }
127 Eigen::Quaternion<double>& viapointOrientation() {
return orientation_; }
129 const int& viapointId()
const {
return viapoint_id_; }
130 const int& optimizationId() {
return optimization_id_; }
131 const Eigen::Vector3d& viapointPosition()
const {
return position_; }
132 const Eigen::Quaternion<double>& viapointOrientation()
const {
return orientation_; }
134 std::string toString()
const;
135 friend std::ostream& operator<<(std::ostream &os,
const ViapointState& obj) {
return os << obj.toString(); }
139 ViapointState(
const Eigen::VectorXd& parameters,
const int optimization_id);
142 Eigen::Vector3d position_;
143 int optimization_id_, viapoint_id_;
144 Eigen::Quaternion<double> orientation_;
153 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
159 const int& numOptimizationViapoints()
const {
return num_optimization_viapoints_; }
160 const int numEndeffectorViapoints(
int eff_id)
const {
return endeffector_viapoints_[eff_id].size(); }
161 void loadFromFile(
const std::string cfg_file,
const std::string contact_plan_name =
"contact_plan");
162 std::vector<ViapointState>& endeffectorViapoints(
int eff_id) {
return endeffector_viapoints_[eff_id]; }
163 const std::vector<ViapointState>& endeffectorViapoints(
int eff_id)
const {
return endeffector_viapoints_[eff_id]; }
165 std::string toString()
const;
166 friend std::ostream& operator<<(std::ostream &os,
const ViapointSequence& obj) {
return os << obj.toString(); }
169 int num_optimization_viapoints_;
ContactType
Definition of contact type: FlatContact: forces subject to friction cone constrains of flat surface F...
Definition: ContactState.hpp:26
This class is a container for a sequence of viapoint states for all end-effectors.
Definition: ContactState.hpp:150
This class defines a viapoint state including position and orientation.
Definition: ContactState.hpp:119
static constexpr int n_endeffs_
Definition: Definitions.hpp:21