Skip to content

Commit

Permalink
Merge branch 'tesla-mads-fixes' into tesla-port-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
carleeno committed Aug 8, 2024
2 parents 17151f6 + 49e425a commit daab1e4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion opendbc_repo
Submodule opendbc_repo updated 31 files
+18 −0 opendbc/dbc/acura_ilx_2016_can_generated.dbc
+18 −0 opendbc/dbc/acura_rdx_2018_can_generated.dbc
+1 −0 opendbc/dbc/generator/gm/gm_global_a_powertrain.dbc
+1 −0 opendbc/dbc/generator/honda/acura_ilx_2016_can.dbc
+1 −0 opendbc/dbc/generator/honda/acura_rdx_2018_can.dbc
+1 −0 opendbc/dbc/generator/honda/honda_civic_ex_2022_can.dbc
+1 −0 opendbc/dbc/generator/honda/honda_civic_touring_2016_can.dbc
+1 −0 opendbc/dbc/generator/honda/honda_clarity_hybrid_2018_can.dbc
+1 −0 opendbc/dbc/generator/honda/honda_crv_executive_2016_can.dbc
+1 −0 opendbc/dbc/generator/honda/honda_crv_touring_2016_can.dbc
+1 −0 opendbc/dbc/generator/honda/honda_fit_ex_2018_can.dbc
+1 −0 opendbc/dbc/generator/honda/honda_fit_hybrid_2018_can.dbc
+1 −0 opendbc/dbc/generator/honda/honda_odyssey_exl_2018.dbc
+1 −0 opendbc/dbc/generator/honda/honda_odyssey_extreme_edition_2018_china_can.dbc
+1 −0 opendbc/dbc/generator/toyota/toyota_new_mc_pt.dbc
+1 −0 opendbc/dbc/generator/toyota/toyota_nodsu_pt.dbc
+1 −0 opendbc/dbc/generator/toyota/toyota_tnga_k_pt.dbc
+18 −0 opendbc/dbc/gm_global_a_powertrain_generated.dbc
+18 −0 opendbc/dbc/honda_civic_ex_2022_can_generated.dbc
+18 −0 opendbc/dbc/honda_civic_touring_2016_can_generated.dbc
+18 −0 opendbc/dbc/honda_clarity_hybrid_2018_can_generated.dbc
+18 −0 opendbc/dbc/honda_crv_executive_2016_can_generated.dbc
+18 −0 opendbc/dbc/honda_crv_touring_2016_can_generated.dbc
+18 −0 opendbc/dbc/honda_fit_ex_2018_can_generated.dbc
+18 −0 opendbc/dbc/honda_fit_hybrid_2018_can_generated.dbc
+18 −0 opendbc/dbc/honda_odyssey_exl_2018_generated.dbc
+18 −0 opendbc/dbc/honda_odyssey_extreme_edition_2018_china_can_generated.dbc
+2 −0 opendbc/dbc/tesla_model3_vehicle.dbc
+44 −0 opendbc/dbc/toyota_new_mc_pt_generated.dbc
+44 −0 opendbc/dbc/toyota_nodsu_pt_generated.dbc
+44 −0 opendbc/dbc/toyota_tnga_k_pt_generated.dbc
10 changes: 1 addition & 9 deletions selfdrive/car/tesla/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
class CarInterface(CarInterfaceBase):
def __init__(self, CP, CarController, CarState):
super().__init__(CP, CarController, CarState)
self.last_mads_press = -1

@staticmethod
def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs):
Expand Down Expand Up @@ -50,14 +49,7 @@ def _update(self, c):
if self.enable_mads:
for b in self.CS.button_events:
if b.type == ButtonType.altButton2 and not b.pressed:
# MADS button (right scroll wheel click) is used for voice command
# So we use double-click to toggle MADS
now = time.monotonic()
if now - self.last_mads_press < 1.0:
self.CS.madsEnabled = not self.CS.madsEnabled
self.last_mads_press = -1
else:
self.last_mads_press = now
self.CS.madsEnabled = not self.CS.madsEnabled
self.CS.madsEnabled = self.get_acc_mads(ret.cruiseState.enabled, self.CS.accEnabled, self.CS.madsEnabled)
self.CS.madsEnabled = False if self.CS.steering_override else self.CS.madsEnabled

Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/tesla/values.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class CANBUS:
Button(car.CarState.ButtonEvent.Type.decelCruise, "VCLEFT_switchStatus", "VCLEFT_swcRightScrollTicks", list(range(-9, 0)), None),
Button(car.CarState.ButtonEvent.Type.cancel, "SCCM_rightStalk", "SCCM_rightStalkStatus", [1, 2], None),
Button(car.CarState.ButtonEvent.Type.resumeCruise, "SCCM_rightStalk", "SCCM_rightStalkStatus", [3, 4], None),
Button(car.CarState.ButtonEvent.Type.altButton2, "VCLEFT_switchStatus", "VCLEFT_swcRightPressed", [2], 1), # Note that mux needs to be handled in carState
Button(car.CarState.ButtonEvent.Type.altButton2, "VCLEFT_switchStatus", "VCLEFT_swcRightDoublePress", [1], 1), # Note that mux needs to be handled in carState
Button(car.CarState.ButtonEvent.Type.gapAdjustCruise, "VCLEFT_switchStatus", "VCLEFT_swcRightTiltRight", [2], 1), # TODO: directional gap adjustment
]

Expand Down

0 comments on commit daab1e4

Please sign in to comment.