TurtleBot3¶
Please note that this workspace is only tested in simulation.
đŗ Start Container¶
cd ~/ros2-essentials/turtlebot3_ws/docker
docker compose pull # or docker compose build
xhost +local:docker
docker compose up
# The initial build will take a while (~5 mins), please wait patiently.
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:
đ 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
python3 create_turtlebot3_burger_from_urdf.py
python3 create_turtlebot3_burger_with_omnigraph.py
Start Isaac Sim in GUI mode:
Alternatively, start Isaac Sim in headless WebRTC mode:
and visit http://127.0.0.1:8211/streaming/webrtc-demo/?server=127.0.0.1 to stream through WebRTC.
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.
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:
đž Save Output¶
Skip this section if you are not interested in saving maps.