diff --git a/doc/index.rst b/doc/index.rst index daff5f2c..000c6f36 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -218,6 +218,38 @@ The following is a basic configuration of the controllers: .. literalinclude:: ../gazebo_ros2_control_demos/config/cart_controller.yaml :language: yaml + +Multiple Namespaces +----------------------------------------------------------- +The gazebo_ros2_control plugin can be launched in multiple namespaces. This is useful if it is desired to have multiple robots of the same description running at the same time. +If the namespace is to be defined in the URDF file, then you can use the ```` tag as detailed below: + +.. code-block:: xml + + + + $(arg control_yaml) + + r1 + /tf:=tf + /tf_static:=tf_static + diffdrive_controller/odom:=odom + + + + +Where ``r1`` is the namespace that the plugin nodes will be run in. Please note that the remapping of ``/tf`` and ``/tf_static`` is recommended only if you want to have a separate TF buffer for each namespace, e.g ``/r1/tf`` + +A second method for launching in namespaces is by using the Gazebo ``spawn_entity.py`` tool and setting the ``-robot_namespace`` parameter to the script: + +.. code-block:: bash + + ros2 run gazebo_ros spawn_entity.py -entity robot_1 -robot_namespace r1 -topic robot_description + +The script calls the ``spawn_entity`` service to spawn an entity named ``robot_1`` in the namespace ``r1``. It is assumed that a robot description is being published by a ``robot_state_publisher`` node on the topic ``robot_description``, this will also be used for the ``gazebo_ros2_control`` plugin. + +The ``spawn_entity.py`` script will rewrite the robot description to include a namespace for every plugin tag. Please note that this method will apply a namespace to every plugin in the robot description. It will also overwrite any existing namespaces set in the description file. + gazebo_ros2_control_demos ==========================================