openpilot
openpilot copied to clipboard
Subaru: Crosstrek Hybrid support
@martinl got a test route for me?
It appears there are no similar messages on bus 0 to the cruise active status. Most common bits are quite a bit off:
hex(msg)='0x361', bit_mismatches=981 of 3720 (26.37%), byt_idx=1, bit_idx=2
hex(msg)='0x1f9', bit_mismatches=1476 of 6009 (24.56%), byt_idx=5, bit_idx=7
hex(msg)='0x1f9', bit_mismatches=1002 of 6009 (16.67%), byt_idx=5, bit_idx=6
hex(msg)='0x244', bit_mismatches=1589 of 10190 (15.59%), byt_idx=4, bit_idx=3
Searched bus: 0
On bus 2, it gets a bit interesting. There's of course the bit on 0x321 which is what I'm comparing (ES_DashStatus
), but also 0x220 which is (ES_Brake
):
ex(msg)='0x321', bit_mismatches=864 of 2423 (35.66%), byt_idx=5, bit_idx=2
hex(msg)='0x220', bit_mismatches=56 of 4800 (1.17%), byt_idx=0, bit_idx=0
hex(msg)='0x220', bit_mismatches=56 of 4800 (1.17%), byt_idx=4, bit_idx=0
hex(msg)='0x321', bit_mismatches=9 of 2423 (0.37%), byt_idx=4, bit_idx=3
Searched bus: 2
However I checked both signals on older ICE cars, and they proved to be inaccurate, specifically:
-
ES_DashStatus->Cruise_Activated
on Forester 2019 goes low when at a standstill -
ES_DashStatus->Cruise_Activated
on Subaru Impreza 2019 goes low when user is actuating the gas pedal while ACC stays engaged -
ES_Brake->Cruise_Activated
on Subaru Forester 2019 stays high after user disengaged with the brake at a standstill
There's no other similar signals to ES_DashStatus->Cruise_Activated
, so we'll have to verify that this signal on the hybrids don't have these same problems.
This is also missing the hybrid signals for gas and brake: https://github.com/ClockeNessMnstr/openpilot/blob/crosstrek-pid/selfdrive/car/subaru/carstate.py#L23
ES_DashStatus->Cruise_Activated
has the same gas pressed issue, but ES_Brake
does not seem to have the same issue where you press the brake at a standstill and it doesn't fall.
Showing gas pressed behavior:
There is also ES_Status (0x222) Cruise_Activated, I'll check if it behaves differently
On Crosstrek ICE, ES_Status Cruise_Activated is identical to CruiseControl Cruise_Activated signal, I tested with 3 cases above - stopping behind lead car / hold (standstill), disengage using brake while in standstill, gas press while engaged
8de015561e1ea4a0|2022-12-10--14-08-26
I checked Crosstrek Hybrid dbc and it does not have ES_Status message. I'll find the signal once I find someone who can provide route for Crosstrek Hybrid
crosstrek hybrid route: 31d10447d8c7dc19|2023-08-17--07-30-31--0
I'll just merge the hybrid cars behind dashcam, we still need a good cruise_activated bit. Would be helpful to get a forester hybrid route so I can see if they are the same
Can you merge https://github.com/commaai/openpilot/pull/24770 as dashcam after this? Make sure to leave a comment in the code at least of what is required to un-dashcam
Make sure to request a final review before merging