ROS & ROS2 Bridge

Omniverse Isaac Sim provides both a ROS and ROS2 bridge which use the same set of common components which define the type of data being published/received by the simulator.

Note

Only one of the ROS Bridge extensions can be enabled at any given time.

ROS Bridge

The ROS Bridge Extension enables publishing and subscribing of several rostopics and rosservices that are commonly needed for robotic simulation. Enable the omni.isaac.ros_bridge extension from the extension manager menu Windows->Extensions if not already enabled. You should now be able to run the samples below on the docker host if ROS is installed, or inside of the running container by first running roscore to start the ROS master node.

Note

Internally the ROS bridge runs a custom roscpp build of ROS Noetic so that it works properly with the Omniverse framework and python 3. This is backwards compatible with ROS Melodic.

Note

If communicating with another host (i.e real robot, an existing ROS stack, etc) please set the ROS_IP and ROS_MASTER_URI environment variables before starting isaac sim

Prerequisites

This extension requires a ROS installation capable of running roscore. The extension will continually check if rosmaster is available before starting up.

Note

Omniverse Isaac Sim does not run roscore by default, this is to be more flexible for usecases where Omniverse Isaac Sim is being integrated with existing ROS workflows.

ROS Packages

A list of sample ROS packages created for Omniverse Isaac Sim:

  • isaac_ros_messages: A custom set of messages for 2d/3d bounding boxes and pose service messages.

  • carter_2dnav: Contains the required launch file and ROS navigation parameters for the NVIDIA Carter robot.

  • carter_description: Description of the NVIDIA Carter robot model.

  • isaac_moveit: Contains the required launch and config files for running ROS MoveIt.

To install these ROS packages refer to the section, ROS Workspace.

Go to the ROS website for tutorials on building your own ROS packages.

ROS Workspace

To easily run multiple interdependent ROS packages, create a ROS catkin workspace.

First ensure the ROS environment is sourced:

source /opt/ros/melodic/setup.bash

Create the ROS catkin workspace:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src

Copy the ros_samples folder containing all sample ROS packages created for Omniverse Isaac Sim into the src folder of your new workspace ~/catkin_ws/src.

Note

Alternatively, you can include individual ROS packages into the workspace by selectively copying them into the src folder.

Resolve any package dependencies from the root of the ROS workspace by running the following command:

cd ~/catkin_ws
rosdep install --from-paths src --ignore-src --rosdistro=melodic

Navigate to the root of the workspace and build it:

cd ~/catkin_ws
catkin_make

Under the root directory, a build and devel folder will be auto generated.

To use the ROS packages built within this workspace, it must be sourced using the following command:

source devel/setup.bash

Important

Remember to source your ROS workspace each time a new terminal is opened or whenever a new ROS package is included.

Refer to the catkin workspace website to learn more about ROS catkin workspaces.

Running with Docker

Start the docker container following the instructions in Docker Container Setup and Running Headless Container

When starting the Omniverse Isaac Sim container append --network=host to the starting arguments to expose all ports between the host and container. This will allow you to communicate with the ros master instance inside of the container from the docker host.

Once the Isaac Sim container is running, open a new terminal on the docker host and run the following. Replace CONTAINER_NAME with the name or identifier for your running container. This command will start an interactive bash session inside of the running container.

docker exec -it CONTAINER_NAME bash

In this terminal run the following commands to install additional dependencies needed to run the ROS bridge extension and ROSCore. Note that these steps are not persistent and will need to be re-run if the docker container is restarted.

apt-get install libapr1 lsb-release -y
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
apt update && apt install ros-melodic-ros-base -y

ROS Specific Commands

There are also several API Commands specific to the ROS bridge that allow for more control over various functionality.

ROS2 Bridge

Similar to the ROS bridge, the ROS2 Bridge Extension enables publishing and subscribing of several rostopics and rosservices that are commonly needed for robotic simulation.

Enable the omni.isaac.ros2_bridge extension from the extension manager menu Windows->Extensions if not already enabled.

Note

Disabling the ROS2 extension will cause Isaac Sim to hang due to a thread wait issue in the rclcpp cyclonedds backend.

Prerequisites

It is recommended that ROS2 Foxy Fitzroy and Ubuntu 20.04 are used. See the ROS2 website for requirements and installation instructions: https://docs.ros.org/en/foxy/Releases/Release-Foxy-Fitzroy.html

ROS2 Packages

A list of sample ROS2 packages created for Omniverse Isaac Sim:

  • isaac_ros2_messages: A custom set of ROS2 messages for 2d/3d bounding boxes and pose service messages.

  • carter_navigation: Contains the required launch file and ROS2 navigation parameters for the NVIDIA Carter robot.

  • carter_description: Description of the NVIDIA Carter robot model.

To install these ROS2 packages refer to the section, ROS2 Workspace.

Go to ROS2 website for tutorials on building ROS2 packages.

ROS2 Workspace

To run multiple interdependent ROS2 packages, create a ROS2 workspace.

First ensure the ROS2 environment is sourced:

source /opt/ros/foxy/setup.bash

Create the ROS2 workspace directories:

mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src

Copy the ros2_samples folder containing all sample ROS2 packages created for Omniverse Isaac Sim into the src folder of your new workspace ~/ros2_ws/src.

Note

Alternatively, you can include individual ROS2 packages into the workspace by selectively copying them into the src folder.

Resolve any package dependencies from the root of the ROS2 workspace by running the following command:

cd ~/ros2_ws
rosdep install -i --from-path src --rosdistro foxy -y

Navigate to the root of the workspace and build it:

cd ~/ros2_ws
colcon build

Under the root directory, new build, install, and log directories will be created.

To start using the ROS2 packages built within this workspace, it is important to open a new terminal, and sourcing the workspace with the following commands:

source /opt/ros/foxy/setup.bash
cd ~/ros2_ws
. install/local_setup.bash

Important

Remember to source your ROS2 workspace each time a new terminal is opened or whenever a new ROS2 package is included.

Refer to the ROS2 workspace website to learn more about ROS2 workspaces.

ROS2 Specific Commands

There are also several API Commands specific to the ROS2 bridge that allow for more control over various functionality.

Common Components For ROS and ROS2

The following components can be created from the Create -> Isaac -> ROS menu and are compatible with both ROS and ROS2.

Each component can also be created via python commands see the API Documentation for defaults.

Custom Messages

The following set of ROS messages and services are provided for both ROS and ROS2 in their respective workspaces.

2D Bounding Box:

1
2
3
4
5
6
    string name
    float64 confidence
    int64 xmin
    int64 ymin
    int64 xmax
    int64 ymax

2D Bounding Box Array:

1
2
    std_msgs/Header header
    IsaacBoundingBox[] bboxes

3D Bounding Box:

1
2
3
4
    string name
    float64 confidence
    geometry_msgs/Pose center
    geometry_msgs/Vector3 size

3D Bounding Box Array:

1
2
    std_msgs/Header header
    BoundingBox3D[] bboxes

IsaacPose Service Type

The Pose Teleport Service uses a custom IsaacPose rosservice type:

1
2
3
4
5
6
    std_msgs/Header header
    string[] names
    geometry_msgs/Pose[] poses
    geometry_msgs/Twist[] velocities
    geometry_msgs/Vector3[] scales
    ---