Skip to content

Mun Nav2 ​

First clone core and demos through Shared Preparation. Run commands from the PyLoN core root.

Place a front-steering or front/rear-steering rover on the Mun and drive to RViz Nav2 Goal positions/headings. Pose and traversable terrain are estimated from 3D LiDAR, IMU, and wheel data.

1. Install the demo ​

After installing the mod and bridge through Getting Started, run from the PyLoN repository root.

bash
source /opt/ros/jazzy/setup.bash
rosdep install --from-paths \
  Ros2/pylon_interfaces Ros2/pylon_bridge Ros2/pylon_vehicle_control \
  Ros2/pylon_perception ../demos/pylon_demo_mun_rover \
  --ignore-src --rosdistro jazzy -y
./sync.sh --skip-ksp-build --skip-ksp-sync --demo mun_rover
source ~/ros2_ws/install/setup.bash

This also installs Nav2, RViz, and point-cloud dependencies.

2. Prepare the rover ​

  1. Arrange four or six stock wheels symmetrically. Enable steering on front wheels only or both front/rear axles. Rear steering turns opposite the front; the center pair on a six-wheel rover may remain fixed.
  2. Enable motors and brakes on all wheels and provide sufficient power.
  3. Point the control point forward. For the Mk2 lander can, select Control Point: Forward.
  4. Mount 3D LiDAR where it sees forward and ground. One sensor is selected automatically. On wide vessels, mount higher to see ground on both sides.
  5. Place on the Mun through normal KSP operations, confirm all wheels are grounded, apply brakes, and stop.

Initialization collects at least 30 stationary IMU gravity/bias samples. Remain still while it initializes.

rober B works with all four wheels steering enabled. Set the control point Forward and use the saved LiDAR placement and medium-range profile. No LiDAR ID change or rear-steering disable is needed. Do not change the control point or wheel settings while driving; stop and reinitialize after changes.

3. Start Nav2 and RViz ​

Stop any manually started bridge first, then run below. This launch also starts a bridge.

bash
source /opt/ros/jazzy/setup.bash
source ~/ros2_ws/install/setup.bash
ros2 launch pylon_demo_mun_rover demo.launch.py

With multiple 3D LiDARs, specify an ID such as lidar_sensor_id:=lidar_3d_3bb3e35a. A source change during automatic selection stops driving and resets mapping/estimation. Turning radius and footprint are configured from wheel/vessel data. Driving and goal positions reference the rear axle for front steering, or the axle midpoint for front/rear steering.

Use start_bridge:=false with an existing bridge. Run only one bridge at a time.

4. Set a goal ​

Wait for the URDF vessel, footprint, and white ground regions to appear in RViz, with Ready: set Nav2 Goal status.

  1. Select RViz Nav2 Goal.
  2. Click traversable ground and drag toward the desired final heading to place the arrow.
  3. Check the displayed path and vessel motion.

Photo-covered areas retain lighting from capture time. Temporarily disable Surface photos when checking traversability. Gray map areas are unobserved and cannot be driven through. Begin with a nearby observed point and leave turning space. Because heading alignment uses forward motion, even nearby goals may require a detour. Maximum speed is 0.5 m/s; acceleration is 0.2 m/s².

Once position and heading are within tolerance, the parking brake is held; success follows Nav2's stopped-state confirmation. If the rear footprint enters unknown terrain during the first turn, first drive straight about 5 m to observe surrounding ground, then set a turning goal.

From your own node, use the public /navigate_to_pose action. /pylon/mun_rover/navigate_to_pose is internal.

5. Inspect state and maps ​

Source ROS in another terminal and run below.

bash
source /opt/ros/jazzy/setup.bash
source ~/ros2_ws/install/setup.bash
ros2 topic echo /pylon/mun_rover/status
Display / outputTopic
Map/pylon/mun_rover/map
Pose estimate/pylon/mun_rover/odom, odom_3d
Point cloud / ground / obstacles/pylon/mun_rover/points, ground, obstacles
Planned path / trajectory/pylon/mun_rover/plan, trajectory
Vessel geometry/pylon/mun_rover/geometry
URDF at estimated pose/pylon/mun_rover/robot_description
Accumulated photo map/pylon/mun_rover/photo_map
Original camera image / calibration/pylon/mun_rover/camera/image_raw, camera/camera_info
Photo count / area / wait reason/pylon/mun_rover/visualization_status

The map is 120 m square at 0.25 m resolution. TF is map → pylon_rover_odom → pylon_rover_base_footprint → pylon_rover_base_link. Included RViz settings show maps and trajectories in these estimated frames.

Status shows preparation, driving, and stop reasons. Local costs is hidden by default to keep white/gray terrain readable; enable it in Displays to inspect Nav2 costs.

Navigation 2 Navigation: active and map Ready: set Nav2 Goal indicate startup completion. This demo uses its own pose estimation; Localization: inactive in that panel is expected.

6. Overlay the rover and lunar photos ​

Rover URDF overlays primitive vessel geometry at the estimated pose. Surface photos projects camera photos onto LiDAR-observed ground and leaves them around the traveled area. A single camera is selected automatically; for multiple cameras specify, for example, camera_sensor_id:=camera_c584088f.

Mount the camera facing ground and enable image streaming. Sky, unknown terrain, and vessel-occluded areas are not projected. Photos are added after roughly 0.5 m movement or 8° heading change. The photo map is 120 m square on a 10 cm grid; overlaps prefer better downward angles and distances. Photo colors do not indicate traversability; driving decisions use the LiDAR map.

Add show_camera:=true at launch for live video alongside RViz. Video uses a dedicated viewer; photo map and URDF appear in RViz. RViz's Image panel is avoided because it crashes on some HiDPI systems. 3D LiDAR and Ground are hidden by default to keep photos readable.

Photos accumulate in memory and clear on reinitialization, vessel switches, or teleportation. There is no automatic saving. Estimation error and sparse terrain observations can leave seams and gaps. This is not photogrammetric 3D reconstruction or long-range loop closure.

Stopping and reinitializing ​

Canceling an active goal stops driving. Missing commands/sensors for at least 0.5 seconds, lost ground contact, authority loss, or estimation faults also stop the rover; old goals do not resume automatically.

Cancel RViz goals with Navigation 2 Cancel. Panel Reset stops/cleans up Nav2 itself. Use the service below to reset only mapping and pose estimation.

Terrain computation runs separately from sensor processing. Observations more than two seconds old also stop driving with terrain_timeout.

Resolve the cause, confirm stopped state, canceled goals, and ground contact, then initialize.

bash
ros2 service call /pylon/mun_rover/reset std_srvs/srv/Trigger '{}'

Set a fresh goal once Ready returns. To finish, cancel the goal, confirm stopped state, and press Ctrl-C in the launch terminal.

Main launch arguments ​

ArgumentDefaultPurpose
lidar_sensor_idautoAuto-select one streaming 3D LiDAR; specify ID if multiple
camera_sensor_idautoAuto-select one streaming camera; specify ID if multiple
show_visualizationtrueGenerate estimated-pose URDF and photo map
show_camerafalseOpen live video in the dedicated viewer
start_bridgetrueAlso start the bridge
use_rviztrueStart RViz
evaluatefalseStart a comparison node using Ground Truth
params_fileIncluded config/nav2.yamlNav2 settings
bt_xmlIncluded config/navigate.xmlNavigation behavior settings

For comparison with Ground Truth, add evaluate:=true and inspect /pylon/mun_rover/evaluation. Evaluation runs in a separate node. With an existing bridge, enable Ground Truth there too.

If driving does not start or stops ​

StateCheck
Not ReadyAll wheels grounded and stationary on the Mun; control point Forward; symmetric front or front/rear steering
Ground stays grayLiDAR sees forward and side ground; adjust height, angle, and distance profile
No path generatedGoal/path are observed and have footprint and turning clearance
Estimation fault stops drivingTerrain features, wheel contact, point cloud/IMU rates; reset after stopping

This is a local-map demo rather than SLAM with long-range loop closure. Initial traversability thresholds are 12° slope, 0.25 m steps, and 0.15 m roughness. Unknown terrain or obstacles within the stopping distance, including the footprint and 0.5 m margin, also cause a stop.

Guides and API references for building ROS2 applications with PyLoN