Launch the simulation
The primary launch file starts Gazebo in headless mode, spawns the rover, and bridges ROS topics:What happens during launch
Gazebo server starts
The Gazebo Fortress server loads the moon yard world (
moon_yard.sdf) in headless mode without a GUI.Robot description publishes
The
robot_state_publisher node processes the URDF from lunabot_description/urdf/lunabot.urdf.xacro and publishes the robot model.Rover spawns
The rover spawns at coordinates
(x=0.0, y=0.0, z=0.5) and settles to the surface under gravity.Headless mode conserves CPU and GPU resources. Use visualization tools below to observe the simulation.
Visualization tools
The rover supports three visualization methods, each serving different purposes.RViz2 - ROS visualization
RViz2 displays ROS topics, transforms, and sensor data:- RobotModel - 3D robot visualization
- TF - Coordinate frame transforms
- LaserScan - LiDAR point cloud on
/scan - Image - Camera feed on
/camera_front/image - DepthCloud - Depth visualization on
/camera_front/points - Odometry - Position trail on
/odom
GZ Web - Gazebo visualization
View the 3D world, terrain, and physics interactions:Connect via browser
Open https://app.gazebosim.org/visualization and connect to:
- Arena geometry and obstacles
- Lunar terrain surface mesh
- Rover model and wheel interactions
- Collision geometries
Foxglove Studio - Advanced debugging
Foxglove provides professional-grade visualization with custom layouts:Connect Foxglove Studio
Download Foxglove Studio and connect to:
- Multi-panel layouts for simultaneous data streams
- Topic message inspection and playback
- Custom plots for sensor trends
- 3D transforms and point cloud rendering
- Image synchronization across cameras
Visualization comparison
| Tool | Purpose | Pros | Cons |
|---|---|---|---|
| RViz2 | ROS data visualization | Native ROS integration, TF display | Limited world visualization |
| GZ Web | World and physics | Shows terrain and obstacles | Requires browser connection |
| Foxglove | Professional debugging | Advanced features, remote access | Additional dependency |
Manual control
Drive the rover using keyboard teleoperation:Controls
Movement:i- Move forward,- Move backwardj- Rotate leftl- Rotate rightk- Stopu/o- Forward + rotatem/.- Backward + rotate
q- Increase linear and angular speed by 10%z- Decrease linear and angular speed by 10%w- Increase linear speed onlyx- Decrease linear speed onlye- Increase angular speed onlyc- Decrease angular speed only
Inspecting topics
View active ROS topics:Key topics
Sensor data
| Topic | Type | Rate | Description |
|---|---|---|---|
/imu/data_raw | sensor_msgs/msg/Imu | 100 Hz | Acceleration and angular velocity |
/scan | sensor_msgs/msg/LaserScan | 10 Hz | 2D LiDAR obstacle detection |
/camera_front/image | sensor_msgs/msg/Image | 30 Hz | RGB camera feed |
/camera_front/depth_image | sensor_msgs/msg/Image | 30 Hz | Depth camera data |
/camera_front/points | sensor_msgs/msg/PointCloud2 | 30 Hz | 3D point cloud |
/camera_front/camera_info | sensor_msgs/msg/CameraInfo | 30 Hz | Camera calibration |
Odometry and control
| Topic | Type | Rate | Description |
|---|---|---|---|
/odom | nav_msgs/msg/Odometry | 50 Hz | Position and velocity estimates |
/joint_states | sensor_msgs/msg/JointState | 50 Hz | Wheel encoder positions |
/cmd_vel | geometry_msgs/msg/Twist | Variable | Velocity commands to rover |
Material handling actions
| Action | Type | Description |
|---|---|---|
/mission/excavate | lunabot_interfaces/action/Excavate | Excavation with fill monitoring |
/mission/deposit | lunabot_interfaces/action/Deposit | Material deposition with door control |
Platform-specific behavior
macOS (OrbStack)
The launch file automatically detects macOS and switches from Ogre2 to Ogre rendering engine:Custom model paths
The launch file setsGZ_SIM_RESOURCE_PATH to include custom models:
Troubleshooting
Simulation freezes or lags: Reduce sensor update rates by editing the world file:/clock_bridge/robot_bridge/robot_state_publisher
z=0. Ensure the spawn position in moon_yard.launch.py is above ground:
~/.gz/fuel/ for offline use.
Manually download models:
Next steps
API Reference
Explore ROS topics, actions, and message formats
Navigation
Set up Nav2 for autonomous path planning
Perception
Configure hazard detection and AprilTag localization
Material Handling
Use excavation and deposition actions