7.2.14. ROS 2 Navigation with Block World Generator

7.2.14.1. Learning Objectives

In this example, we will learn how to

  • Generate a 3D world using a 2D occupancy map

  • Perform navigation with a robot in the generated 3D world with Nav2

Prerequisite

  • Completed ROS2 Navigation for ROS 2 Nav2 with a single robot. So that

    • ROS 2 and Nav2 are installed, and ROS2 bridge is enabled.

    • Appropriate ros2_ws is sourced (foxy_ws or humble_ws) so that carter_navigation and isaac_ros_navigation_goal are inside your workspace.

7.2.14.2. Setting up Environment and Robot

7.2.14.2.1. Generate 3D World

First, let us load generate the 3D world using the Block World Generator within Isaac Sim

  • Go to the top menu bar and click Isaac Utils -> Block World Generator Map

  • Press Load Image button and open the image of the occupancy map located under carter_navigation/maps/carter_warehouse_navigation.png. A window titled Visualization will appear.

  • Press the Generate Block World button to create geometry corresponding to the input occupancy map in the Stage.

The generated 3D world automatically has a collision mesh applied for all the occupied pixels.

7.2.14.2.2. Add Robot in Scene

Next, we will add a Carter robot which has all ROS 2 OmniGraph Nodes setup into this scene.

  • At the bottom of the Isaac Sim window, navigate to the Content tab.

  • Go to localhost followed by NVIDIA/Assets/Isaac/2023.1.1/Isaac/Samples/ROS2/Robots folder.

  • Drag and drop the Nova_Carter_ROS.usd asset into the scene generated in the previous step (anywhere in the space bounded by the walls and on the ground)

7.2.14.2.3. Running Navigation

We now have the 3D scene and robot set up to run the Nav2 stack

  • Click on Play in Isaac Sim to begin simulation.

  • Open a new terminal and source the <ros2_ws> which contains the carter_navigation package. Run the ROS 2 launch file to begin Nav2

    ros2 launch carter_navigation carter_navigation.launch.py
    

    RViz2 will open and begin loading the occupancy map. If a map does not appear, repeat the previous step.

  • Use the 2D Pose Estimate button to re-set the position of the robot. (Make sure you do this before setting a goal and the pose estimate is approximately correct).

  • Click on the Navigation2 Goal button and then click and drag at the desired location point in the map. Nav2 will now generate a trajectory and the robot will start moving towards its destination!

7.2.14.3. Summary

In this tutorial, we covered

  1. Generating 3D world using 2D occupancy map with Block World Generator

  2. Adding a robot into this world and running Nav2 with it

7.2.14.3.1. Next Steps

Continue on to the next tutorial in our ROS2 Tutorials series, ROS 2 Custom C++ OmniGraph Node.