Overview
The TurtleBot3 development environment includes convenient bash aliases configured in~/.bashrc by the post-create.sh script. These aliases simplify common ROS2 and TurtleBot3 operations.
Alias reference
Build and source aliases
| Alias | Command | Description |
|---|---|---|
cb | cd /workspace/turtlebot3_ws && colcon build --symlink-install | Build workspace with symlink install |
sb | source /workspace/turtlebot3_ws/install/setup.bash | Source workspace overlay |
TurtleBot3 simulation aliases
| Alias | Command | Description |
|---|---|---|
tb3_empty | ros2 launch turtlebot3_gazebo empty_world.launch.py | Launch TurtleBot3 in empty world |
tb3_world | ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py | Launch TurtleBot3 in TurtleBot3 world |
tb3_house | ros2 launch turtlebot3_gazebo turtlebot3_house.launch.py | Launch TurtleBot3 in house world |
TurtleBot3 control aliases
| Alias | Command | Description |
|---|---|---|
tb3_teleop | ros2 run turtlebot3_teleop teleop_keyboard | Launch keyboard teleoperation |
Navigation and SLAM aliases
| Alias | Command | Description |
|---|---|---|
tb3_slam | ros2 launch turtlebot3_cartographer cartographer.launch.py use_sim_time:=True | Launch Cartographer SLAM |
tb3_nav | ros2 launch turtlebot3_navigation2 navigation2.launch.py use_sim_time:=True map:=$HOME/maps/my_map.yaml | Launch Navigation2 with map |
Software rendering aliases
| Alias | Command | Description |
|---|---|---|
tb3_empty_sw | LIBGL_ALWAYS_SOFTWARE=1 ros2 launch turtlebot3_gazebo empty_world.launch.py | Empty world with software rendering |
tb3_world_sw | LIBGL_ALWAYS_SOFTWARE=1 ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py | TurtleBot3 world with software rendering |
tb3_house_sw | LIBGL_ALWAYS_SOFTWARE=1 ros2 launch turtlebot3_gazebo turtlebot3_house.launch.py | House world with software rendering |
Detailed usage
Build and source
cb - Build workspace
- Changes to workspace directory
- Runs colcon build with symlink install
- After modifying C++ source code
- After adding new packages
- After pulling changes from git
sb - Source workspace
- After building the workspace
- When opening a new terminal (if not in .bashrc)
- After installing new packages
.bashrc (which it is by default)
Simulation worlds
tb3_empty - Empty world
- Gazebo window with flat ground plane
- TurtleBot3 Burger robot in the center
tb3_world - TurtleBot3 world
- Walls forming a square arena
- Multiple obstacles
- Good for testing obstacle avoidance
tb3_house - House world
- Multiple rooms
- Furniture and obstacles
- Realistic home layout
Teleoperation
tb3_teleop - Keyboard control
- Launch simulation in one terminal:
tb3_empty - Launch teleop in another terminal:
tb3_teleop - Use keyboard to control the robot
- Keep the teleop terminal focused to send commands
- Start with small velocities
- Use ‘s’ or space for emergency stop
SLAM and navigation
tb3_slam - Cartographer SLAM
- Terminal 1: Launch simulation
- Terminal 2: Launch SLAM
- Terminal 3: Control robot to explore
- Save map when done:
- RViz window showing real-time map building
- Robot position and laser scan
- Occupancy grid map
tb3_nav - Navigation2
~/maps/my_map.yaml
Usage workflow:
- Terminal 1: Launch simulation
- Terminal 2: Launch navigation
- In RViz:
- Use “2D Pose Estimate” to set initial pose
- Use “Nav2 Goal” to send navigation goals
Software rendering
Use these aliases if Gazebo crashes or has rendering issues.When to use software rendering
- Gazebo crashes on startup
- Black screen in Gazebo
- GPU driver issues
- Running in environments without GPU
- Running on older hardware
tb3_empty_sw, tb3_world_sw, tb3_house_sw
LIBGL_ALWAYS_SOFTWARE=1 to force Mesa software rendering
Common workflows
Basic simulation and control
Mapping (SLAM)
Autonomous navigation
Development workflow
Customization
To add your own aliases, edit~/.bashrc:
.bashrc:
Troubleshooting
Alias not found
Problem:bash: tb3_empty: command not found
Solution: Source your .bashrc:
Simulation crashes
Problem: Gazebo crashes on launch Solution: Try software rendering version:Wrong robot model
Problem: Wrong TurtleBot3 model appears (waffle instead of burger) Solution: CheckTURTLEBOT3_MODEL environment variable:
burger. If not, add to .bashrc:
Navigation can’t find map
Problem:tb3_nav fails with map not found
Solution: Verify map exists: