1
1
//
2
- // Copyright (c) 2015-2017 CNRS
2
+ // Copyright (c) 2015-2018 CNRS
3
3
// Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
4
4
//
5
5
// This file is part of Pinocchio
@@ -87,6 +87,39 @@ namespace se3
87
87
Model & buildModel (const ::urdf::ModelInterfaceSharedPtr & urdfTree,
88
88
Model & model,
89
89
const bool verbose = false );
90
+
91
+ // /
92
+ // / \brief Build the model from an XML stream with a particular joint as root of the model tree inside
93
+ // / the model given as reference argument.
94
+ // /
95
+ // / \param[in] xmlStream stream containing the URDF model.
96
+ // / \param[in] rootJoint The joint at the root of the model tree.
97
+ // / \param[in] verbose Print parsing info.
98
+ // / \param[out] model Reference model where to put the parsed information.
99
+ // / \return Return the reference on argument model for convenience.
100
+ // /
101
+ // / \note urdfTree can be build from ::urdf::parseURDF
102
+ // / or ::urdf::parseURDFFile
103
+ Model & buildModelFromXML (const std::string & xmlStream,
104
+ const JointModelVariant & rootJoint,
105
+ Model & model,
106
+ const bool verbose = false )
107
+ throw (std::invalid_argument);
108
+
109
+ // /
110
+ // / \brief Build the model from an XML stream
111
+ // /
112
+ // / \param[in] xmlStream stream containing the URDF model.
113
+ // / \param[in] verbose Print parsing info.
114
+ // / \param[out] model Reference model where to put the parsed information.
115
+ // / \return Return the reference on argument model for convenience.
116
+ // /
117
+ // / \note urdfTree can be build from ::urdf::parseURDF
118
+ // / or ::urdf::parseURDFFile
119
+ Model & buildModelFromXML (const std::string & xmlStream,
120
+ Model & model,
121
+ const bool verbose = false )
122
+ throw (std::invalid_argument);
90
123
91
124
92
125
/* *
@@ -97,7 +130,7 @@ namespace se3
97
130
* @param[in] model The model of the robot, built with
98
131
* urdf::buildModel
99
132
* @param[in] filename The URDF complete (absolute) file path
100
- * @param[in] packageDirs A vector containing the different directories
133
+ * @param[in] packageDirs A vector containing the different directories
101
134
* where to search for models and meshes, typically
102
135
* obtained from calling se3::rosPaths()
103
136
*
@@ -106,7 +139,7 @@ namespace se3
106
139
*
107
140
* @return Returns the reference on geom model for convenience.
108
141
*
109
- * \warning If hpp-fcl has not been found during compilation, COLLISION types can not be loaded
142
+ * \warning If hpp-fcl has not been found during compilation, COLLISION objects can not be loaded
110
143
*
111
144
*/
112
145
GeometryModel& buildGeom (const Model & model,
@@ -115,6 +148,36 @@ namespace se3
115
148
GeometryModel & geomModel,
116
149
const std::vector<std::string> & packageDirs = std::vector<std::string> ())
117
150
throw (std::invalid_argument);
151
+
152
+ /* *
153
+ * @brief Build The GeometryModel from a URDF file. Search for meshes
154
+ * in the directories specified by the user first and then in
155
+ * the environment variable ROS_PACKAGE_PATH
156
+ *
157
+ * @param[in] model The model of the robot, built with
158
+ * urdf::buildModel
159
+ * @param[in] filename The URDF complete (absolute) file path
160
+ * @param[in] packageDir A string containing the path to the directories of the meshes,
161
+ * typically obtained from calling se3::rosPaths().
162
+ *
163
+ * @param[in] type The type of objects that must be loaded (must be VISUAL or COLLISION)
164
+ * @param[out] geomModel Reference where to put the parsed information.
165
+ *
166
+ * @return Returns the reference on geom model for convenience.
167
+ *
168
+ * \warning If hpp-fcl has not been found during compilation, COLLISION objects can not be loaded
169
+ *
170
+ */
171
+ inline GeometryModel& buildGeom (const Model & model,
172
+ const std::string & filename,
173
+ const GeometryType type,
174
+ GeometryModel & geomModel,
175
+ const std::string & packageDir)
176
+ throw (std::invalid_argument)
177
+ {
178
+ const std::vector<std::string> dirs (1 ,packageDir);
179
+ return buildGeom (model,filename,type,geomModel,dirs);
180
+ }
118
181
119
182
/* *
120
183
* @brief Build The GeometryModel from a URDF model. Search for meshes
@@ -124,7 +187,7 @@ namespace se3
124
187
* @param[in] model The model of the robot, built with
125
188
* urdf::buildModel
126
189
* @param[in] xmlStream Stream containing the URDF model
127
- * @param[in] packageDirs A vector containing the different directories
190
+ * @param[in] packageDirs A vector containing the different directories
128
191
* where to search for models and meshes, typically
129
192
* obtained from calling se3::rosPaths()
130
193
*
@@ -133,15 +196,45 @@ namespace se3
133
196
*
134
197
* @return Returns the reference on geom model for convenience.
135
198
*
136
- * \warning If hpp-fcl has not been found during compilation, COLLISION types can not be loaded
199
+ * \warning If hpp-fcl has not been found during compilation, COLLISION objects cannot be loaded
137
200
*
138
201
*/
139
202
GeometryModel& buildGeom (const Model & model,
140
- const std::istream& xmlStream,
203
+ const std::istream & xmlStream,
141
204
const GeometryType type,
142
205
GeometryModel & geomModel,
143
206
const std::vector<std::string> & packageDirs = std::vector<std::string> ())
144
207
throw (std::invalid_argument);
208
+
209
+ /* *
210
+ * @brief Build The GeometryModel from a URDF model. Search for meshes
211
+ * in the directories specified by the user first and then in
212
+ * the environment variable ROS_PACKAGE_PATH
213
+ *
214
+ * @param[in] model The model of the robot, built with
215
+ * urdf::buildModel
216
+ * @param[in] xmlStream Stream containing the URDF model
217
+ * @param[in] packageDir A string containing the path to the directories of the meshes,
218
+ * typically obtained from calling se3::rosPaths().
219
+ *
220
+ * @param[in] type The type of objects that must be loaded (must be VISUAL or COLLISION)
221
+ * @param[out] geomModel Reference where to put the parsed information.
222
+ *
223
+ * @return Returns the reference on geom model for convenience.
224
+ *
225
+ * \warning If hpp-fcl has not been found during compilation, COLLISION objects cannot be loaded
226
+ *
227
+ */
228
+ inline GeometryModel & buildGeom (const Model & model,
229
+ const std::istream & xmlStream,
230
+ const GeometryType type,
231
+ GeometryModel & geomModel,
232
+ const std::string & packageDir)
233
+ throw (std::invalid_argument)
234
+ {
235
+ const std::vector<std::string> dirs (1 ,packageDir);
236
+ return buildGeom (model,xmlStream,type,geomModel,dirs);
237
+ }
145
238
146
239
147
240
} // namespace urdf
0 commit comments