openpilot
openpilot copied to clipboard
Longitudinal tuning tool
Longitudinal tuning is currently difficult due to the lack of repeatability and reproducibility. Let's make a tool that allows us to specify maneuvers and repeat them reliably, input at a similar place in openpilot to the joystick. With this tool, the workflow becomes:
- make a change
- test it X times on all the maneuvers specified in the tool
- check the plots with a nice PlotJuggler layout
@ntegan1 expressed interest in this idea. Want to throw together a PR?
https://github.com/commaai/openpilot/discussions/23759#discussioncomment-2638350
Finished a proof of concept that takes a Maneuver and performs it while requested. Can be performed multiple times in a row. Tested by performing the maneuver while SDSU forwarded distance button is held down.
The Maneuver is defined by an array of 3-length tuples holding velocity and acceleration values along with the time breakpoint for interpolation.
I tested out two different hardcoded maneuvers to verify aEgo and vEgo attempt to follow the maneuver/plan.
Upon maneuver request, the longitudinal plan is replaced by the maneuver interpolated into CONTROL_N / T_IDXS.
code, videos, and more data are here. https://github.com/ntegan1/apilot/pull/16
This image shows an example maneuver definition and highlights in plotjuggler where the various maneuver breakpoints are reached