Skip to content
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

Honda: 2021-25 Honda Odyssey (dashcam) #1330

Draft
wants to merge 75 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
422785f
Honda Odyssey 21-24
csouers Sep 8, 2024
40a9969
bump up so docs match ui
csouers Sep 8, 2024
c87fb96
add 2025 elite. lots of new ids.
csouers Sep 10, 2024
c754f6c
more fingerprints. add more dongles
csouers Sep 10, 2024
1b23c61
a real steer_fault resets the counter too
csouers Sep 12, 2024
5a88343
rm newline
csouers Sep 24, 2024
983fe3a
cleaner
csouers Sep 24, 2024
c0ddd63
putting this here
csouers Sep 24, 2024
8f55f0e
default values are op long. add footnote
csouers Sep 24, 2024
4ae7c61
docs the other way
csouers Sep 25, 2024
d6e23f6
rework
csouers Sep 25, 2024
d0afcec
fix
csouers Sep 25, 2024
0222440
fix.
csouers Sep 25, 2024
8783d57
split off
csouers Sep 25, 2024
bce872f
stuff
csouers Sep 25, 2024
45360a7
rename. change to speed
csouers Sep 28, 2024
2d01a08
Merge commit '173ab90402f85c07cd65750c7f31cc97a8b07d59' into odyssey_…
csouers Sep 29, 2024
03b955f
comment
csouers Sep 29, 2024
6b64f32
github actions on push
csouers Sep 29, 2024
fc74cfb
rip fw ids
csouers Sep 29, 2024
c52deb4
shift
csouers Sep 29, 2024
3f82d2f
less
csouers Oct 2, 2024
c49830b
verify the door ajar stuff
csouers Oct 2, 2024
7dfce86
verify this too
csouers Oct 2, 2024
e2e507f
put back
csouers Oct 2, 2024
dd07050
comment
csouers Oct 2, 2024
d9a1698
put odysseybosch here too
csouers Oct 2, 2024
d89a281
less
csouers Oct 2, 2024
6fdff55
comment
csouers Oct 2, 2024
6a1cb48
merge
csouers Oct 2, 2024
70c2766
Merge commit 'ea87b4fa3ba98a71c2c8e93c97788fb0fa960d55' into odyssey_…
csouers Oct 2, 2024
f271739
Merge remote-tracking branch 'upstream/master' into odyssey_bosch
csouers Oct 2, 2024
ff5441d
back to normal
csouers Oct 2, 2024
4e0d311
clearer
csouers Oct 2, 2024
c5d3f64
bump year
csouers Oct 2, 2024
1856b0b
comment
csouers Oct 2, 2024
9a916b7
comment
csouers Oct 2, 2024
ff34fef
Merge remote-tracking branch 'upstream/master' into odyssey_bosch
csouers Oct 2, 2024
45c8c46
comment
csouers Oct 2, 2024
a0ead1e
add comment for later
csouers Oct 2, 2024
d3fa732
empty space
csouers Oct 2, 2024
84cadc2
Merge remote-tracking branch 'upstream/master' into odyssey_bosch
csouers Oct 3, 2024
5b8da4e
rename that
csouers Oct 3, 2024
8cb117e
better
csouers Oct 3, 2024
b5aab9b
move this here
csouers Oct 3, 2024
9b80a5e
better
csouers Oct 3, 2024
657fe14
Merge remote-tracking branch 'upstream/master' into odyssey_bosch
csouers Oct 3, 2024
b9bc1b4
just gotta find this last one
csouers Oct 3, 2024
c12311d
found one
csouers Oct 3, 2024
ae5a256
naming and comments
csouers Oct 3, 2024
439978a
move over
csouers Oct 3, 2024
7e5109a
dashcam mode
csouers Oct 3, 2024
faa025a
move back down
csouers Oct 3, 2024
7f7930b
Merge remote-tracking branch 'upstream/master' into odyssey_bosch
csouers Oct 3, 2024
aa240a1
Merge remote-tracking branch 'upstream/master' into odyssey_bosch
csouers Oct 4, 2024
a51988f
don't need to check if docs anymore
csouers Oct 4, 2024
1757ccb
add pt loopback in values
csouers Oct 4, 2024
772be67
final name
csouers Oct 4, 2024
275a470
wip. loopback. don't store state. combine these.
csouers Oct 4, 2024
921bad9
Comments. Should still alert at least a little above the enable.
csouers Oct 5, 2024
5dbfc92
comment
csouers Oct 5, 2024
2e2c47e
comment. tweak
csouers Oct 6, 2024
46043ad
Merge remote-tracking branch 'upstream/master' into odyssey_bosch
csouers Oct 6, 2024
888669c
still working on the policy. need to better handle driving near the l…
csouers Oct 6, 2024
ede620a
this might be good to go
csouers Oct 6, 2024
bb57a39
unfinished
csouers Oct 6, 2024
572873a
yeah idk about this yet
csouers Oct 6, 2024
56f521f
adjust
csouers Oct 7, 2024
7168694
move to top like other makes
csouers Oct 7, 2024
23d72af
rm new line
csouers Oct 7, 2024
a8082f0
condense
csouers Oct 8, 2024
c236335
more readable
csouers Oct 8, 2024
83b1108
move
csouers Oct 8, 2024
cfb9be0
put back for now
csouers Oct 8, 2024
dc5d6ef
not pt. always bus 0 on honda
csouers Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions opendbc/car/honda/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from opendbc.can.can_define import CANDefine
from opendbc.can.parser import CANParser
from opendbc.car import create_button_events, structs
from opendbc.car import create_button_events, structs, DT_CTRL
from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.common.numpy_fast import interp
from opendbc.car.honda.hondacan import CanBus, get_cruise_speed_conversion
Expand Down Expand Up @@ -44,7 +44,7 @@ def get_can_messages(CP, gearbox_msg):
("SCM_BUTTONS", 25),
]

if CP.carFingerprint in (CAR.HONDA_CRV_HYBRID, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.ACURA_RDX_3G, CAR.HONDA_E):
if CP.carFingerprint in (CAR.HONDA_CRV_HYBRID, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.HONDA_ODYSSEY_BOSCH):
messages.append((gearbox_msg, 50))
else:
messages.append((gearbox_msg, 100))
Expand All @@ -69,6 +69,7 @@ def get_can_messages(CP, gearbox_msg):
messages.append(("CRUISE_PARAMS", 50))

# TODO: clean this up
# TODO: verify odyssey_bosch
if CP.carFingerprint in (CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.HONDA_INSIGHT,
CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.HONDA_CIVIC_2022, CAR.HONDA_HRV_3G):
pass
Expand Down Expand Up @@ -99,6 +100,8 @@ def __init__(self, CP):

self.shifter_values = can_define.dv[self.gearbox_msg]["GEAR_SHIFTER"]
self.steer_status_values = defaultdict(lambda: "UNKNOWN", can_define.dv["STEER_STATUS"]["STEER_STATUS"])
self.steer_off_cnt = 0
self.min_steer_alert_speed = self.CP.minSteerSpeed

self.brake_switch_prev = False
self.brake_switch_active = False
Expand Down Expand Up @@ -129,6 +132,7 @@ def update(self, cp, cp_cam, _, cp_body, __) -> structs.CarState:
# STANDSTILL->WHEELS_MOVING bit can be noisy around zero, so use XMISSION_SPEED
# panda checks if the signal is non-zero
ret.standstill = cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] < 1e-5
# TODO: verify odyssey_bosch
# TODO: find a common signal across all cars
if self.CP.carFingerprint in (CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_BOSCH_DIESEL, CAR.HONDA_CRV_HYBRID, CAR.HONDA_INSIGHT,
CAR.ACURA_RDX_3G, CAR.HONDA_E, CAR.HONDA_CIVIC_2022, CAR.HONDA_HRV_3G):
Expand All @@ -140,12 +144,20 @@ def update(self, cp, cp_cam, _, cp_body, __) -> structs.CarState:
cp.vl["DOORS_STATUS"]["DOOR_OPEN_RL"], cp.vl["DOORS_STATUS"]["DOOR_OPEN_RR"]])
ret.seatbeltUnlatched = bool(cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LAMP"] or not cp.vl["SEATBELT_STATUS"]["SEATBELT_DRIVER_LATCHED"])

# Triggered by STEER_TORQUE_REQUEST in CAN frame STEERING_CONTROL
self.eps_steer_active = bool(cp.vl["STEER_STATUS"]["STEER_CONTROL_ACTIVE"])
steer_status = self.steer_status_values[cp.vl["STEER_STATUS"]["STEER_STATUS"]]
ret.steerFaultPermanent = steer_status not in ("NORMAL", "NO_TORQUE_ALERT_1", "NO_TORQUE_ALERT_2", "LOW_SPEED_LOCKOUT", "TMP_FAULT")
# LOW_SPEED_LOCKOUT is not worth a warning
# NO_TORQUE_ALERT_2 can be caused by bump or steering nudge from driver
ret.steerFaultTemporary = steer_status not in ("NORMAL", "LOW_SPEED_LOCKOUT", "NO_TORQUE_ALERT_2")

# Return a fault if the car hasn't enabled steering. Latches on until disengaged or if the EPS reports a fault.
if self.CP.carFingerprint == CAR.HONDA_ODYSSEY_BOSCH and not self.CP.openpilotLongitudinalControl:
if ret.steerFaultTemporary:
self.steer_off_cnt = 0
ret.steerFaultTemporary |= self.steer_off_cnt >= int(1. / DT_CTRL)

if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS:
ret.accFaulted = bool(cp.vl["CRUISE_FAULT_STATUS"]["CRUISE_FAULT"])
else:
Expand Down Expand Up @@ -257,6 +269,21 @@ def update(self, cp, cp_cam, _, cp_body, __) -> structs.CarState:
if self.CP.carFingerprint in HONDA_BOSCH_RADARLESS:
self.lkas_hud = cp_cam.vl["LKAS_HUD"]

# # Low speed steer alert logic; for cars with steer cut off above 6 m/s
csouers marked this conversation as resolved.
Show resolved Hide resolved
# # Show the alert earlier when slowing. Must first exceed a greater speed while engaged.
# if ret.vEgo > (self.CP.minSteerSpeed + 3.5):
# self.min_steer_alert_speed = (self.CP.minSteerSpeed + 1.5)
# elif not CC.latActive:
# self.min_steer_alert_speed = self.CP.minSteerSpeed
# ret.lowSpeedAlert = (0 < ret.vEgo <= self.min_steer_alert_speed) and self.CP.minSteerSpeed > 6.0

# # Some cars forcibly disengage steering depending on vehicle conditions (i.e. some Odyssey Bosch & late model Acura RDX 3G).
# # carState sets the steerFaultTemporary flag if controls are on and steering has not engaged within 1 second.
# if CC.latActive and not self.steer_on: # type: ignore[attr-defined]
# self.steer_off_cnt += 1 # type: ignore[attr-defined]
# else:
# self.steer_off_cnt = 0 # type: ignore[attr-defined]

if self.CP.enableBsm:
# BSM messages are on B-CAN, requires a panda forwarding B-CAN messages to CAN 0
# more info here: https://github.com/commaai/openpilot/pull/1867
Expand Down
38 changes: 38 additions & 0 deletions opendbc/car/honda/fingerprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,44 @@
b'77959-T6A-P110\x00\x00',
],
},
CAR.HONDA_ODYSSEY_BOSCH: {
csouers marked this conversation as resolved.
Show resolved Hide resolved
(Ecu.transmission, 0x18da1ef1, None): [
b'28102-5MX-A100\x00\x00',
b'28102-5MX-A200\x00\x00',
b'28102-5MX-A410\x00\x00',
b'28102-5MX-C100\x00\x00',
],
(Ecu.electricBrakeBooster, 0x18da2bf1, None): [
b'46114-THR-A530\x00\x00',
b'46114-THR-A540\x00\x00',
b'46114-THR-A720\x00\x00',
],
(Ecu.gateway, 0x18daeff1, None): [
b'38897-THR-A130\x00\x00',
b'38897-THR-A320\x00\x00',
b'38897-THR-A410\x00\x00',
],
(Ecu.eps, 0x18da30f1, None): [
b'39990-THR-A050\x00\x00',
b'39990-THR-A110\x00\x00',
],
(Ecu.fwdRadar, 0x18dab0f1, None): [b'36802-THR-A220\x00\x00'],
(Ecu.fwdCamera, 0x18dab5f1, None): [
b'36161-THR-A220\x00\x00',
b'36161-THR-A230\x00\x00',
],
(Ecu.shiftByWire, 0x18da0bf1, None): [b'54008-THR-A310\x00\x00'],
(Ecu.srs, 0x18da53f1, None): [
b'77959-THR-A220\x00\x00',
b'77959-THR-A230\x00\x00',
b'77959-THR-A320\x00\x00',
],
(Ecu.vsa, 0x18da28f1, None): [
b'57114-THR-A230\x00\x00',
b'57114-THR-A240\x00\x00',
b'57114-THR-A520\x00\x00',
],
},
CAR.HONDA_PILOT: {
(Ecu.shiftByWire, 0x18da0bf1, None): [
b'54008-TG7-A520\x00\x00',
Expand Down
3 changes: 2 additions & 1 deletion opendbc/car/honda/hondacan.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ def get_lkas_cmd_bus(CAN, car_fingerprint, radar_disabled=False):

def get_cruise_speed_conversion(car_fingerprint: str, is_metric: bool) -> float:
# on certain cars, CRUISE_SPEED changes to imperial with car's unit setting
return CV.MPH_TO_MS if car_fingerprint in HONDA_BOSCH_RADARLESS and not is_metric else CV.KPH_TO_MS
# TODO: ODYSSEY_BOSCH; Verify on both market spec models w/ both dashboard unit settings
return CV.MPH_TO_MS if car_fingerprint in (HONDA_BOSCH_RADARLESS | {CAR.HONDA_ODYSSEY_BOSCH}) and not is_metric else CV.KPH_TO_MS


def create_brake_command(packer, CAN, apply_brake, pump_on, pcm_override, pcm_cancel_cmd, fcw, car_fingerprint, stock_brake):
Expand Down
9 changes: 9 additions & 0 deletions opendbc/car/honda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ def _get_params(ret: structs.CarParams, candidate, fingerprint, car_fw, experime
else:
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end

elif candidate == CAR.HONDA_ODYSSEY_BOSCH:
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.28], [0.08]]
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end
if not ret.openpilotLongitudinalControl:
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 3840], [0, 3840]] # clipped by the radar
# TODO: change minSteerSpeed in values.py and remove this once Honda Bosch w/OP long is in release
elif not docs:
ret.minSteerSpeed = 0.

elif candidate == CAR.HONDA_PILOT:
ret.lateralParams.torqueBP, ret.lateralParams.torqueV = [[0, 4096], [0, 4096]] # TODO: determine if there is a dead zone at the top end
ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.38], [0.11]]
Expand Down
14 changes: 12 additions & 2 deletions opendbc/car/honda/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ class Footnote(Enum):
CIVIC_DIESEL = CarFootnote(
"2019 Honda Civic 1.6L Diesel Sedan does not have ALC below 12mph.",
Column.FSR_STEERING)
OP_STEER_TO_ZERO = CarFootnote(
"This car is capable of ALC at all speeds when openpilot ACC is enabled. " +
"<b><i>NOTE: The car's radar and all related features such as AEB and FCW will be disabled.</i></b>",
Column.FSR_STEERING)


class HondaBoschPlatformConfig(PlatformConfig):
Expand Down Expand Up @@ -170,6 +174,12 @@ class CAR(Platforms):
dbc_dict('honda_civic_ex_2022_can_generated', None),
flags=HondaFlags.BOSCH_RADARLESS,
)
HONDA_ODYSSEY_BOSCH = HondaBoschPlatformConfig(
[HondaCarDocs("Honda Odyssey 2021-25", "All", footnotes=[Footnote.OP_STEER_TO_ZERO])],
CarSpecs(mass=2087, wheelbase=3.0, steerRatio=14.35, centerToFrontRatio=0.41, tireStiffnessFactor=0.82, minSteerSpeed=47. * CV.MPH_TO_MS),
dbc_dict('acura_rdx_2020_can_generated', None),
flags=HondaFlags.BOSCH_ALT_BRAKE,
)
ACURA_RDX_3G = HondaBoschPlatformConfig(
[HondaCarDocs("Acura RDX 2019-22", "All", min_steer_speed=3. * CV.MPH_TO_MS)],
CarSpecs(mass=4068 * CV.LB_TO_KG, wheelbase=2.75, steerRatio=11.95, centerToFrontRatio=0.41, tireStiffnessFactor=0.677), # as spec
Expand Down Expand Up @@ -304,9 +314,9 @@ class CAR(Platforms):
# Note that we still attempt to match with them when they are present
# This is or'd with (ALL_ECUS - ESSENTIAL_ECUS) from fw_versions.py
non_essential_ecus={
Ecu.eps: [CAR.ACURA_RDX_3G, CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_2022, CAR.HONDA_E, CAR.HONDA_HRV_3G],
Ecu.eps: [CAR.ACURA_RDX_3G, CAR.HONDA_ACCORD, CAR.HONDA_CIVIC_2022, CAR.HONDA_E, CAR.HONDA_HRV_3G, CAR.HONDA_ODYSSEY_BOSCH],
Ecu.vsa: [CAR.ACURA_RDX_3G, CAR.HONDA_ACCORD, CAR.HONDA_CIVIC, CAR.HONDA_CIVIC_BOSCH, CAR.HONDA_CIVIC_2022, CAR.HONDA_CRV_5G, CAR.HONDA_CRV_HYBRID,
CAR.HONDA_E, CAR.HONDA_HRV_3G, CAR.HONDA_INSIGHT],
CAR.HONDA_E, CAR.HONDA_HRV_3G, CAR.HONDA_INSIGHT, CAR.HONDA_ODYSSEY_BOSCH],
},
extra_ecus=[
(Ecu.combinationMeter, 0x18da60f1, None),
Expand Down
2 changes: 2 additions & 0 deletions opendbc/car/tests/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ class CarTestRoute(NamedTuple):
CarTestRoute("f29e2b57a55e7ad5|2021-03-24--20-52-38", HONDA.HONDA_ACCORD), # hybrid, 2021 with new style HUD msgs
CarTestRoute("1ad763dd22ef1a0e|2020-02-29--18-37-03", HONDA.HONDA_CRV_5G),
CarTestRoute("0a96f86fcfe35964|2020-02-05--07-25-51", HONDA.HONDA_ODYSSEY),
# TODO: UPDATE THIS
CarTestRoute("c443ca9eee127f66|2022-08-22--19-25-29", HONDA.HONDA_ODYSSEY_BOSCH),
Comment on lines +98 to +99
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does need an update, that route is no longer available. Would be great if you can get one, but it's not an absolute blocker for dashcam merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update the user branch and ask for a new route

CarTestRoute("d83f36766f8012a5|2020-02-05--18-42-21", HONDA.HONDA_CIVIC_BOSCH_DIESEL),
CarTestRoute("f0890d16a07a236b|2021-05-25--17-27-22", HONDA.HONDA_INSIGHT),
CarTestRoute("07d37d27996096b6|2020-03-04--21-57-27", HONDA.HONDA_PILOT),
Expand Down
1 change: 1 addition & 0 deletions opendbc/car/torque_data/substitute.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
"HONDA_CIVIC_BOSCH_DIESEL" = "HONDA_CIVIC_BOSCH"
"HONDA_E" = "HONDA_CIVIC_BOSCH"
"HONDA_ODYSSEY_CHN" = "HONDA_ODYSSEY"
"HONDA_ODYSSEY_BOSCH" = "HONDA_ODYSSEY"

"BUICK_LACROSSE" = "CHEVROLET_VOLT"
"BUICK_REGAL" = "CHEVROLET_VOLT"
Expand Down
Loading