-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Ford: handle metric cruise speed (v2) #31463
Conversation
de6650a
to
baa3318
Compare
ebf60d3
to
a3da901
Compare
@magicparty @chiachunli08 Do either of you want to test this branch for me? |
a3da901
to
ff46388
Compare
selfdrive/car/ford/carstate.py
Outdated
@@ -54,7 +54,8 @@ def update(self, cp, cp_cam): | |||
ret.steerFaultTemporary |= cp.vl["Lane_Assist_Data3_FD1"]["LatCtlSte_D_Stat"] not in (1, 2, 3) | |||
|
|||
# cruise state | |||
ret.cruiseState.speed = cp.vl["EngBrakeData"]["Veh_V_DsplyCcSet"] * CV.MPH_TO_MS | |||
is_metric = cp.vl["INSTRUMENT_PANEL"]["METRIC_UNITS"] == 1 if self.CP.carFingerprint not in CANFD_CAR else False |
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.
Signal does not appear to be present on CAN FD platform (checked 112e4d6e0cad05e1|2023-11-14--08-21-43
) so will keep this for now.
I will test it this weekend |
Thanks for contributing to openpilot! In order for us to review your PR as quickly as possible, check the following:
|
@incognitojam I tested this solution on my car, and it worked. |
@magicparty thank you! can you make the route public? |
There isn't really anything to check if it worked. Ready for review. |
1cd0580
to
0b6ce4a
Compare
**Description** I found a signal which appears to match the IPC "Show km/h" setting. Requires commaai/opendbc#1010. **Verification** - [ ] Test in car and confirm that toggling the "Show km/h" setting does not result in the cruise speed shown in openpilot being incorrect. - [ ] Test in a non-English (metric) car.
0b6ce4a
to
e640e88
Compare
e640e88
to
2d7df6e
Compare
selfdrive/car/ford/carstate.py
Outdated
else: | ||
messages += [ | ||
("INSTRUMENT_PANEL", 10), | ||
] |
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.
Can you check how long this message takes to become valid/present?
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.
Using commaCarSegments
notebook
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.
selfdrive/car/ford/carstate.py
Outdated
@@ -131,6 +132,10 @@ def get_can_parser(CP): | |||
messages += [ | |||
("Lane_Assist_Data3_FD1", 33), | |||
] | |||
else: | |||
messages += [ | |||
("INSTRUMENT_PANEL", 10), |
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.
are you sure this is 10Hz? It's 1Hz on our Bronco, and takes 0.48s to show up on the process replay route (VehicleOperatingModes
is instant for example), which makes sense given it's 1Hz in that route. When it shows up is when carState now goes valid, also making sense.
What does this mean? I'm guessing a change in canValid is not unexpected when adding a new message
That's because it's just expanding the invalid carState
time/messages out to when we see all the CAN messages, it takes 0.79 seconds for the TOYOTA3
route to go valid for example
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.
oh, it was an oversight from me. must be 1Hz
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.
for some reason it's still invalid when freq=1
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.
See
That's because it's just expanding the invalid carState time/messages out to when we see all the CAN messages, it takes 0.79 seconds for the TOYOTA3 route to go valid for example
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.
Oh I thought it would go valid quicker for 1hz than 10hz
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 goes valid when it sees the message
* Ford: handle metric cruise speed (v2) **Description** I found a signal which appears to match the IPC "Show km/h" setting. Requires commaai/opendbc#1010. **Verification** - [ ] Test in car and confirm that toggling the "Show km/h" setting does not result in the cruise speed shown in openpilot being incorrect. - [ ] Test in a non-English (metric) car. * not present on Q4 * fix freq * test * Revert "test" This reverts commit 5e3a9f6. * Update ref_commit --------- Co-authored-by: Shane Smiskol <shane@smiskol.com>
Description
I found a signal which appears to match the IPC "Show km/h" setting.
Requires commaai/opendbc#1010. Previous attempt: #29526.
Closes #29494.
Verification
e886087f430e7fe7/2024-02-14--19-23-28
, in mph:e886087f430e7fe7/2024-02-14--19-27-31
32a35015aa4d5598/2024-03-03--14-58-48