7. Multiple Robot ROS Navigation¶
7.1. Learning Objectives¶
In this ROS sample, we are demonstrating Omniverse Isaac Sim integrated with the ROS Navigation stack to perform simultaneous multiple robot navigation.
7.2. Getting Started¶
Prerequisite
The ROS Navigation stack is required to run this sample. Install the ROS Navigation stack:
sudo apt-get install ros-$ROS_DISTRO-navigation
This tutorial requires
carter_2dnav
package andcarter_description
package provided as part of your Omniverse Isaac Sim download. Both packages are located under the directoryros_workspace/src/navigation/
. They contain the required launch file, navigation parameters, and robot model. Complete ROS & ROS2 Installation, make sure ROS environment is setup correctly and those packages are inside your ROS_PACKAGE_PATH.Completed ROS Navigation tutorial for a single robot.
Roscore is running before running Omniverse Isaac Sim.
7.3. Multiple Robot ROS Navigation Setup¶
For operating multiple robots in the same environment, namespaces are utilized. This modifies the rostopic and rosnode names as well as frame ID’s for different ROS packages, allowing for multiple instances of the same ROS node to run simultaneously.
To publish and receive ROS messages under namespaces in Omniverse Isaac Sim, the rosNodePrefix parameter found under each ROS component prim has been set to the corresponding robot names. The multiple_robot_carter_navigation.launch
file found in the sample carter_2dnav
ROS package is also configured with the same robot namespaces.
7.3.1. Hospital Environment Setup:¶
In this scenario, an occupancy map is required. For this sample, we are generating the map of both the Hospital and Office environments using the Occupancy Map Generator extension within Omniverse Isaac Sim.
Go to Create -> Isaac -> Environments -> Hospital.
At the upper left corner of the viewport, click on Perspective. Select Top from the dropdown menu. Adjust the camera view as needed.
Next, go to Isaac Utils -> Occupancy Map.
In the Occupancy Map extension, ensure the Origin is set to
X: 0.0, Y: 0.0, Z: 0.0
. For the lower bound, setZ: 10.0
. For the Upper Bound, setZ: 62.0
. Keep in mind, the upper bound Z distance has been set to 62.0 cm to match the vertical distance of the lidar onboard Carter with respect to the ground.
5. Select the Hospital prim in the stage. In the Occupancy Map extension, click on BOUND SELECTION
.
The bounds of the occupancy map should be updated to incorporate the selected Hospital prim.
The map parameters should now look similar to the following image:
A perimeter will be generated and it should resemble this image (Top View):
7.3.2. Office Environment Setup:¶
Go to Create -> Isaac -> Environments -> Office.
At the upper left corner of the viewport, click on Perspective. Select Top from the dropdown menu. Adjust the camera view as needed.
Next, go to Isaac Utils -> Occupancy Map. In the Occupancy Map extension, set the map parameters to be similar to the following image:
Keep in mind, the upper bound Z distance has been set to 62.0 cm to match the vertical distance of the lidar onboard Carter with respect to the ground.
A perimeter will be generated and it should resemble this image (Top View):
Once the setup for either environments is complete, click on
CALCULATE
followed byVISUALIZE IMAGE
. A Visualization popup will appear.For rotation, select 180 degrees and for Coordinate Type select
ROS Occupancy Map Parameters File (YAML)
. ClickRE-GENERATE IMAGE
. Occupancy map parameters formatted to YAML will appear in the field below. Change the image name to your preference. Copy the full text.
6. Create a YAML file for the occupancy map parameters called carter_hospital_navigation.yaml
and place it in the map directory which
is located in the sample carter_2dnav
ROS package (carter_2dnav/map/carter_hospital_navigation.yaml
).
Insert the previously copied text in the
carter_hospital_navigation.yaml
file.
Note
For the office environment, follow the previous steps however create a YAML file called carter_office_navigation.yaml
instead.
Back in the visualization tab in Omniverse Isaac Sim, click
Save Image
. Set the same image name as in the map parameters and choose to save in the same directory as the map parameters file.
The final saved image of the Hospital environment will look like the following:
The final saved image of the Office environment will look like the following:
If not done so already, click
Stop
to terminate the simulation.
An occupancy map is now ready to be used with Multiple Robot ROS Navigation!
7.4. Running Multiple Robot ROS Navigation¶
Load scenario:
For hospital environment, go to Isaac Examples -> ROS -> Multi Robot Navigation -> Hospital.
For the Office scenario, go to Isaac Examples -> ROS -> Multi Robot Navigation -> Office.
Click on
Play
to begin simulation.In a new terminal, run the ROS launch file and set the env_name parameter to either hospital or office to begin Multiple Robot Navigation with the desired environment.
roslaunch carter_2dnav multiple_robot_carter_navigation.launch env_name:=hospital
OR
roslaunch carter_2dnav multiple_robot_carter_navigation.launch env_name:=office
Rviz will open and begin loading urdf models of three NVIDIA Carter robots, the global occupancy map, as well as the local costmaps of each robot.
To verify that all of the transforms are broadcasting, run the following command in a new terminal to visualize the ROS TF frame tree:
rosrun rqt_tf_tree rqt_tf_tree
The generated graph should look similar to the one shown below.
Since the positions of each robot is defined in multiple_robot_carter_navigation.launch
, the robots should already be properly localized.
In Rviz, click on Tool Properties -> 2D Nav Goal -> Topic, and set the topic namespace to either
/carter1
,/carter2
or/carter3
corresponding to specific robot you wish to set the navigation goal for.Next, click on the
2D Nav Goal
button and then click and drag at the desired location point in the map. The ROS Navigation stack will now generate a trajectory and the specified robot will start moving towards its destination! Repeat this process for every other robot.
7.5. Summary¶
In this tutorial, we covered running multiple robots with the ROS navigation stack.
7.5.1. Next Steps¶
Go to the next tutorial Joint Control: Extension Python Scripting to learn how to move a manipulator using direct joint control.
7.5.2. Further Learning¶
To learn more about ROS Navigation refer to the ROS website: http://wiki.ros.org/navigation
ROS name conventions refer to the website: http://wiki.ros.org/Names.
Standalone python scripting version: Multiple Robot ROS Navigation. With this approach you have the ability to manually control the timestep and rate at which ROS components are published.