-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Slimming down carState
#2499
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
Slimming down carState
#2499
Conversation
# clutch (manual transmission only) | ||
clutchPressed @28 :Bool; | ||
|
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.
is this used for USER_DISABLE?
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.
apparently not
(openpilot) 1 batman@workstation-adeeb2:~/fourpilot$ rg -i clutchpress selfdrive/
(openpilot) 1 batman@workstation-adeeb2:~/fourpilot$
@@ -108,7 +108,7 @@ def update(self, CC, CS, now_nanos): | |||
apply_curvature = actuators.curvature | |||
|
|||
# apply rate limits, curvature error limit, and clip to signal range | |||
current_curvature = -CS.out.yawRate / max(CS.out.vEgoRaw, 0.1) | |||
current_curvature = 0 # TODO: calculate from alternative source, yawRate deprecated |
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.
this is for the safety. just pull it from CS.yaw_rate
@@ -34,15 +34,13 @@ def update(self, can_parsers) -> structs.CarState: | |||
# car speed | |||
ret.vEgoRaw = cp.vl["BrakeSysFeatures"]["Veh_V_ActlBrk"] * CV.KPH_TO_MS | |||
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw) | |||
ret.yawRate = cp.vl["Yaw_Data_FD1"]["VehYaw_W_Actl"] |
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.
self.yaw_rate = cp.vl["Yaw_Data_FD1"]["VehYaw_W_Actl"]
# >100 degree/sec steering fault prevention (steeringRateDeg deprecated, disabling check) | ||
self.steer_rate_counter, apply_steer_req = common_fault_avoidance(False, lat_active, |
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.
this is a huge downgrade...
I think it makes sense to start to remove unnecessary fields |
I'm good with these. Wheel speeds are obviously safety relevant, but we keep the important outcomes in the form of
Weak preference to keep this. It's just a bool, and it'll be necessary later for a good OP long experience. Cars with ACC and MT tend to stay engaged for a few seconds while shifting, but we want to reject initial entry, and we'll want to freeze or even reset the gas/accel integrator. We're not doing these things yet, but I don't want to lose the prerequisite signals.
Not stoked about losing convenient views of these, given their active use in safety/fault-mitigation in a few ports, but life would go on. Other fields
Other ideas
|
Removed for now. Easy enough to add back if necessary.
Potentially. There is a meaningful difference in that
So the qlogs were really just a bonus. It's more about separating the necessary vs the nice-to-haves, and at the very least, I think we need a different file if we want to bring back the nice-to-haves. |
Alright, pretty much done with the first pass at this. It's clear that there's lot more to do here on a per-port basis. Some examples:
|
The current car port backlog is untenable. While this isn't a magic bullet, I think the first step is to strip out anything that's not strictly necessary for openpilot. These fields may have become luxuries we can no longer afford.
Our API to the car is essentially
carstate.py
andcarcontroller.py
, and the more we reduce that surface area, the easier porting, fingerprinting, and maintenance will be.@sshane @jyoung8607 Any thoughts? This is a fairly aggressive pass at
carState
. As a side benefit, the smallercarState
means we can throw more of them in qlogs.