Compare commits

..

No commits in common. "b1cb459bd9c3ad47338528d0b3e931da78ca6d5c" and "efee1712aa995447e1485b652f01c19ce81d50be" have entirely different histories.

37 changed files with 5 additions and 12 deletions

View File

@ -21,10 +21,9 @@ class CarState(CarStateBase):
self.low_speed_alert = False
self.lkas_allowed_speed = False
self.lkas_disabled = False
self.prev_distance_button = 0
self.distance_button = 0
self.pcmCruiseGap = 0 # copy from Hyundai
def update(self, can_parsers) -> structs.CarState:
cp = can_parsers[Bus.pt]
@ -34,7 +33,7 @@ class CarState(CarStateBase):
self.prev_distance_button = self.distance_button
self.distance_button = cp.vl["CRZ_BTNS"]["DISTANCE_LESS"]
self.prev_cruise_buttons = self.cruise_buttons
if bool(cp.vl["CRZ_BTNS"]["SET_P"]):
@ -45,7 +44,7 @@ class CarState(CarStateBase):
self.cruise_buttons = Buttons.RESUME
else:
self.cruise_buttons = Buttons.NONE
ret.wheelSpeeds = self.get_wheel_speeds(
cp.vl["WHEEL_SPEEDS"]["FL"],
cp.vl["WHEEL_SPEEDS"]["FR"],
@ -62,12 +61,6 @@ class CarState(CarStateBase):
can_gear = int(cp.vl["GEAR"]["GEAR"])
ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(can_gear, None))
ret.gearStep = cp.vl["GEAR"]["GEAR_BOX"]
ret.engineRpm = cp.vl["ENGINE_DATA"]["RPM"] # for mazda RPM
# 将CAN总线上的DISTANCE_SETTING值转换为与车辆显示一致的值
can_distance_setting = cp.vl["CRZ_CTRL"]["DISTANCE_SETTING"]
# 假设最大值为4使用5减去CAN值来获取正确的显示值
ret.pcmCruiseGap = 5 - can_distance_setting if 1 <= can_distance_setting <= 4 else can_distance_setting
ret.genericToggle = bool(cp.vl["BLINK_INFO"]["HIGH_BEAMS"])
ret.leftBlindspot = cp.vl["BSM"]["LEFT_BS_STATUS"] != 0
@ -142,7 +135,7 @@ class CarState(CarStateBase):
self.lkas_previously_enabled = self.lkas_enabled
self.lkas_enabled = not self.lkas_disabled
# TODO: add button types for inc and dec
#ret.buttonEvents = create_button_events(self.distance_button, prev_distance_button, {1: ButtonType.gapAdjustCruise})
ret.buttonEvents = [

Binary file not shown.

View File

@ -130,7 +130,7 @@ class Soundd:
if self.lang == "main_ko":
wavefile = wave.open(BASEDIR + "/selfdrive/assets/sounds/" + filename, 'r')
else:
wavefile = wave.open(BASEDIR + "/selfdrive/assets/sounds_chs/" + filename, 'r')
wavefile = wave.open(BASEDIR + "/selfdrive/assets/sounds_eng/" + filename, 'r')
#assert wavefile.getnchannels() == 1
assert wavefile.getsampwidth() == 2