Skip to content

Commit 4e60b79

Browse files
luca-della-vedovaSteveMacenski
authored andcommitted
Add note on multirobot refactor to migration guide (ros-navigation#609)
* Add note on multirobot refactor to migration guide Signed-off-by: Luca Della Vedova <[email protected]> * Add example for configuration of sensor topic Signed-off-by: Luca Della Vedova <[email protected]> * Add notes to topic configuration guides Signed-off-by: Luca Della Vedova <[email protected]> * Fix formatting Signed-off-by: Luca Della Vedova <[email protected]> * Remove use_namespace parameter Signed-off-by: Luca Della Vedova <[email protected]> * Remove map_topic parameter and add migration note Signed-off-by: Luca Della Vedova <[email protected]> * Update Jazzy.rst Signed-off-by: Steve Macenski <[email protected]> * Add migration note on Costmap2DROS constructors Signed-off-by: Luca Della Vedova <[email protected]> * Change all literals to double backtick Signed-off-by: Luca Della Vedova <[email protected]> * Grammar Signed-off-by: Luca Della Vedova <[email protected]> * Update default value / remove reference to global param Signed-off-by: Luca Della Vedova <[email protected]> --------- Signed-off-by: Luca Della Vedova <[email protected]> Signed-off-by: Steve Macenski <[email protected]> Co-authored-by: Steve Macenski <[email protected]>
1 parent 18285dd commit 4e60b79

File tree

7 files changed

+102
-16
lines changed

7 files changed

+102
-16
lines changed

configuration/packages/configuring-costmaps.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,6 @@ Costmap2D ROS Parameters
9090
Description
9191
Minimum cost of an occupancy grid map to be considered a lethal obstacle.
9292

93-
:map_topic:
94-
95-
============== =======
96-
Type Default
97-
-------------- -------
98-
string "map"
99-
============== =======
100-
101-
Description
102-
Topic of map from map_server or SLAM.
103-
10493
:map_vis_z:
10594

10695
============== =======

configuration/packages/costmap-plugins/obstacle.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ This costmap layer implements a plugin that uses 2D raycasting for 2D lidars, de
8686
Description
8787
Topic of data.
8888

89+
Relative topics will be relative to the node's parent namespace.
90+
For example, if you specify `topic: scan` in the `obstacle_layer` of a `local_costmap` and you launch your bringup with a `tb4` namespace:
91+
92+
* User chosen namespace is `tb4`.
93+
* User chosen topic is `scan`.
94+
* Topic will be remapped to `/tb4/scan` without `local_costmap`.
95+
* Use global topic `/scan` if you do not wish the node namespace to apply.
96+
8997
:``<obstacle layer>``. ``<data source>``.sensor_frame:
9098

9199
====== =======

configuration/packages/costmap-plugins/range.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ This costmap layer implements a plugin that processes sonar, IR, or other 1-D se
2929
Description
3030
Range topics to subscribe to.
3131

32+
Relative topics will be relative to the node's parent namespace.
33+
For example, if you specify `topics: [range1, /range2]` in the `range_layer` of a `local_costmap` and you launch your bringup with a `tb4` namespace:
34+
35+
* User chosen namespace is `tb4`.
36+
* User chosen topics are [`range1`, `/range2`].
37+
* Topic will be remapped to `/tb4/range1`, without `local_costmap`, and `/range2`.
38+
* Use global topics such as `/range2` if you do not wish the node namespace to apply.
39+
3240
:``<range layer>``.phi:
3341

3442
====== =======

configuration/packages/costmap-plugins/static.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,16 @@ This implements a costmap layer taking in a map from either SLAM or ``map_server
6767
====== =======
6868
Type Default
6969
------ -------
70-
string ""
70+
string "map"
7171
====== =======
7272

7373
Description
74-
Map topic to subscribe to. If left empty the map topic will default to the global `map_topic` parameter in `costmap_2d_ros`.
74+
Map topic to subscribe to.
75+
76+
Relative topics will be relative to the node's parent namespace.
77+
For example, if you specify `map_topic: map` in the `static_layer` of a `global_costmap` and you launch your bringup with a `tb4` namespace:
78+
79+
* User chosen namespace is `tb4`.
80+
* User chosen topic is `map`.
81+
* Topic will be remapped to `/tb4/map` without `global_costmap`.
82+
* Use global topic `/map` if you do not wish the node namespace to apply.

configuration/packages/costmap-plugins/voxel.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ This costmap layer implements a plugin that uses 3D raycasting for depth, 3D, or
151151
Description
152152
Topic of data.
153153

154+
Relative topics will be relative to the node's parent namespace.
155+
For example, if you specify `topic: scan` in the `voxel_layer` of a `local_costmap` and you launch your bringup with a `tb4` namespace:
156+
157+
* User chosen namespace is `tb4`.
158+
* User chosen topic is `scan`.
159+
* Topic will be remapped to `/tb4/scan` without `local_costmap`.
160+
* Use global topic `/scan` if you do not wish the node namespace to apply.
161+
154162
:``<voxel layer>``. ``<data source>``.sensor_frame:
155163

156164
====== =======

migration/Jazzy.rst

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,70 @@ In `PR #4752 <https://github.com/ros-navigation/navigation2/pull/4752>`_ an opti
108108

109109
Default value:
110110

111-
- true
111+
- true
112+
113+
Revamped multirobot bringup and config files to use namespaces
114+
**************************************************************
115+
116+
In `PR #4715 <https://github.com/ros-navigation/navigation2/pull/4715>`_ multirobot bringup and the use of namespaces were overhauled to be compatible out of the box with ROS namespaces and remove custom logic, specifically:
117+
118+
* The ``use_namespace`` parameter has been removed from ``nav2_bringup`` launch files. The ``namespace`` parameter will now always be used and default to ``/`` for "global namespace".
119+
* There is now a single rviz config file for both normal and namespaced robots. Topics have been changed to a relative path (i.e. ``/map`` -> ``map``) and the rviz ``namespace`` will be added automatically.
120+
* There is now a single ``nav2_params.yaml`` config file for both single and multirobot bringup. All the topics have been changed to relative (i.e. ``/scan`` -> ``scan``).
121+
122+
Note that some plugins / nodes might have their own local namespace. This is the case for ``CostmapLayer`` which will be in a ``/ns/[layer_name]`` namespace. For these, a new function ``joinWithParentNamespace`` has been added to make sure joining relative paths results in ``/ns/topic_name`` rather than ``/ns/[layer_name]/topic_name``.
123+
124+
If your use case doesn't require multiple robots, keeping absolute paths in your ``nav2_params.yaml`` config file and rviz config file will preserve existing behavior.
125+
126+
For example, if you specify ``topic: scan`` in the ``voxel_layer`` of a ``local_costmap`` and you launch your bringup with a ``tb4`` namespace:
127+
128+
* User chosen namespace is ``tb4``.
129+
* User chosen topic is ``scan``.
130+
* Topic will be remapped to ``/tb4/scan`` without ``local_costmap``.
131+
* Use global topic ``/scan`` if you do not wish the node namespace to apply
132+
133+
Removed global map_topic from Costmap node
134+
******************************************
135+
136+
In `PR #4715 <https://github.com/ros-navigation/navigation2/pull/4715>`_ the global ``map_topic`` parameter has been removed from the ``Costmap2DROS`` node. This parameterwas only used in the ``StaticLayer`` and should be defined as a parameter local to the ``StaticLayer`` instead, for example:
137+
138+
.. code-block:: yaml
139+
140+
global_costmap:
141+
global_costmap:
142+
ros__parameters:
143+
[...]
144+
# Not supported anymore
145+
map_topic: my_map
146+
static_layer:
147+
plugin: "nav2_costmap_2d::StaticLayer"
148+
map_subscribe_transient_local: True
149+
# Do this instead
150+
map_topic: my_map
151+
152+
Simplified Costmap2DROS constructors
153+
************************************
154+
155+
The following constructors for ``Costmap2DROS`` have been removed:
156+
157+
.. code-block:: cpp
158+
159+
explicit Costmap2DROS(
160+
const std::string & name,
161+
const std::string & parent_namespace,
162+
const std::string & local_namespace,
163+
const bool & use_sim_time);
164+
165+
explicit Costmap2DROS(const std::string & name, const bool & use_sim_time = false);
166+
167+
They have been consolidated into a single one:
168+
169+
.. code-block:: cpp
170+
171+
explicit Costmap2DROS(
172+
const std::string & name,
173+
const std::string & parent_namespace = "/",
174+
const bool & use_sim_time = false);
175+
176+
The ``local_namespace`` parameter has been removed and is now automatically set to the node's name (which is what the second removed constructor did).
177+
Parameters ``parent_namespace`` / ``use_sim_time`` both provide default values to maintain the ability of creating a ``Costmap2DROS`` object by just specifying a name.

tuning/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ Within ``nav2_bringup``, there is a main entryfile ``tb3_simulation_launch.py``.
162162
- ``use_robot_state_pub`` : Whether or not to start the robot state publisher to publish the robot's URDF transformations to TF2. Defaults to ``true`` to publish the robot's TF2 transformations.
163163
- ``use_rviz`` : Whether or not to launch rviz for visualization. Defaults to ``true`` to show rviz.
164164
- ``headless`` : Whether or not to launch the Gazebo front-end alongside the background Gazebo simulation. Defaults to ``true`` to display the Gazebo window.
165-
- ``namespace`` : The namespace to launch robots into, if need be.
166-
- ``use_namespace`` : Whether or not to launch robots into this namespace. Default ``false`` and uses global namespace for single robot.
165+
- ``namespace`` : The namespace to launch robots into.
167166
- ``robot_name`` : The name of the robot to launch.
168167
- ``robot_sdf`` : The filepath to the robot's gazebo configuration file containing the Gazebo plugins and setup to simulate the robot system.
169168
- ``x_pose``, ``y_pose``, ``z_pose``, ``roll``, ``pitch``, ``yaw`` : Parameters to set the initial position of the robot in the simulation.

0 commit comments

Comments
 (0)