7.2.14. ROS 2 Navigation with Block World Generator
22.214.171.124. 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
Completed ROS2 Navigation for ROS 2 Nav2 with a single robot. So that
ROS 2 and Nav2 are installed, and ROS2 bridge is enabled.
ros2_wsis sourced (
humble_ws) so that
isaac_ros_navigation_goalare inside your workspace.
126.96.36.199. Setting up Environment and Robot
188.8.131.52.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
Load Imagebutton and open the image of the occupancy map located under
carter_navigation/maps/carter_warehouse_navigation.png. A window titled
Generate Block Worldbutton 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.
184.108.40.206.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
Drag and drop the
Nova_Carter_ROS.usdasset into the scene generated in the previous step (anywhere in the space bounded by the walls and on the ground)
220.127.116.11.3. Running Navigation
We now have the 3D scene and robot set up to run the Nav2 stack
Playin Isaac Sim to begin simulation.
Open a new terminal and source the
<ros2_ws>which contains the
carter_navigationpackage. 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.
2D Pose Estimatebutton 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 Goalbutton 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!
In this tutorial, we covered
Generating 3D world using 2D occupancy map with Block World Generator
Adding a robot into this world and running Nav2 with it
18.104.22.168.1. Next Steps
Continue on to the next tutorial in our ROS2 Tutorials series, ROS 2 Custom C++ OmniGraph Node.