This example demonstrates how you can use the X-Mobility TensorRT engine
to run navigation inside Isaac Sim using the ROS2 bridge and the x_mobility_navigator
ROS2 package.
- A Ubuntu 22.04 machine with recommended Isaac Sim System Requirements
We will install Isaac Sim 4.2, ROS2 Humble, and NVIDIA TensorRT on your machine. You may be able to skip some steps if these are already provided.
- Follow the instructions here to install Isaac Sim 4.2 on your workstation.
- Follow the instructions here to install ROS2 Humble from debian packages.
- For convenience, add the text
source /opt/ros/humble/setup.bash
to the end of your~/.bashrc
file.
-
Install NVIDIA TensorRT following the guides here.
-
Test the installation by calling
python3 -c "import tensorrt"
-
Install PyCUDA
pip3 install pycuda
-
Create the ros2 workspace folder
mkdir -p ~/ros2_ws/src
-
Create a symlink to the x_mobility_navigator ROS2 package in this repository.
ln -s <repo root>/ros2_deployment/x_mobility_navigator ~/ros2_ws/src/x_mobility_navigator
-
Build the ROS2 workspace
cd ~/ros2_ws
and
colcon build --symlink-install
-
Export the ONNX file as detailed in the main README.
-
Build the TensorRT engine
python3 trt_conversion.py -o <onnx_file_path> -t <trt_file_path>
-
Copy the TensorRT engine to
/tmp/x_mobility.engine
. The x_mobility_navigator launch file uses this path by default.
Now you have everything needed to run the x_mobility_navigator
package.
But we'll return to this step later, first we need to enable ROS2 with Isaac Sim.
-
Install the extra ROS2 message packages
sudo apt install ros-humble-vision-msgs ros-humble-ackermann-msgs
-
Create a file named
~/.ros/fastdds.xml
and add the following file contents<?xml version="1.0" encoding="UTF-8" ?> <license>Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved. NVIDIA CORPORATION and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related documentation without an express license agreement from NVIDIA CORPORATION is strictly prohibited.</license> <profiles xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles" > <transport_descriptors> <transport_descriptor> <transport_id>UdpTransport</transport_id> <type>UDPv4</type> </transport_descriptor> </transport_descriptors> <participant profile_name="udp_transport_profile" is_default_profile="true"> <rtps> <userTransports> <transport_id>UdpTransport</transport_id> </userTransports> <useBuiltinTransports>false</useBuiltinTransports> </rtps> </participant> </profiles>
-
Open the Omniverse Launcher.
-
Launch the Isaac Sim App Selector, and set the following parameters to enable ROS2 Bridge
- Extra Args:
FASTRTPS_DEFAULT_PROFILES_FILE=~/.ros/fastdds.xml
- ROS Bridge Extension:
omni.isaac.ros2_bridge
- Use Internal ROS2 Libraries:
humble
It should look like this:
- Extra Args:
-
Launch Isaac Sim (if not already running)
-
Launch the Carter Navigtion example by clicking
Isaac Examples
>ROS2
>Navigation
>Carter Navigation
-
Click the
Play
icon on the left toolbar.
-
Open a terminal
-
Source the ros2 setup (you can skip if it's in your ~/.bashrc)
source /opt/ros/humble/setup.bash
-
List the available topics
ros2 topic list
You should see the following topics
/back_stereo_imu/imu
/chassis/imu
/chassis/odom
/clock
/cmd_vel
/front_3d_lidar/lidar_points
/front_stereo_camera/left/camera_info
/front_stereo_camera/left/image_raw
/front_stereo_camera/left/image_raw/nitros_bridge
/front_stereo_imu/imu
/left_stereo_imu/imu
/parameter_events
/right_stereo_imu/imu
/rosout
/tf
Great, that means everything is running and we can interface with the simulated robot over ROS2.
Now let's launch the X-Mobility package
-
Source the built workspace
cd ~/ros2_ws
and
source install/setup.bash
-
Launch the X-Mobility navigator
ros2 launch x_mobility_navigator x_mobility_navigator.launch.py
-
Set a goal pose: Select
2D Goal Pose
and then click on the map to set a position / orientation.
That's it! If everything worked, you should see the robot moving towards the goal pose in the simulation.