
I finally found the longitudinal lever I've been looking for as an e2e user
I'll open by saying, I am not intending to start another fork but the above setting is my personal fork branched off of sunnypilot. I'm hoping this perhaps starts a conversation around having some vetted tuning for users that are embracing full e2e (DEC off). I'd love for something like this to exist in openpilot or sunnypilot. I'll try creating a PR for Sunnypilot to see what they think, I've driven with this bias all week and I'm over the moon with it.
The default openpilot experience in my RAV4 2023 is not great, it's better than stock ACC but it still makes me uncomfortable when it wants to brake and feels rather robotic. Since then I've discovered that the newest models perform exceptionally well with full experimental, leagues better than stock.
The newer models seem to be getting more careful, more conservative and it leads to a more comfortable ride but it has a major drawback, it drives too slow in certain scenes and doesn't go with the flow of traffic. I was really itching for a lever to modify how fast it thinks it can go in certain scenarios. Driving personalities have almost no affect in this case, I could not tell any difference between aggressive or relaxed. I really needed something where I could tell the model that it can go a little faster without sacrificing its ideal braking behaviors to make stopping comfortable.
There isn't too many levers you can adjust when you use full E2E, the model controls most of the behavior but I did discover it feeds into a parameter called desiredAcceleration. My personal fork has a speed bias setting that allows you to adjust the desired acceleration that's controlled by the model. So in scenarios where a scene would conservatively slow down the car in a coasting situation, the bias pushes the acceleration ever so slightly and the result is that it ends up behaving more like "chill mode" without actually being in chill mode.
My problem with DEC has always been the latency to detect whether it should be in blended mode so that the car can stops in tricky situations, e.g. stopped lead prediction. There's even a warning for the DEC feature on the website that the feature may brake late which is a hard pass for me. This speed bias setting allows us to stay in full experimental mode without any switching and the car drives like the model was trained. Now I get the benefits of DEC chill mode while still preserving comfortable braking behavior of newer models (especially RDF).
One other detail I added was to ensure the speed bias didn't fight when the model wanted to stop early, so I added a simple threshold that detects if the car is intending to stop to fade the speed bias back to 0. This simply means we still get the early stopping benefits. I initially made this it's own parameter to adjust but I found that there was a strong correlation between the speed bias setting and the braking threshold so I simply did braking_threshold = (speed_bias * 2) and that seems to work great.
Moving the bias up or down honestly feels like driving personality to me. The lower settings feel relaxed and the higher settings feel more aggressive. These models still have latency of when to stop so setting this too high will make the car brake uncomfortably late at higher acceleration.
longitudinal_planner.py:168-175
output_a_target_e2e = sm['modelV2'].action.desiredAcceleration # model's raw request
bias_scale = np.clip((output_a_target_e2e + 2.0 * self._e2e_bias) / 0.3, 0.0, 1.0)
output_a_target_e2e += self._e2e_bias * bias_scale # my speed bias setting
...
if self.is_e2e(sm):
output_a_target = min(output_a_target_e2e, output_a_target_mpc) # model never wins over MPC braking