This fork is mainly was used for:
- Debugging purposes
- Team testing with simulation environments
- OS: Ubuntu 22.04 or later (tested up to 24.04)
- ROS 2: Recommended: Jazzy (also tested: Humble)
- GPU: Strongly recommended for real-time simulation (e.g., NVIDIA or equivalent)
- Gazebo: Ignition Gazebo (Fortress or newer)
- Clone & Build the Simulator:
- mkdir -p ~/turtlebot4_ws/src cd ~/turtlebot4_ws/src git clone https://github.com/turtlebot/turtlebot4_simulator.git cd .. rosdep install --from-paths src --ignore-src -r -y colcon build --symlink-install
- Source the Workspace:
- source ~/turtlebot4_ws/install/setup.bash
- Launch Simulation:
- ros2 launch turtlebot4_gazebo sim.launch.py
To enable SLAM in the simulation:
ros2 launch turtlebot4_gz_bringup turtlebot4_gz.launch.py slam:=true
If RViz is needed:
ros2 launch turtlebot4_gz_bringup turtlebot4_gz.launch.py slam:=true rviz:=true
In some cases, the Nav2 stack does not auto-launch properly. To fix this:
ros2 launch navigation2_bringup navigation_launch.py \
use_sim_time:=true \
param_file:=/opt/turtlebot4/share/turtlebot4/config/navigation.yaml
- These services are not simulated or depend on missing plugins.
- You can safely ignore them for SLAM testing.
-
Root cause: GPU rendering not enabled.
-
Fix: Force ogre2 rendering engine:
-
ros2 launch turtlebot4_gazebo sim.launch.py --render-engine ogre2
- Use a dedicated GPU or adjust physics/rendering settings (see next section).
Target: RTF ≥ 0.6 for stable SLAM/Nav2
__NV_PRIME_RENDER_OFFLOAD=1 \
__GLX_VENDOR_LIBRARY_NAME=nvidia \
ros2 launch turtlebot4_gz_bringup turtlebot4_gz.launch.py \
slam:=true nav2:=true rviz:=true
-
Remove unnecessary models from the world.
-
Disable shadows and the skybox in Gazebo.
-
Lower camera resolution and FPS:
- 320 240 10
-
Reduce lidar frequency to 5-10Hz (but not too low — affects Nav2).
Add to world.sdf:
<physics name="default_physics" type="ode">
<max_step_size>0.01</max_step_size>
<real_time_update_rate>100</real_time_update_rate>
<real_time_factor>1.0</real_time_factor>
</physics>