A lightweight hobby project exploring sampling based trajectory generation for autonomous vehicles and mobile robots. The planner samples both geometric paths and motion profiles, combines them into full trajectories, evaluates each candidate with a custom trajectory cost function, and selects the best feasible plan.
The goal is to create a simple, modular playground for experimenting with trajectory sampling, scoring, and selection strategies, similar to what would be used in a nonlinear optimisation setup, but with a fully sampling based approach.
A structured set of geometric path candidates generated by varying lateral offsets and spline control points. This creates a dense lattice of smooth curves covering the local space, similar to a Frenet-frame lattice, but spline based and fully configurable.
Independent sampling of velocity, acceleration, and jerk profiles. These motion primitives can be paired with any geometric spline to create motion trajectories.
Geometry and motion samples are combined into full spatiotemporal trajectories.
Modular scoring of each candidate trajectory with terms such as:
- Curvature and curvature rate
- Lateral/longitudinal deviation
- Jerk and smoothness
- Progress toward goal
- Collision or near-collision metrics
Weighting is designed to mirror nonlinear optimisation-based planners, but evaluated over discrete samples.
All synthesised trajectories are evaluated, filtered, and ranked; the minimum-cost feasible trajectory is chosen as the final plan.
Combined trajectory candidates:

cmake -DCMAKE_BUILD_TYPE=Release -B build -S .
cmake --build build --config Release -j8ctest
./MotionPlannerBenchmarks

