Trajectory Planner Example
This example demonstrates how to use espp::TrajectoryPlanner to smooth
normalized joystick velocity commands (v_cmd, w_cmd) into dynamically
feasible chassis motion commands (v_ref, w_ref).
Four scenarios are covered:
Quick-start - walks through every public API call in sequence (
set_target,get_target,output,set_config,stop,reset,is_running).S-curve driving / trapezoidal stop - jerk-limited ramp-up at
planning_period = 50 msfollowed by a trapezoidal (no-jerk) stop.High-speed S-curve - combined linear + angular jerk-limited motion with motion envelope and centripetal acceleration enforcement.
Constraint validation - automated pass/fail checks on every output tick:
Speed vs.
max_linear_velocity/max_angular_velocityAcceleration vs.
driving_profileorstopping_profilelimitsJerk vs. configured jerk limits
Centripetal acceleration
|v * w|Results reported separately for driving and stopping phases.
Result:
Building
idf.py build
Running
idf.py flash monitor