@@ -27,6 +27,13 @@ namespace simple_mpc
2727 */
2828 struct RobotModelHandler
2929 {
30+ enum FootType
31+ {
32+ POINT,
33+ SIX_D
34+ };
35+ typedef Eigen::Matrix<double , 4 , 3 > ContactPointsMatrix;
36+
3037 private:
3138 /* *
3239 * @brief Model to be used by ocp
@@ -49,6 +56,16 @@ namespace simple_mpc
4956 */
5057 std::vector<std::string> feet_names_;
5158
59+ /* *
60+ * @brief Is the foot a contact point or a 6D contact
61+ */
62+ std::vector<FootType> feet_types_;
63+
64+ /* *
65+ * @brief List of contact points for each 6D feets
66+ */
67+ std::map<size_t , Eigen::Matrix<double , 4 , 3 >> feet_contact_points_;
68+
5269 /* *
5370 * @brief Ids of the frames to be in contact with the environment
5471 */
@@ -77,15 +94,34 @@ namespace simple_mpc
7794 const Model & model, const std::string & reference_configuration_name, const std::string & base_frame_name);
7895
7996 /* *
80- * @brief
97+ * @brief Create a point foot, that can apply 3D force to the ground. (in comparison to 6D foot)
8198 *
8299 * @param foot_name Frame name that will be used a a foot
83100 * @param reference_frame_name Frame to which the foot reference
84101 * frame will be attached.
85102 *
103+ * @return the foot number
104+ *
86105 * @note The foot placement will be set by default using the reference configuration of the RobotModelHandler
87106 */
88- FrameIndex addFoot (const std::string & foot_name, const std::string & reference_frame_name);
107+ size_t addPointFoot (const std::string & foot_name, const std::string & reference_frame_name);
108+
109+ /* *
110+ * @brief Create a point foot, that can apply 6D wrench to the ground. (in comparison to point foot)
111+ *
112+ * @param foot_name Frame name that will be used a a foot
113+ * @param reference_frame_name Frame to which the foot reference
114+ * frame will be attached.
115+ * @param contactPoints 3D positions (in the local frame) of the foot 4 extremum point
116+ *
117+ * @return the foot number
118+ *
119+ * @note The foot placement will be set by default using the reference configuration of the RobotModelHandler
120+ */
121+ size_t add6DFoot (
122+ const std::string & foot_name,
123+ const std::string & reference_frame_name,
124+ const ContactPointsMatrix & contactPoints);
89125
90126 /* *
91127 * @brief Update the reference placement of the foot wrt to the frame it is attached to
@@ -115,6 +151,16 @@ namespace simple_mpc
115151 return size_t (std::find (feet_names_.begin (), feet_names_.end (), foot_name) - feet_names_.begin ());
116152 }
117153
154+ FootType getFootType (size_t i) const
155+ {
156+ return feet_types_[i];
157+ }
158+
159+ const ContactPointsMatrix & get6DFootContactPoints (size_t i) const
160+ {
161+ return feet_contact_points_.at (i);
162+ }
163+
118164 const std::vector<FrameIndex> & getFeetIds () const
119165 {
120166 return feet_ids_;
@@ -159,6 +205,16 @@ namespace simple_mpc
159205 {
160206 return model_;
161207 }
208+
209+ private:
210+ /* *
211+ * @brief Common operation to perform to add a foot (of any type) : Create the reference frame and set it default
212+ * pose using the default pose of the robot
213+ *
214+ * @param foot_name Name of the frame foot
215+ * @param reference_frame_name Name of the frame where the reference frame of the foot will be attached
216+ */
217+ void addFootFrames (const std::string & foot_name, const std::string & reference_frame_name);
162218 };
163219
164220 class RobotDataHandler
0 commit comments