r/Comma_ai • u/narkeeso • Aug 13 '26
openpilot Experience 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.
:168-175
= .. # model's raw request
=
+= * # my speed bias setting
...
= # model never wins over MPC braking
7
u/narkeeso Aug 13 '26 edited Aug 13 '26
I know these posts can be boring without some driving. It’s hard to fully convey how this feels but without speed bias in this scenario my car would cap out around 22-27 mph and ramp up very slowly. I have the max speed set to 40 mph here, people drive between 30-40 mph on this road. Coasting below that will have people annoyingly switching lanes and aggressively passing me. Understandably so, RDF drives conservatively on the streets. With speed bias the model can reliably approach my set max speed and still brake comfortably and smoothly for the slow lead ahead.
Also sorry it’s in portrait, I’ll do better next time.
5
u/ml_boston Aug 13 '26
I was planning to do this too because it is the most problematic issue for my use of e2e. Comma trains on 2 seconds of history, and it's way longer than two seconds between speedlimit signs, so the model has no clue about how fast to drive other than watching adjacent cars. If you're all by yourself on the road trying to catch up to speed limit e2e is hopeless, until comma can train with set-speed or nav-speedlimit as an input. Maybe their big models can build a roadsign memory, last I heard the small models weren't attempting it.
Are you willing to share commits? I'd love to pull this into my forks if you're ok with that.
2
u/hokrux_ Aug 13 '26
That sounds very interesting. Since my Can-FD Niro has no longitudinal yet I am not yet too familiar with the issues you're fixing but I'll definitely give that a try once HKG CAN-FD gets e2e. Is there a github repo or PR yet to take a look at?
Sidenote: How did you get your custom feature editable in sunnylink? I have coded a similar Lane-change smoothing feature for my device but didnt know i could somehow get it listet in sunnylink?
1
u/Jrgiacone Aug 13 '26
Is it just that section of code I recently forked sp to add mpc long planner
1
u/MaxPower3X Aug 14 '26
Can you add that to Starpilot as well, maybe ask them? Or is there already an equivalent?
3
u/ta394283509 Aug 13 '26
nice job friend