wip
This commit is contained in:
@@ -9,8 +9,6 @@ from openpilot.selfdrive.car.hyundai.hyundaicanfd import CanBus
|
|||||||
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CANFD_CAR, CAR
|
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CANFD_CAR, CAR
|
||||||
from openpilot.selfdrive.car.interfaces import CarControllerBase
|
from openpilot.selfdrive.car.interfaces import CarControllerBase
|
||||||
|
|
||||||
import sys
|
|
||||||
|
|
||||||
VisualAlert = car.CarControl.HUDControl.VisualAlert
|
VisualAlert = car.CarControl.HUDControl.VisualAlert
|
||||||
LongCtrlState = car.CarControl.Actuators.LongControlState
|
LongCtrlState = car.CarControl.Actuators.LongControlState
|
||||||
|
|
||||||
@@ -122,12 +120,10 @@ class CarController(CarControllerBase):
|
|||||||
self.CP.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING))
|
self.CP.flags & HyundaiFlags.CANFD_HDA2_ALT_STEERING))
|
||||||
|
|
||||||
# LFA and HDA icons
|
# LFA and HDA icons
|
||||||
# if self.frame % 5 == 0 and (not hda2 or hda2_long):
|
if self.frame % 5 == 0 and (not hda2 or hda2_long):
|
||||||
# CLEARPILOT TEST self.CS.lkas_enabled
|
# CLEARPILOT TEST self.CS.lkas_enabled
|
||||||
|
|
||||||
# can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled, CC.latActive))
|
# can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CC.enabled, CC.latActive))
|
||||||
|
can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CS.lkas_enabled, CS.lkas_enabled))
|
||||||
# can_sends.append(hyundaicanfd.create_lfahda_cluster(self.packer, self.CAN, CS.lkas_enabled, CS.lkas_enabled))
|
|
||||||
|
|
||||||
# blinkers
|
# blinkers
|
||||||
if hda2 and self.CP.flags & HyundaiFlags.ENABLE_BLINKERS:
|
if hda2 and self.CP.flags & HyundaiFlags.ENABLE_BLINKERS:
|
||||||
@@ -182,10 +178,6 @@ class CarController(CarControllerBase):
|
|||||||
|
|
||||||
def create_button_messages(self, CC: car.CarControl, CS: car.CarState, use_clu11: bool):
|
def create_button_messages(self, CC: car.CarControl, CS: car.CarState, use_clu11: bool):
|
||||||
can_sends = []
|
can_sends = []
|
||||||
|
|
||||||
# False
|
|
||||||
# sys.stderr.write(str({'use_clu11': use_clu11}) + '\n')
|
|
||||||
|
|
||||||
if use_clu11:
|
if use_clu11:
|
||||||
if CC.cruiseControl.cancel:
|
if CC.cruiseControl.cancel:
|
||||||
can_sends.append(hyundaican.create_clu11(self.packer, self.frame, CS.clu11, Buttons.CANCEL, self.CP))
|
can_sends.append(hyundaican.create_clu11(self.packer, self.frame, CS.clu11, Buttons.CANCEL, self.CP))
|
||||||
@@ -209,10 +201,9 @@ class CarController(CarControllerBase):
|
|||||||
self.last_button_frame = self.frame
|
self.last_button_frame = self.frame
|
||||||
|
|
||||||
# cruise standstill resume
|
# cruise standstill resume
|
||||||
elif CC.cruiseControl.resume or CS.lkas_enabled:
|
elif CC.cruiseControl.resume:
|
||||||
if self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS:
|
if self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS:
|
||||||
# TODO: resume for alt button cars
|
# TODO: resume for alt button cars
|
||||||
sys.stderr.write(str({'canfdalt': True}) + '\n')
|
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
for _ in range(20):
|
for _ in range(20):
|
||||||
|
|||||||
@@ -297,7 +297,6 @@ class CarState(CarStateBase):
|
|||||||
# new lane change works perfect
|
# new lane change works perfect
|
||||||
# need to auto disable lat on turn lower than 20 + turn signal as default
|
# need to auto disable lat on turn lower than 20 + turn signal as default
|
||||||
|
|
||||||
|
|
||||||
self.lkas_enabled = lkas_enabled
|
self.lkas_enabled = lkas_enabled
|
||||||
|
|
||||||
self.params_memory.put_float("CarSpeedLimit", self.calculate_speed_limit(cp, cp_cam) * speed_factor)
|
self.params_memory.put_float("CarSpeedLimit", self.calculate_speed_limit(cp, cp_cam) * speed_factor)
|
||||||
|
|||||||
Reference in New Issue
Block a user