@@ -168,23 +168,25 @@ controller manager. By default the *gz_ros2_control* plugin is very simple, thou
168
168
extensible via an additional plugin architecture to allow power users to create their own custom
169
169
robot hardware interfaces between *ros2_control * and Gazebo.
170
170
171
- URDF :
171
+ .. tabs : :
172
172
173
- .. code-block :: xml
173
+ .. group-tab :: URDF
174
174
175
- <gazebo >
176
- <plugin filename =" libgz_ros2_control-system.so" name =" gz_ros2_control::GazeboSimROS2ControlPlugin" >
177
- <parameters >$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters >
178
- </plugin >
179
- </gazebo >
175
+ .. code-block :: xml
180
176
181
- SDF:
177
+ <gazebo >
178
+ <plugin filename =" libgz_ros2_control-system.so" name =" gz_ros2_control::GazeboSimROS2ControlPlugin" >
179
+ <parameters >$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters >
180
+ </plugin >
181
+ </gazebo >
182
182
183
- .. code-block :: xml
183
+ .. group-tab :: SDF
184
+
185
+ .. code-block :: xml
184
186
185
- <plugin filename =" libgz_ros2_control-system.so" name =" gz_ros2_control::GazeboSimROS2ControlPlugin" >
186
- <parameters >$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters >
187
- </plugin >
187
+ <plugin filename =" libgz_ros2_control-system.so" name =" gz_ros2_control::GazeboSimROS2ControlPlugin" >
188
+ <parameters >$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters >
189
+ </plugin >
188
190
189
191
The *gz_ros2_control * ``<plugin> `` tag also has the following optional child elements:
190
192
@@ -207,42 +209,33 @@ or via ROS parameters:
207
209
208
210
Additionally, one can specify a namespace and remapping rules, which will be forwarded to the controller_manager and loaded controllers. Add the following ``<ros> `` section:
209
211
210
- URDF:
211
-
212
- .. code-block :: xml
213
-
214
- <gazebo >
215
- <plugin filename =" libgz_ros2_control-system.so" name =" gz_ros2_control::GazeboSimROS2ControlPlugin" >
216
- ...
217
- <ros >
218
- <namespace >my_namespace</namespace >
219
- <remapping >/robot_description:=/robot_description_full</remapping >
220
- </ros >
221
- </plugin >
222
- </gazebo >
212
+ .. tabs ::
223
213
224
- SDF:
214
+ .. group-tab :: URDF
225
215
226
- .. code-block :: xml
227
-
228
- <plugin filename =" libgz_ros2_control-system.so" name =" gz_ros2_control::GazeboSimROS2ControlPlugin" >
229
- ...
230
- <ros >
231
- <namespace >my_namespace</namespace >
232
- <remapping >/robot_description:=/robot_description_full</remapping >
233
- </ros >
234
- </plugin >
216
+ .. code-block :: xml
235
217
236
- Default gz_ros2_control Behavior
237
- -----------------------------------------------------------
218
+ <gazebo >
219
+ <plugin filename =" libgz_ros2_control-system.so" name =" gz_ros2_control::GazeboSimROS2ControlPlugin" >
220
+ ...
221
+ <ros >
222
+ <namespace >my_namespace</namespace >
223
+ <remapping >/robot_description:=/robot_description_full</remapping >
224
+ </ros >
225
+ </plugin >
226
+ </gazebo >
238
227
239
- By default, without a `` <plugin> `` tag, * gz_ros2_control * will attempt to get all of the information it needs to interface with a ros2_control-based controller out of the URDF or SDF. This is sufficient for most cases, and good for at least getting started.
228
+ .. group-tab :: SDF
240
229
241
- The default behavior provides the following ros2_control interfaces:
230
+ .. code-block :: xml
242
231
243
- * hardware_interface::JointStateInterface
244
- * hardware_interface::EffortJointInterface
245
- * hardware_interface::VelocityJointInterface
232
+ <plugin filename =" libgz_ros2_control-system.so" name =" gz_ros2_control::GazeboSimROS2ControlPlugin" >
233
+ ...
234
+ <ros >
235
+ <namespace >my_namespace</namespace >
236
+ <remapping >/robot_description:=/robot_description_full</remapping >
237
+ </ros >
238
+ </plugin >
246
239
247
240
Advanced: custom gz_ros2_control Simulation Plugins
248
241
-----------------------------------------------------------
@@ -252,64 +245,68 @@ The *gz_ros2_control* Gazebo plugin also provides a pluginlib-based interface to
252
245
These plugins must inherit the ``gz_ros2_control::GazeboSimSystemInterface ``, which implements a simulated *ros2_control *
253
246
``hardware_interface::SystemInterface ``. SystemInterface provides API-level access to read and command joint properties.
254
247
255
- The respective GazeboSimSystemInterface sub-class is specified in a URDF or SDF model and is loaded when the
256
- robot model is loaded. For example, the following XML will load the default plugin:
248
+ The respective GazeboSimSystemInterface is specified in a URDF or SDF model and is loaded when the
249
+ robot model is loaded. For example, the following XML will load a custom plugin:
257
250
258
- URDF :
251
+ .. tabs : :
259
252
260
- .. code-block :: xml
253
+ .. group-tab :: URDF
261
254
262
- <ros2_control name =" GazeboSimSystem" type =" system" >
263
- <hardware >
264
- <plugin >gz_ros2_control/GazeboSimSystem</plugin >
265
- </hardware >
266
- ...
267
- <ros2_control >
268
- <gazebo >
269
- <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
270
- ...
271
- </plugin >
272
- </gazebo >
255
+ .. code-block :: xml
273
256
274
- SDF:
257
+ <ros2_control name =" GazeboSimSystem" type =" system" >
258
+ <hardware >
259
+ <plugin >gz_ros2_control_demos/GazeboCustomSimSystem</plugin >
260
+ </hardware >
261
+ ...
262
+ <ros2_control >
263
+ <gazebo >
264
+ <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
265
+ ...
266
+ </plugin >
267
+ </gazebo >
275
268
276
- .. code-block :: xml
269
+ .. group-tab :: SDF
277
270
278
- <ros2_control name =" GazeboSimSystem" type =" system" >
279
- <hardware >
280
- <plugin >gz_ros2_control/GazeboSimSystem</plugin >
281
- </hardware >
282
- ...
283
- <ros2_control >
284
- <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
285
- ...
286
- </plugin >
271
+ .. code-block :: xml
272
+
273
+ <ros2_control name =" GazeboSimSystem" type =" system" >
274
+ <hardware >
275
+ <plugin >gz_ros2_control_demos/GazeboCustomSimSystem</plugin >
276
+ </hardware >
277
+ ...
278
+ <ros2_control >
279
+ <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
280
+ ...
281
+ </plugin >
287
282
288
283
Set up controllers
289
284
-----------------------------------------------------------
290
285
291
286
Use the tag ``<parameters> `` inside ``<plugin> `` to set the YAML file with the controller configuration
292
287
and use the tag ``<controller_manager_prefix_node_name> `` to set the controller manager node name.
293
288
294
- URDF :
289
+ .. tabs : :
295
290
296
- .. code-block :: xml
291
+ .. group-tab :: URDF
297
292
298
- <gazebo >
299
- <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
300
- <parameters >$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters >
301
- <controller_manager_prefix_node_name >controller_manager</controller_manager_prefix_node_name >
302
- </plugin >
303
- <gazebo >
293
+ .. code-block :: xml
304
294
305
- SDF:
295
+ <gazebo >
296
+ <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
297
+ <parameters >$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters >
298
+ <controller_manager_prefix_node_name >controller_manager</controller_manager_prefix_node_name >
299
+ </plugin >
300
+ <gazebo >
306
301
307
- .. code-block :: xml
302
+ .. group-tab :: SDF
303
+
304
+ .. code-block :: xml
308
305
309
- <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
310
- <parameters >$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters >
311
- <controller_manager_prefix_node_name >controller_manager</controller_manager_prefix_node_name >
312
- </plugin >
306
+ <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
307
+ <parameters >$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters >
308
+ <controller_manager_prefix_node_name >controller_manager</controller_manager_prefix_node_name >
309
+ </plugin >
313
310
314
311
The following is a basic configuration of the controllers:
315
312
0 commit comments