TurtleBot3¶
Please note that this workspace is only tested in simulation.
Last tested (Isaac Sim only) on commit bdbb82d by @j3soon.
Last tested on commit e8f1c8d by @j3soon.
đŗ Start Container¶
Make sure your system meets the system requirements and have followed the setup instructions before using this workspace.
Run the following commands in a Ubuntu desktop environment. If you are using a remote server, make sure you're using a terminal within a remote desktop session (e.g., VNC) instead of SSH (i.e., don't use ssh -X or ssh -Y).
cd ~/ros2-essentials/turtlebot3_ws/docker
docker compose build
xhost +local:docker
docker compose up -d
# The initial build will take a while, please wait patiently.
If your user's UID is
1000, you may replace thedocker compose buildcommand withdocker compose pull.
The commands in the following sections assume that you are inside the Docker container:
TurtleBot3 burger is used by default, you can change it by the following (such as waffle or waffle_pi):
If the initial build somehow failed, run:
Once you have finished testing, you can stop and remove the container with:
đ Inspect Robot Model¶
Skip this section if you are not interested in inspecting the URDF/USD model.
(TODO)
đĒ Launch Simulator¶
Launch one of the following simulators (1) RViz Fake Node (2) Gazebo (3) Isaac Sim.
RViz Fake Node¶
Note that RViz fake node doesn't simulate sensors such as LiDAR.
Gazebo¶
Launch one of the following worlds:
ros2 launch turtlebot3_gazebo empty_world.launch.py
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
ros2 launch turtlebot3_gazebo turtlebot3_house.launch.py
Isaac Sim¶
Convert URDF file to USD file and generate OmniGraph:
cd /home/ros2-essentials/turtlebot3_ws/isaacsim/scripts
./create_urdf_from_xacro.sh
~/isaacsim/python.sh create_turtlebot3_burger_from_urdf.py
~/isaacsim/python.sh create_turtlebot3_burger_with_omnigraph.py
# and close the window when you see the `Done` message (or seeing segmentation fault)
Note that it is entirely unnecessary to convert URDF to USD with scripts, this is just for demonstration purposes. You can directly use the GUI to import the URDF file, and track it in Git easily with USDA. See stretch3-ws for more details.
It is also unnecessary to generate OmniGraph with scripts, you can directly use the GUI to create it, and track it in Git easily with USDA. See stretch3-ws commit history for more details.
Start Isaac Sim in GUI mode:
Alternatively, start Isaac Sim in headless WebRTC mode:
and use the WebRTC Streaming Client.
Open the file with OmniGraph we just generated in the bottom panel:
or use File > Open Recent to re-open it, and click Play (SPACE) to start simulation.
There is currently a known issue on the 2D Lidar sensor and are waiting for an upstream fix.
[Error] [isaacsim.sensors.rtx.plugin] IsaacComputeRTXLidarFlatScan: Lidar prim is not a 2D Lidar, and node will not execute. Stop the simulation, correct the issue, and restart.(TODO: Fix
turtlebot3_burger_isaacsim.urdf.xacroand remove this block after the upstream fix is released.)
To view the OmniGraph, right click the ActionGraph on the right panel and select Open Graph.
đ§Š Features¶
Skip this section if you are not interested in enabling features.
Note that Cartographer and Nav2 features are only supported in Gazebo simulation for now.
Cartographer¶
Basic LiDAR SLAM.
Nav2¶
Requires a running SLAM or a pre-generated map.
đšī¸ Control Robot¶
Raw Message¶
Move forward:
ros2 topic 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}}"
Stop:
ros2 topic pub /cmd_vel geometry_msgs/Twist "{'linear': {'x': 0.0, 'y': 0.0, 'z': 0.0}, 'angular': {'x': 0.0, 'y': 0.0, 'z': 0.0}}"
Teleoperate¶
Teleoperate through keyboard:
Simple Auto Drive¶
Simple collision avoidance:
Visualize with RViz¶
Open a new terminal and visualize published topics in RViz:
Set RViz GUI:
Fixed Frame:world.- Add
Camerawith topic/rgb. - (TODO: Add LaserScan, PointCloud, and Depth after the upstream fix is released.)
đž Save Output¶
Skip this section if you are not interested in saving maps.