diff --git a/doc/index.rst b/doc/index.rst index b8401f8f..350ab4ba 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -61,13 +61,13 @@ To run the demo ros2 run gz_ros2_control_demos example_position -Add ros2_control tag to a URDF +Add ros2_control tag to a URDF or SDF ========================================== Simple setup ----------------------------------------------------------- -To use *ros2_control* with your robot, you need to add some additional elements to your URDF. +To use *ros2_control* with your robot, you need to add some additional elements to your URDF or SDF. You should include the tag ```` to access and control the robot interfaces. We should include: @@ -96,7 +96,7 @@ include: Using mimic joints in simulation ----------------------------------------------------------- -To use ``mimic`` joints in *gz_ros2_control* you should define its parameters in your URDF, i.e, set the ```` tag to the mimicked joint (see the `URDF specification `__) +To use ``mimic`` joints in *gz_ros2_control* you should define its parameters in your URDF or SDF, i.e, set the ```` tag to the mimicked joint (see the `URDF specification `__ or the `SDF specification `__) .. code-block:: xml @@ -122,12 +122,13 @@ The mimic joint must not have command interfaces configured in the `` @@ -135,13 +136,19 @@ robot hardware interfaces between *ros2_control* and Gazebo. $(find gz_ros2_control_demos)/config/cart_controller.yaml +SDF: +.. code-block:: xml + + + $(find gz_ros2_control_demos)/config/cart_controller.yaml + The *gz_ros2_control* ```` tag also has the following optional child elements: * ````: A YAML file with the configuration of the controllers. This element can be given multiple times to load multiple files. * ````: Set controller manager name (default: ``controller_manager``) -The following additional parameters can be set via child elements in the URDF or via ROS parameters in the YAML file above: +The following additional parameters can be set via child elements in the URDF/SDF or via ROS parameters in the YAML file above: * ````: if set to true (default), it will hold the joints' position if their interface was not claimed, e.g., the controller hasn't been activated yet. * ````: Set the proportional gain. (default: 0.1) This determines the setpoint for a position-controlled joint ``joint_velocity = joint_position_error * position_proportional_gain``. @@ -157,6 +164,7 @@ or via ROS parameters: Additionally, one can specify a namespace and remapping rules, which will be forwarded to the controller_manager and loaded controllers. Add the following ```` section: +URDF: .. code-block:: xml @@ -168,11 +176,21 @@ Additionally, one can specify a namespace and remapping rules, which will be for +SDF: +.. code-block:: xml + + + ... + + my_namespace + /robot_description:=/robot_description_full + + Default gz_ros2_control Behavior ----------------------------------------------------------- -By default, without a ```` 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. This is sufficient for most cases, and good for at least getting started. +By default, without a ```` 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. The default behavior provides the following ros2_control interfaces: @@ -188,9 +206,10 @@ The *gz_ros2_control* Gazebo plugin also provides a pluginlib-based interface to These plugins must inherit the ``gz_ros2_control::GazeboSimSystemInterface``, which implements a simulated *ros2_control* ``hardware_interface::SystemInterface``. SystemInterface provides API-level access to read and command joint properties. -The respective GazeboSimSystemInterface sub-class is specified in a URDF model and is loaded when the +The respective GazeboSimSystemInterface sub-class is specified in a URDF or SDF model and is loaded when the robot model is loaded. For example, the following XML will load the default plugin: +URDF: .. code-block:: xml @@ -204,6 +223,18 @@ robot model is loaded. For example, the following XML will load the default plug ... +SDF: +.. code-block:: xml + + + + gz_ros2_control/GazeboSimSystem + + ... + + + ... + Set up controllers ----------------------------------------------------------- @@ -211,6 +242,7 @@ Set up controllers Use the tag ```` inside ```` to set the YAML file with the controller configuration and use the tag ```` to set the controller manager node name. +URDF: .. code-block:: xml @@ -219,6 +251,13 @@ and use the tag ```` to set the controller controller_manager +SDF: +.. code-block:: xml + + + $(find gz_ros2_control_demos)/config/cart_controller.yaml + controller_manager + The following is a basic configuration of the controllers: @@ -233,6 +272,10 @@ gz_ros2_control_demos ========================================== There are some examples in the *gz_ros2_control_demos* package. +To specify whether to use URDF or SDF, you can launch the demo in the following way (the default is URDF): +.. code-block:: shell + + ros2 launch gz_ros2_control_demos ....launch.py description_format:=sdf Cart on rail -----------------------------------------------------------