openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

Longitudinal tuning tool

Open adeebshihadeh opened this issue 2 years ago • 2 comments

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

adeebshihadeh avatar Dec 13 '22 03:12 adeebshihadeh

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

sshane avatar Dec 13 '22 03:12 sshane

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

MoreTore avatar Dec 28 '22 01:12 MoreTore

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

ntegan1 avatar Feb 23 '23 22:02 ntegan1