-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove steering wheel offset for planner slow down for curves #33827
Conversation
While using the VM here with roll is correct, we have avoided making this change as these limits were found via in-car testing a few years ago to be comfortable and we don't want to change behavior until we decide to spend more time re-tuning them. Can you only include the angle offset fix here? That is more immediately mergable. |
Thanks Shane. I've reverted the use of vehicle model as you suggest. Now it's just the addition of angle offset (and cleanup of the repeated use of |
The cleanup aspect is a little debatable, the style in which Could we leave that aside, at least for now? It's a good practice for null-effect refactors/cleanups to be considered separately from functional changes like this. If we just recalculate the angle, right next to the calibrated_steer_angle = sm['carState'].steeringAngleDeg - sm['liveParameters'].angleOffsetAverageDeg Then this becomes a three-line PR with the nature of the change visually obvious. |
thanks for the PR! I hope you can see how this diff is much easier to merge immediately vs the original commit. It's a straightforward bugfix for the behavior |
Yes. Much cleaner this way. Thanks Shane and Jason! |
Description
In
selfdrive/controls/lib/longitudinal_planner.py
, thelimit_accel_in_turns()
function limits long accel based on lat accel. It uses a back of the hand calculation of lateral accel based on steering angle that does not include a car's steer angle offset (as observed byliveParams
). In cars with a large steer offset, thecarState
steer angle can be high enough when traveling in a straight line that this function ends up limiting long accel. This problem is reported in #33667.Additionally,
limit_accel_in_turns()
has aFIXME
comment: "This function to calculate lateral accel is incorrect and should use the VehicleModel"This PR implements this
FIXME
change, using aVehicleModel
updated withliveParams
values to calculate lateral accel more accurately. It also includesliveParams
average steer angle offset in order to fix the problem described above.Verification
Awaiting verification route on this commit
@garrettpall drove on these changes and verified the problem is resolved and everything drives as it should. However that was not on this specific commit.
Fixes #33667