Honda: use new Bosch LKAS_HUD messages (#23000)
* Honda: use new Bosch LKAS_HUD messages * enum value * better name * flip thatpull/23136/head
parent
cc1699707f
commit
0283942a95
2
cereal
2
cereal
|
@ -1 +1 @@
|
|||
Subproject commit 486a09a2e9a8c4ae5bb2853a9bef2b64e875f883
|
||||
Subproject commit e5a04ab458afd52cf630cc9e35ccdc10efba6688
|
2
panda
2
panda
|
@ -1 +1 @@
|
|||
Subproject commit 89438c849befe688f149dd52867ea2aacc766486
|
||||
Subproject commit 652367d2e82f21f996c2217857d20ea05567ad62
|
|
@ -244,6 +244,6 @@ class CarController():
|
|||
# Send dashboard UI commands.
|
||||
if (frame % 10) == 0:
|
||||
idx = (frame//10) % 4
|
||||
can_sends.extend(hondacan.create_ui_commands(self.packer, pcm_speed, hud, CS.CP.carFingerprint, CS.is_metric, idx, CS.CP.openpilotLongitudinalControl, CS.stock_hud))
|
||||
can_sends.extend(hondacan.create_ui_commands(self.packer, CS.CP, pcm_speed, hud, CS.is_metric, idx, CS.stock_hud))
|
||||
|
||||
return can_sends
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from selfdrive.car.honda.values import HONDA_BOSCH, CAR, CarControllerParams
|
||||
from selfdrive.car.honda.values import HondaFlags, HONDA_BOSCH, CAR, CarControllerParams
|
||||
from selfdrive.config import Conversions as CV
|
||||
|
||||
# CAN bus layout with relay
|
||||
|
@ -98,14 +98,14 @@ def create_bosch_supplemental_1(packer, car_fingerprint, idx):
|
|||
return packer.make_can_msg("BOSCH_SUPPLEMENTAL_1", bus, values, idx)
|
||||
|
||||
|
||||
def create_ui_commands(packer, pcm_speed, hud, car_fingerprint, is_metric, idx, openpilot_longitudinal_control, stock_hud):
|
||||
def create_ui_commands(packer, CP, pcm_speed, hud, is_metric, idx, stock_hud):
|
||||
commands = []
|
||||
bus_pt = get_pt_bus(car_fingerprint)
|
||||
radar_disabled = car_fingerprint in HONDA_BOSCH and openpilot_longitudinal_control
|
||||
bus_lkas = get_lkas_cmd_bus(car_fingerprint, radar_disabled)
|
||||
bus_pt = get_pt_bus(CP.carFingerprint)
|
||||
radar_disabled = CP.carFingerprint in HONDA_BOSCH and CP.openpilotLongitudinalControl
|
||||
bus_lkas = get_lkas_cmd_bus(CP.carFingerprint, radar_disabled)
|
||||
|
||||
if openpilot_longitudinal_control:
|
||||
if car_fingerprint in HONDA_BOSCH:
|
||||
if CP.openpilotLongitudinalControl:
|
||||
if CP.carFingerprint in HONDA_BOSCH:
|
||||
acc_hud_values = {
|
||||
'CRUISE_SPEED': hud.v_cruise,
|
||||
'ENABLE_MINI_CAR': 1,
|
||||
|
@ -142,16 +142,24 @@ def create_ui_commands(packer, pcm_speed, hud, car_fingerprint, is_metric, idx,
|
|||
'SOLID_LANES': hud.lanes,
|
||||
'BEEP': 0,
|
||||
}
|
||||
commands.append(packer.make_can_msg('LKAS_HUD', bus_lkas, lkas_hud_values, idx))
|
||||
|
||||
if radar_disabled and car_fingerprint in HONDA_BOSCH:
|
||||
if not (CP.flags & HondaFlags.BOSCH_EXT_HUD):
|
||||
lkas_hud_values['SET_ME_X48'] = 0x48
|
||||
|
||||
if CP.flags & HondaFlags.BOSCH_EXT_HUD and not CP.openpilotLongitudinalControl:
|
||||
commands.append(packer.make_can_msg('LKAS_HUD_A', bus_lkas, lkas_hud_values, idx))
|
||||
commands.append(packer.make_can_msg('LKAS_HUD_B', bus_lkas, lkas_hud_values, idx))
|
||||
else:
|
||||
commands.append(packer.make_can_msg('LKAS_HUD', bus_lkas, lkas_hud_values, idx))
|
||||
|
||||
if radar_disabled and CP.carFingerprint in HONDA_BOSCH:
|
||||
radar_hud_values = {
|
||||
'CMBS_OFF': 0x01,
|
||||
'SET_TO_1': 0x01,
|
||||
}
|
||||
commands.append(packer.make_can_msg('RADAR_HUD', bus_pt, radar_hud_values, idx))
|
||||
|
||||
if car_fingerprint == CAR.CIVIC_BOSCH:
|
||||
if CP.carFingerprint == CAR.CIVIC_BOSCH:
|
||||
commands.append(packer.make_can_msg("LEGACY_BRAKE_COMMAND", bus_pt, {}, idx))
|
||||
|
||||
return commands
|
||||
|
|
|
@ -3,7 +3,7 @@ from cereal import car
|
|||
from panda import Panda
|
||||
from common.numpy_fast import interp
|
||||
from common.params import Params
|
||||
from selfdrive.car.honda.values import CarControllerParams, CruiseButtons, CAR, HONDA_BOSCH, HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_ALT_BRAKE_SIGNAL
|
||||
from selfdrive.car.honda.values import CarControllerParams, CruiseButtons, HondaFlags, CAR, HONDA_BOSCH, HONDA_NIDEC_ALT_SCM_MESSAGES, HONDA_BOSCH_ALT_BRAKE_SIGNAL
|
||||
from selfdrive.car import STD_CARGO_KG, CivicParams, scale_rot_inertia, scale_tire_stiffness, gen_empty_fingerprint, get_safety_config
|
||||
from selfdrive.car.interfaces import CarInterfaceBase
|
||||
from selfdrive.car.disable_ecu import disable_ecu
|
||||
|
@ -52,6 +52,10 @@ class CarInterface(CarInterfaceBase):
|
|||
if candidate == CAR.CRV_5G:
|
||||
ret.enableBsm = 0x12f8bfa7 in fingerprint[0]
|
||||
|
||||
# Detect Bosch cars with new HUD msgs
|
||||
if any(0x33DA in f for f in fingerprint.values()):
|
||||
ret.flags |= HondaFlags.BOSCH_EXT_HUD.value
|
||||
|
||||
# Accord 1.5T CVT has different gearbox message
|
||||
if candidate == CAR.ACCORD and 0x191 in fingerprint[1]:
|
||||
ret.transmissionType = TransmissionType.cvt
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
from enum import IntFlag
|
||||
|
||||
from cereal import car
|
||||
from selfdrive.car import dbc_dict
|
||||
|
||||
|
@ -37,6 +39,11 @@ class CarControllerParams():
|
|||
self.STEER_LOOKUP_V = [v * -1 for v in CP.lateralParams.torqueV][1:][::-1] + list(CP.lateralParams.torqueV)
|
||||
|
||||
|
||||
class HondaFlags(IntFlag):
|
||||
# Bosch models with alternate set of LKAS_HUD messages
|
||||
BOSCH_EXT_HUD = 1
|
||||
|
||||
|
||||
# Car button codes
|
||||
class CruiseButtons:
|
||||
RES_ACCEL = 4
|
||||
|
|
Loading…
Reference in New Issue