Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Racecar Stack: Localization, Path Planning, & Control

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.

ROS2 Package Architecture

                     /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.

Building

This is a standard colcon workspace:

cd racecar-stack
colcon build
source install/setup.bash

localization 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.

Running

Simulation, ground-truth pose (no particle filter):

ros2 launch path_planning sim_plan_follow.launch.xml

Simulation, full stack (particle filter + planner + pure pursuit):

ros2 launch path_planning pf_sim_plan_follow.launch.xml

Real 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.

Algorithms implemented

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

About

Monte Carlo localization and path planning on a four-wheeled robot (ROS2).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages