## 5.1. Learning Objectives¶

In this ROS2 sample, we are demonstrating Omniverse Isaac Sim integrated with ROS2 Nav2.

## 5.2. Getting Started¶

Prerequisite

• This ROS2 Navigation sample is only supported on ROS2 Foxy Fitzroy or later. See the ROS2 website for requirements and installation instructions: https://docs.ros.org/en/foxy/Releases/Release-Foxy-Fitzroy.html

• The Nav2 project is required to run this sample. To install Nav2 refer to the Nav2 installation page.

• Enabled the omni.isaac.ros2_bridge extension from the extension manager menu Window->Extensions.

• This tutorial requires carter_navigation, carter_description, and isaac_ros_navigation_goal ROS2 packages which are provided as part of your Omniverse Isaac Sim download. These ROS2 packages are located under the directory ros2_workspace/src/navigation/. They contain the required launch file, navigation parameters, and robot model. Complete ROS & ROS 2 Installation, make sure the ROS2 workspace environment is setup correctly.

## 5.4. Running Nav2¶

1. Go to Isaac Examples -> ROS -> Navigation to load the warehouse scenario.

2. Click on Play to begin simulation.

3. In a new terminal, run the ROS2 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.

4. Load the the URDF model into the RViz2 window by clicking on RobotModel -> Description File and navigate to the location of the Carter URDF model which can be found at the urdf directory in the sample carter_description ROS2 package (carter_description/urdf/carter.urdf).

1. Since the position of the robot is defined in the parameter file carter_navigation_params.yaml, the robot should already be properly localized. If required, the 2D Pose Estimate button can be used to re-set the position of the robot.

2. 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!

## 5.5. Sending Goals Programmatically¶

The isaac_ros_navigation_goal ROS2 package can be used to set goal poses for the robot using a python node. It is able to randomly generate and send goal poses to Nav2. It is also able to send user-defined goal poses if needed.

1. Make any changes to the parameters defined in the launch file found under isaac_ros_navigation_goal/launch as required. Make sure to re-build and source the package/workspace after modifying its contents.

The parameters are described below:

• goal_generator_type: Type of the goal generator. Use RandomGoalGenerator to randomly generate goals or use GoalReader for sending user-defined goals in a specific order.

• map_yaml_path: The path to the occupancy map parameters yaml file. Example file is present at isaac_ros_navigation_goal/assets/carter_warehouse_navigation.yaml. The map image is being used to identify the obstacles in the vicinity of a generated pose. Required if goal generator type is set as RandomGoalGenerator.

• iteration_count: Number of times goal is to be set.

• action_server_name: Name of the action server.

• obstacle_search_distance_in_meters: Distance in meters in which there should not be any obstacle of a generated pose.

• goal_text_file_path: The path to the text file which contains user-defined static goals. Each line in the file has a single goal pose in the following format: pose.x pose.y orientation.x orientation.y orientation.z orientation.w. Sample file is present at: isaac_ros_navigation_goal/assets/goals.txt. Required if goal generator type is set as GoalReader.

• initial_pose: If initial_pose is set, it will be published to /initialpose topic and goal poses will be sent to action server after that. Format is [pose.x, pose.y, pose.z, orientation.x, orientation.y, orientation.z, orientation.w].

2. To run the launch file, use the following command:

ros2 launch isaac_ros_navigation_goal isaac_ros_navigation_goal.launch.py


Note

The package will stop processing (setting goals) once any of the below conditions are met:

1. Number of goals published till now >= iteration_count.

2. If GoalReader is being used then if all the goals from file are published, or if condition (1) is true.

3. A goal is rejected by the action server.

4. In case of RandomGoalGenerator, if a goal was not generated even after running the maximum number of iterations, which is rare but could happen in very dense maps.

## 5.6. Summary¶

In this tutorial, we covered

1. Occupancy map

2. Running Isaac Sim with Nav2.

3. Running the Isaac ROS2 Navigation Goal package to send nav goals programmatically.

### 5.6.1. Next Steps¶

Continue on to the next tutorial in our ROS2 Tutorials series, Multiple Robot ROS2 Navigation to move multiple navigating robots with ROS2.