1. Import and Drive TurtleBot3¶
Omniverse Isaac Sim have several tools to facilitate integration with ROS systems. We have both ROS and ROS2 bridges, as well as an URDF importer. This tutorial series gives examples of how to use these tools.
1.1. Learning Objectives¶
In this example, we will setup up a Turtlebot3 in Isaac Sim and enable it to drive around. We will
Import the Turtlebot3 robot using the URDF importer
Introduce the ROS bridge
Attach a differential drive rostopic to the robot to control it
1.2. Getting Started¶
Prerequisite
Completed ROS & ROS2 Installation so that ROS is available, ROS extension is enabled, and necessary environment variables are set.
Downloaded and built the Turtlebot3 Package .
roscore
is running.
ROS Bridge
The ROS bridge comes with a few popular rostopics that are packaged for ease of use. More details are in the ROS & ROS2 Bridge. Here we will focus on the procedures in using them.
To add a ROS bridge rostopic, it generally consists of three steps:
add the rostopic
attach an input target to the topic
modify any properties as needed
These steps can be done entirely in the UI, scripting inside the extension workflow, or scripting inside the standalone Python workflow. Refer to Isaac Sim Workflows for details of different workflows. For majority of the tutorials we will be demonstrating the UI method. Scripting inside the extension workflow is introduced in Joint Control: Extension Python Scripting. Scripting using the standalone Python workflow is introduced in Custom Message.
1.3. Importing TurtleBot3 URDF¶
To import the TurtleBot3 into Omniverse Isaac Sim, first convert the .xacro
file to .urdf
file by calling
rosrun xacro xacro -o <output_name>.urdf <input_file>.urdf.xacro
For this example we will use the TurtleBot3 Burger model.
For the purpose of this tutorial series, we will use an environment that’s setup for you, but you can import the robot into any environment of your choosing. Open the environment by going to the Content tab below the viewport, and Isaac/Samples/ROS/Scenario/simple_room_apriltag.usd.
Open the URDF importer Isaac Utils -> URDF Importer.
In the prompt window, uncheck clean stage to preserve the existing environment, uncheck Fix Base Link since this is a mobile robot, change Joint Drive Type to Velocity so that wheels can be properly driven later.
Press the Select and Import button and find the desired .urdf file for TurtleBot3 Burger in your file system. Import.
When it first appears in the room, the robot will be sitting on top of the table. Use the gizmo to move it to the floor by moving the whole prim as seen below.
Let’s also make sure the robot is under the /World branch in the Stage Tree.
If you did not use the provided environment, make sure to add a Ground Plane and a Physics Scene to your environment. Both can be found in Create -> Physics. You may also need some lighting, play with the various types of lighting in Create -> Light to get the desired effect.
1.4. Differential Drive Topic¶
We will first add a Differential Base bridge to the imported Turtlebot Burger, so that we can drive it around.
To add a Differential Base bridge:
Create -> Isaac -> ROS -> DifferentialBase.
Assign the rostopic to the Turtlebot articulation by going to the Property tab, open up Raw USD Properties, and add turtlebot3_burger target to chassisPrim.
In order for the robot to drive properly, we need to specify the names of the wheel joints, the wheel radius, and the distance between the wheels, so that speed and movement can be calculated correctly. Modify those parameters to the following values:
Field |
Value |
---|---|
leftWheelJointName |
wheel_left_joint
|
rightWheelJointName |
wheel_right_joint
|
maxSpeed |
0.22
|
wheelBase |
0.16
|
wheelRadius |
0.025
|
Press Play to start publishing and listening on the rostopics associated with the Differential Base bridge.
In a separate ROS-sourced terminal, check that the associated rostopics exist with
rostopic list
. You should see that/cmd_vel
,/odom
, and/tf
should be listed in addition to/rosout
and/rosout_agg
.Now that a differential base topic is setup, a twist message can be published to /cmd_vel topic to control the robot. Let’s drive it forward with command
rostopic pub /cmd_vel geometry_msgs/Twist '{linear: {x: 0.2, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 0.0}}'
To make it easier for us to move the Turtlebot around, download the teleop-twist-keyboard and enable driving using the keyboard by running
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
1.4.1. Troubleshooting¶
Make sure your robot is on the ground. The table has a different property therefore making it hard for the robot to move on it. To change properties of either the ground or the wheels, go to Simple Robot.
1.5. Summary¶
This tutorial covered the following topics:
URDF import
Adding Differential Base bridge.
1.5.1. Next Steps¶
Continue on to the next tutorial in our ROS Tutorials series, Cameras, to learn how to add cameras and receive ground truth synthetic perception data through rostopics.
1.5.2. Further Learning¶
More details URDF Importer.
More details on world building Simple Robot