5. ROS & ROS2 Installation¶
Omniverse Isaac Sim provides both a ROS and a ROS2 bridge for ROS system integration. The same set of common components are used to define the type of data being published/received by the simulator.
For the ROS bridge, Isaac Sim is internally running 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.
For the ROS2 bridge, Isaac Sim is currently compatible with ROS2 Foxy. Using Ubuntu 20.04 is recommended for ROS2
For ROS, In the steps below replace
melodic if you are installing on Ubuntu 18.04
5.1. Running Native ROS¶
Follow instruction on the official website to download
Make sure to source the ROS environment in the terminals each time before using any ROS commands.
You can also automatically source it by adding it to your
echo "source /opt/ros/<ros-distro>/setup.bash" >> ~/.bashrc source ~/.bashrc
For ROS only: Start
roscorein a ROS sourced terminal. Isaac Sim does not run
roscoreby default, this is to be more flexible for use cases where Isaac Sim is being integrated with existing ROS workflows.
5.2. Enable ROS/ROS2 Bridge Extension¶
To enable the ROS/ROS2 bridge extension, go to the extension manager menu Windows->Extensions and search for ROS bridge. Only one of the ROS Bridge extensions can be enabled at any given time.
5.3. Setting Up Workspaces¶
5.3.1. ROS Tutorials¶
There are a few ROS packages that are needed to go through our ROS/ROS2 tutorial series. To make it easy, we prepared an entire ROS workspaces with the necessary packages.
Follow the steps below to build it and source the overlay of this package.
First make sure your native ROS has been sourced if not already
$ source /opt/ros/noetic/setup.bash
You can check if it is successful by checking the
$ echo $ROS_PACKAGE_PATH /opt/ros/noetic/share
Resolve any package dependencies from the root of the ROS workspace by running the following command:
$ cd ros_workspace $ rosdep install -i --from-path src --rosdistro noetic -y
Then in the ROS-sourced terminal, build the Isaac
ros_workspacefolder then source the overlay.
$ catkin_make $ source devel/setup.bash
This will put Isaac Sim’s ROS workspace in your
ROS_PACKAGE_PATH. You can
echo $ROS_PACKAGE_PATHagain to see that the path to the Isaac Sim’s ROS workspace has been added in front of your original one.
Alternatively, you can also move the individual rospackages inside our
ros_workspace/srcfolder into your own ROS workspaces and build it.
A list of sample ROS packages created for Omniverse Isaac Sim:
isaac_tutorials: Contains launch files, rviz config files, and scripts for the tutorial series.
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.
Go to the ROS website for tutorials on building your own ROS packages.
If you wish Isaac Sim to have access to your existing packages, make sure to set
ROS_PACKAGE_PATHenvironment variable to include the desire ROS workspace in the same terminal before starting up Omniverse Isaac Sim.
5.3.2. ROS 2 tutorials¶
In order to build the ros2 workspace additional packages might need to be installed:
# For rosdep install command $ sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential # For colcon build command $ sudo apt install python3-colcon-common-extensions
Make sure your native ROS2 has been sourced if not already
$ source /opt/ros/foxy/setup.bash
Resolve any package dependencies from the root of the ROS2 workspace by running the following command:
$ cd ros2_workspace $ rosdep install -i --from-path src --rosdistro foxy -y
Build the workspace:
$ colcon build
Under the root directory, new
logdirectories 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_workspace $ . install/local_setup.bash
Remember to source your ROS2 workspace each time a new terminal is opened or whenever a new ROS2 package is included.
Do not source ROS2 in the terminal where you are running Isaac Sim as that can cause errors during startup because of conflicting symbols.