commaai / openpilot

openpilot is an operating system for robotics. Currently, it upgrades the driver assistance system in 275+ supported cars.
https://comma.ai/openpilot
MIT License
49.23k stars 8.98k forks source link

Longitudinal tuning tool #26778

Open adeebshihadeh opened 1 year ago

adeebshihadeh commented 1 year ago

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:

sshane commented 1 year ago

@ntegan1 expressed interest in this idea. Want to throw together a PR?

MoreTore commented 1 year ago

https://github.com/commaai/openpilot/discussions/23759#discussioncomment-2638350

ntegan1 commented 1 year ago

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 maneuver1_2