A ROS2 stack for autonomous navigation on a 4-wheeled racecar. Given a known map and a goal pose, the car identifies where it is currently using Monte Carlo localization, plans a collision-free path using A*, BFS, or RRT, then drives to the goal position.
/map (OccupancyGrid)
│
┌───────────┴───────────┐
│ │
▼ ▼
┌───────────────┐ ┌───────────────┐
│ localization │ │ path_planning │
│ (particle │──────▶│ (A*/BFS/RRT) │
│ filter / MCL) │/pf/pose/odom │
└───────┬────────┘ └───────┬────────┘
│ /pf/pose/odom │ /trajectory/current
│ ▼
│ ┌───────────────┐
└───────────────▶│ pure pursuit │──▶ /drive (AckermannDriveStamped)
│ + safety stop │
└───────────────┘
src/localization— Monte Carlo Localization. Fuses odometry (motion model) and LIDAR (sensor model, via a precomputed beam model + Cython ray-casting against the map) into a particle filter, publishing a real-time pose estimate on/pf/pose/odom.src/path_planning— takes the current pose and an RViz-clicked goal, plans a collision-free path over the occupancy grid (A*, BFS, or RRT), and drives it with a pure pursuit controller plus a LIDAR-based emergency stop.
Each is a standalone ROS2 package — see their own READMEs for details: src/localization/README.md,
src/path_planning/README.md.
This is a standard colcon workspace:
cd racecar-stack
colcon build
source install/setup.bashlocalization compiles a Cython/C++ ray-casting extension (scan_simulator_2d.pyx) against
racecar_simulator, so that package (and its headers/libs on $SIM_WS) needs to be available
in the workspace or environment before building.
Simulation, ground-truth pose (no particle filter):
ros2 launch path_planning sim_plan_follow.launch.xmlSimulation, full stack (particle filter + planner + pure pursuit):
ros2 launch path_planning pf_sim_plan_follow.launch.xmlReal hardware: see src/path_planning/launch/real/ and src/localization/launch/localize_real_env.launch.xml.
In RViz: "2D Pose Estimate" sets/reseeds the particle filter, "2D Nav Goal" sets the planning goal. The planner then publishes a path, and pure pursuit drives it.
| Component | Algorithm |
|---|---|
| Localization | Monte Carlo Localization (particle filter): odometry motion model + beam-based LIDAR sensor model (hit/short/max/random mixture) |
| Path planning | A*, BFS (search-based); RRT (sampling-based) |
| Control | Pure pursuit trajectory tracking with adjustable lookahead |
| Safety | LIDAR-threshold emergency stop |

