@@ -168,23 +168,25 @@ controller manager. By default the *gz_ros2_control* plugin is very simple, thou
168168extensible via an additional plugin architecture to allow power users to create their own custom
169169robot hardware interfaces between *ros2_control * and Gazebo.
170170
171- URDF :
171+ .. tabs : :
172172
173- .. code-block :: xml
173+ .. group-tab :: URDF
174174
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
180176
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 >
182182
183- .. code-block :: xml
183+ .. group-tab :: SDF
184+
185+ .. code-block :: xml
184186
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 >
188190
189191 The *gz_ros2_control * ``<plugin> `` tag also has the following optional child elements:
190192
@@ -207,31 +209,33 @@ or via ROS parameters:
207209
208210 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:
209211
210- URDF :
212+ .. tabs : :
211213
212- .. code-block :: xml
214+ .. group-tab :: URDF
213215
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 >
216+ .. code-block :: xml
223217
224- SDF:
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 >
225227
226- .. code-block :: xml
228+ .. group-tab :: SDF
227229
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 >
230+ .. code-block :: xml
231+
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 >
235239
236240 Advanced: custom gz_ros2_control Simulation Plugins
237241-----------------------------------------------------------
@@ -241,64 +245,68 @@ The *gz_ros2_control* Gazebo plugin also provides a pluginlib-based interface to
241245These plugins must inherit the ``gz_ros2_control::GazeboSimSystemInterface ``, which implements a simulated *ros2_control *
242246``hardware_interface::SystemInterface ``. SystemInterface provides API-level access to read and command joint properties.
243247
244- The respective GazeboSimSystemInterface sub-class is specified in a URDF or SDF model and is loaded when the
245- 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:
246250
247- URDF :
251+ .. tabs : :
248252
249- .. code-block :: xml
253+ .. group-tab :: URDF
250254
251- <ros2_control name =" GazeboSimSystem" type =" system" >
252- <hardware >
253- <plugin >gz_ros2_control/GazeboSimSystem</plugin >
254- </hardware >
255- ...
256- <ros2_control >
257- <gazebo >
258- <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
259- ...
260- </plugin >
261- </gazebo >
255+ .. code-block :: xml
262256
263- 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 >
264268
265- .. code-block :: xml
269+ .. group-tab :: SDF
266270
267- <ros2_control name =" GazeboSimSystem" type =" system" >
268- <hardware >
269- <plugin >gz_ros2_control/GazeboSimSystem</plugin >
270- </hardware >
271- ...
272- <ros2_control >
273- <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
274- ...
275- </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 >
276282
277283 Set up controllers
278284-----------------------------------------------------------
279285
280286Use the tag ``<parameters> `` inside ``<plugin> `` to set the YAML file with the controller configuration
281287and use the tag ``<controller_manager_prefix_node_name> `` to set the controller manager node name.
282288
283- URDF :
289+ .. tabs : :
284290
285- .. code-block :: xml
291+ .. group-tab :: URDF
286292
287- <gazebo >
288- <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
289- <parameters >$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters >
290- <controller_manager_prefix_node_name >controller_manager</controller_manager_prefix_node_name >
291- </plugin >
292- <gazebo >
293+ .. code-block :: xml
293294
294- 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 >
295301
296- .. code-block :: xml
302+ .. group-tab :: SDF
303+
304+ .. code-block :: xml
297305
298- <plugin name =" gz_ros2_control::GazeboSimROS2ControlPlugin" filename =" libgz_ros2_control-system" >
299- <parameters >$(find gz_ros2_control_demos)/config/cart_controller.yaml</parameters >
300- <controller_manager_prefix_node_name >controller_manager</controller_manager_prefix_node_name >
301- </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 >
302310
303311 The following is a basic configuration of the controllers:
304312
0 commit comments