-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Improved steering accuracy measurement script #23583
Conversation
I added an average for absolute actuators.steer, the fraction of total output torque used for non-angle controls, though I'm taking it before car port rate limiting. I also added an average for absolute lateralPlan.dPathPoints. I'm not quite sure how it's defined or what its unit of measure is, but it seems to show how far off we are from the planned path. It's not a measure of steering accuracy, but it might help us understand driving stability and quality as we approach controllable maximums.
|
Let's put this in a new directory called |
Will do. Also planning some other rework after chatting with Harald, but I'm out of time for OP stuff this week. Notes to self:
|
speed_group_stats[group][angle_abs]["dpp"] += abs(d_path_points[0]) | ||
if control_state.saturated: | ||
speed_group_stats[group][angle_abs]["saturated"] += 1 | ||
if actual_angle == desired_angle: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if actual_angle == desired_angle: | |
if angle_error <= .5: |
Edit: angle error less than half a degree makes a pretty useful bin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think I follow. Both actual_angle
and desired_angle
are rounded to one decimal point, so the comparison should work as desired. Only angle_abs
is rounded to int, and that only determines which bucket the stats go in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I misread the precision. So:
1.04 =/= 1.06 but .96 == 1.04.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So angle_error <= .05, would be more consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we'll have any angle_error <= 0.05
because I think (except maybe ZSS-upgraded Toyota?) we have no vehicles with steering angle precisions better than 0.1 degree. The error will either be zero, or >= 0.1 degrees.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, fair enough. Although that begs the question, why even have the "==" column.
Something like <= .5 would make the == column a more meaningful bin/stat.
With <=.5, Output like below is much more useful as the over/under are actually measuring a more meaningful value as well.
0° | actuator: 24% | error: 0.51° | -: 12%:- | =: 58%:= | +: 28%:+ | sat cnt: 0 | dppnts: 0.14 | total: 714
1° | actuator: 19% | error: 0.40° | -: 11%:- | =: 70%:= | +: 17%:+ | sat cnt: 0 | dppnts: 0.09 | total: 1865
2° | actuator: 18% | error: 0.39° | -: 20%:- | =: 76%:= | +: 3%:+ | sat cnt: 0 | dppnts: 0.08 | total: 2156
3° | actuator: 30% | error: 0.62° | -: 63%:- | =: 33%:= | +: 3%:+ | sat cnt: 0 | dppnts: 0.08 | total: 737
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Desired angle is not limited by precision, so angle error is rarely zero, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's rounded here so the match will "work" but it's still rarely zero just because it's so restrictive.
Making the comparison right at the limit of resolution also means that rounding error is significant. Something like 25% error although it should average out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hehe, yes angle_error <= 0.05 because I think (except maybe ZSS-upgraded Toyota?)
ZSS goes down to something like 0.0000001 😂
Was playing around with this. found a useful argument to add for myself at least.
|
a14d7fa
to
683452a
Compare
683452a
to
e584f83
Compare
|
Ready for consideration. There are more things I'd like to do with this script, like make it take a route instead of require replay, stop trying to combine negative and positive steering angles so we can look at road crown effects properly, and add comparison of curvatures instead of just steering angles. However, this is a good-enough checkpoint and I've verified it works on routes from current master. Looking forward to feedback and contributions from others interested in tuning. |
For lack of a better place to share/commemorate it, here's an interesting result from @Verylukyguy:
He's having pingpong problems on the straights. You can see in the results for the 1 and 2 degree angles he not only has relatively high error, but the error is very heavily weighted in one direction. This may be due to road crown, or perhaps front-end alignment. I think his EPS doesn't do any straight-line driving compensation, or perhaps it isn't factored into the LKAS API that openpilot uses. This is surprisingly un-obvious in PlogJuggler unless you're really looking for it, but the accuracy script from this PR highlights it nicely. If the other Acadias out there have similar problems, they probably need some integral. Acadia integral is set to zero right now in upstream master. |
I'll just merge this, we can always make more improvements later. |
* move steering accuracy measurement script * git rebase is utterly worthless * fix header width
This script clearly hasn't been used in awhile. Made some improvements while I was fixing it up.
active
, notenabled
Example output:
This made it useful for me, but waiting for replay to run is lame. I may follow up with an option to use LogReader.