A rover on another planet cannot brake for a pothole. Path planning there is not a tidy grid problem — it is a continuous-control problem on rough, rocky ground where the "cost" of a path is measured in tilt, slip, and the chance of getting stuck. This project simulates an improved motion-primitive A* planner and an arc-based tracking controller for exactly that setting.
This is a Pygame simulation and experimental codebase for evaluating path-planning and tracking control methods for planetary rovers. It implements and compares three things: an improved A* with motion primitives, a classical grid A* baseline, and a reactive arc-based local controller. It was built as a case study for a 2025 peer-reviewed paper.1
What the simulator does
- Improved A* with motion primitives (
rover_control_sim_fast.py) — a global planner that expands constant-curvature motion primitives in space using a terrain-aware cost model. - Grid-based A* (
rover_control_sim_astar.py) — the baseline 8-connected grid planner with per-cell terrain costs. - Arc-based local controller — a reactive controller that samples short circular arcs, scores them by multi-objective criteria (progress, alignment, safety), and executes the best one.
- Utilities to generate synthetic DEMs, scatter procedural rocks, visualize the simulation, and plot experimental results.
Background
The point of departure is Zhang et al. (2025), who propose an improved path-planning and tracking-control method for planetary exploration rovers with a “traversable tolerance.”1 The paper’s contributions map cleanly onto the three planner/controller components above, so the simulator is effectively a runnable commentary on it.
The key ideas:
- Procedural terrain generator — a DEM built from Gaussian bumps plus noise.
- Per-cell traversability / cost model — slope, roughness, and rock proximity feed a cost.
- Motion-primitive A* — constant-curvature arcs as the expansion action.
- Baseline grid A* — for head-to-head comparison.
- Arc-based local tracking controller — follows the planned path reactively.
- Pygame visualization with interactive controls, plus plotting scripts that reproduce the paper’s figures.
The experimental payoff
The headline result is a ~30% reduction in mean planning time for the improved planner over classical grid A* in the synthetic experiments — visible directly in the planning-time histogram reproduced below.
Figure 1 — Planning-time distributions across 40 trials. The improved planner (motion primitives) shifts the bulk of runs to lower times.
Screenshots
The interactive simulator renders the rover, the terrain, the planned path, and the HUD live. A few captures from example runs:
Figures 2–5 — Example runs of the Pygame simulator showing terrain, planned paths, and the rover pose HUD.
Running it
Requires Python 3.8+ on Linux. Install dependencies, then run either planner:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python rover_control_sim_fast.py # improved A* (motion primitives)
python rover_control_sim_astar.py # classical grid A* baselineIn-simulator controls:
- Left-click — set goal position
- W/A/S/D or arrows — drive manually
- p — plan a global path to the goal
- f — toggle auto-follow (arc-based controller tracks the path)
- r — regenerate terrain + rocks
- Esc / q — quit
The HUD shows rover pose , the current goal, path length, auto-follow status, and control hints.
Parameters & tuning
Key knobs live at the top of the scripts:
- DEM:
GRID_W,GRID_H, bump count, noise, amplitude, seed - Traversability:
dzmax,phimax,rnmax - Motion primitives: lengths, radii, samples per primitive
- Planner:
heuristic_weight,heading_bins,max_time,max_iterations - Controller: arc sampling (, ranges), time-step, evaluation weights
Fix the random seeds in the DEM and rock-placement functions for reproducible experiments.
Repository
Citation
If you use this code or its results, please cite the project and the underlying paper:
@article{zhang2025improved,
title={An improved path planning and tracking control method for planetary exploration rovers with traversable tolerance},
author={Zhang, Haojie and Jiang, Feng and Li, Qing},
journal={Biomimetic Intelligence and Robotics},
volume={5},
number={2},
pages={100219},
year={2025},
doi={10.1016/j.birob.2025.100219}
}Footnotes
-
Zhang, H., Jiang, F., & Li, Q. (2025). An improved path planning and tracking control method for planetary exploration rovers with traversable tolerance. Biomimetic Intelligence and Robotics, 5(2), 100219. https://doi.org/10.1016/j.birob.2025.100219 ↩ ↩2