This guide walks you through everything needed to go from a fresh Ubuntu 22.04 machine to a running RoboTerrain simulation with a pre-trained SAC agent navigating the Inspection world. By the end you will have Gazebo Fortress open with the Rover Zero 4WD spawned, the position bridge node streaming pose data over ROS 2, and the SAC agent driving the robot autonomously — all in under 15 minutes.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jackvice/RoboTerrain/llms.txt
Use this file to discover all available pages before exploring further.
Clone the Repository
Clone RoboTerrain from GitHub using SSH, then navigate into the repository directory:The repository contains the full ROS 2 workspace under
ros2_ws/, the SB3 agent code under ros2_ws/src/sb3/, Gazebo world files, robot URDF/SDF models, the metrics node, and a pre-trained checkpoint pair (sac_inspect.zip / sac_inspect_normalize.pkl) for the Inspection world.Build the ROS 2 Workspace
Source the ROS 2 Humble underlay, then build all packages in the workspace with Building for the first time compiles the
colcon:roverrobotics_ros2 packages (robot description, Gazebo launch, control), rover_metrics, and dynamic_obstacles. Expect the build to take 2–5 minutes depending on your CPU.Install Python Dependencies
From the repository root, install the required Python packages. The core runtime dependencies are Stable Baselines3 (with extras for TensorBoard and image support) and If you intend to experiment with model-based or JAX-based agents, PyTorch with CUDA support should be installed separately following the official instructions for your CUDA version. The Dockerfile uses CUDA 11.8:
transforms3d for quaternion math:jax is listed in requirements.txt as an optional dependency:Launch the Simulation
Open a new terminal, source both the ROS 2 underlay and the built workspace overlay, then launch the Rover Zero simulation:Gazebo Fortress will open and spawn the Rover Zero 4WD (Wait until you see the Rover Zero model appear in the Gazebo viewport before proceeding to the next step.
camera_rover_4wd.sdf) at the origin of the default world (island.sdf). To use the Inspection world instead, edit the default_value in 4wd_rover_gazebo.launch.py (line 24) and rebuild:Run the SAC Agent
Open a second terminal and navigate to the pose bridge directory. The agent requires two processes: a position bridge node that translates Ignition pose messages into a ROS 2 topic the environment can read, and the SAC inference script itself.Open a third terminal, then start the pre-trained SAC agent in predict mode:You should see the agent begin navigating the Inspection world. Episode results (reward, steps) are printed to the terminal as each episode completes. To train a new agent from scratch instead of running the pre-trained one, use:Training progress is written to TensorBoard logs. Launch TensorBoard in a separate terminal to monitor reward curves live:
ign_ros2_Nav2_topics.py must be started first and left running in the background. It subscribes to the Gazebo dynamic pose stream and republishes the robot’s world-frame position as a /rover/pose_array topic. sb3_SAC.py reads from this topic to compute goal-relative observations — if the bridge is not running, the environment will block indefinitely on the first reset() call.What’s Next
Now that you have a working simulation and a running agent, explore the rest of the RoboTerrain documentation to go deeper:Training RL Agents
Configure SAC and PPO hyperparameters, set up checkpoint callbacks, and run multi-million-step training campaigns with normalization statistics persistence.
Gymnasium Environments
Explore the LiDAR-fused and vision-fused Gymnasium environment implementations, observation and action spaces, and reward shaping strategies.
Simulation Worlds
Switch between Inspection, Maze, Island, Rubicon, Construction, and MarsYard worlds. Learn how to modify terrain, add obstacles, and create your own Gazebo SDF world.
Metrics & Logging
Use the
rover_metrics ROS 2 node to capture SR, TC, MTT, TR, and VORT, then generate publication-ready comparison plots across multiple experimental trials.