mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-06-21 16:52:07 +08:00
Compare commits
86 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c93e31897 | |||
| eb3d99fcd5 | |||
| 3c04bc747d | |||
| 1a807f3c97 | |||
| b14f37e096 | |||
| da48c225f1 | |||
| 46fa2360c1 | |||
| f093f460a3 | |||
| bbbbe3b8ef | |||
| 4182f29840 | |||
| 2d4f31bcec | |||
| 5e798af4a1 | |||
| dd40b8a1e8 | |||
| 202ea9141f | |||
| 1e8a276027 | |||
| 817592c184 | |||
| 1797d978a4 | |||
| df8046ec8c | |||
| ba52a42514 | |||
| c1cc78d401 | |||
| 3281ab4b84 | |||
| d00d623173 | |||
| 36109bc743 | |||
| 4c198769b1 | |||
| 57fce9f3a4 | |||
| 852302b97b | |||
| a176851afe | |||
| ce4d1f8505 | |||
| a0f2b086c7 | |||
| 59ad1b0926 | |||
| add019179f | |||
| 4a51023102 | |||
| 1f0415e310 | |||
| 1937140890 | |||
| b9d1980f6e | |||
| 0b766c67b3 | |||
| f31bd02087 | |||
| f9a195bab7 | |||
| 21a2aa79b2 | |||
| 31ba711819 | |||
| 805fd9a290 | |||
| b8f63740bc | |||
| c5ebb3a5a1 | |||
| c365aac60a | |||
| 98e9890004 | |||
| 8b976ee3ac | |||
| c0d5f23ac0 | |||
| 5341eb30fe | |||
| a07bb99d0c | |||
| bc65566017 | |||
| db684508da | |||
| 94fc8a9b5a | |||
| 080ca6e62f | |||
| 4e3e220f37 | |||
| b2dfc01469 | |||
| 3413f077fb | |||
| c32595e63f | |||
| cae49279e5 | |||
| 72deb320a7 | |||
| f532c73c60 | |||
| bb3d041bb1 | |||
| f7da0a2af5 | |||
| 2773e214a8 | |||
| d0608fc987 | |||
| 2f56309bb6 | |||
| e602ac636c | |||
| 1ce2ecd153 | |||
| b4fd05617c | |||
| 373d6c2e59 | |||
| 7aef4728ca | |||
| ca5fa0e6d9 | |||
| 0c76a761ce | |||
| dee11f6d54 | |||
| 76efd9e8ae | |||
| 2721e85275 | |||
| dd08146711 | |||
| c219ba7c79 | |||
| ee67635e8d | |||
| 972c69bd2a | |||
| 16e9625626 | |||
| 6b71d82019 | |||
| 8d693e1d41 | |||
| cab9ccf0d8 | |||
| c831b5f2af | |||
| 58f994496c | |||
| 2e15f519bc |
@@ -38,6 +38,9 @@ sunnypilot - 0.9.8.0 (2024-xx-xx)
|
||||
* In response to the official deprecation of support for Smart DSU (SDSU) and Radar CAN Filter in the upstream ([commaai/openpilot#32777](https://github.com/commaai/openpilot/pull/32777)), sunnypilot will continue maintaining software support for Smart DSU (SDSU) and Radar CAN Filter
|
||||
* UPDATED: Continued support for Mapbox navigation
|
||||
* In response to the official temporary deprecation of support for Mapbox navigation in the upstream ([commaai/openpilot#32773](https://github.com/commaai/openpilot/pull/32773)), sunnypilot will continue maintaining software support for Mapbox navigation
|
||||
* NEW❗: Toyota - Automatic Brake Hold (AHB) thanks to AlexandreSato!
|
||||
* When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold
|
||||
* NOTE: Only for Toyota/Lexus vehicles with TSS2/LSS2
|
||||
* NEW❗: Toyota - Automatic Door Locking and Unlocking thanks to AlexandreSato, cydia2020, and dragonpilot-community!
|
||||
* Auto Lock by Speed: All doors are automatically locked when vehicle speed is approximately 6 mph (10 km/h) or higher
|
||||
* Auto Unlock by Shift to P: All doors are automatically unlocked when shifting the shift lever to P
|
||||
|
||||
@@ -138,6 +138,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
|
||||
speedLimitConfirmed @140;
|
||||
torqueNNLoad @141;
|
||||
hyundaiRadarTracksAvailable @142;
|
||||
spAutoBrakeHold @143;
|
||||
|
||||
radarCanErrorDEPRECATED @15;
|
||||
communityFeatureDisallowedDEPRECATED @62;
|
||||
|
||||
+1
-18
@@ -212,24 +212,7 @@ struct ModelDataV2SP @0xf98d843bfd7004a3 {
|
||||
modelCapabilities @4 :UInt32;
|
||||
}
|
||||
|
||||
struct CarControlSP @0xb86e6369214c01c8 {
|
||||
customStockLongitudinalControl @0 :CustomStockLongitudinalControl;
|
||||
|
||||
struct CustomStockLongitudinalControl {
|
||||
state @0 :ButtonControlState;
|
||||
cruiseButton @1 :Int16;
|
||||
finalSpeedKphDEPRECATED @2 :Float32;
|
||||
vTarget @3 :Float32;
|
||||
vCruiseCluster @4 :Float32;
|
||||
|
||||
enum ButtonControlState {
|
||||
inactive @0; # No button press or default state
|
||||
loading @1; # Loading state before transitioning to accelerating or decelerating
|
||||
accelerating @2; # Increasing speed
|
||||
decelerating @3; # Decreasing speed
|
||||
holding @4; # Holding steady speed
|
||||
}
|
||||
}
|
||||
struct CustomReserved7 @0xb86e6369214c01c8 {
|
||||
}
|
||||
|
||||
struct CustomReserved8 @0xf416ec09499d9d19 {
|
||||
|
||||
+1
-1
@@ -2388,7 +2388,7 @@ struct Event {
|
||||
liveMapDataSP @111 :Custom.LiveMapDataSP;
|
||||
e2eLongStateSP @112 :Custom.E2eLongStateSP;
|
||||
modelV2SP @113 :Custom.ModelDataV2SP;
|
||||
carControlSP @114 :Custom.CarControlSP;
|
||||
customReserved7 @114 :Custom.CustomReserved7;
|
||||
customReserved8 @115 :Custom.CustomReserved8;
|
||||
customReserved9 @116 :Custom.CustomReserved9;
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ _services: dict[str, tuple] = {
|
||||
"liveMapDataSP": (True, 0.),
|
||||
"e2eLongStateSP": (True, 0.),
|
||||
"modelV2SP": (True, 20., 40),
|
||||
"carControlSP": (True, 100., 10),
|
||||
|
||||
# debug
|
||||
"uiDebug": (True, 0., 1),
|
||||
|
||||
@@ -255,6 +255,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"EndToEndLongToggle", PERSISTENT | BACKUP},
|
||||
{"EnforceTorqueLateral", PERSISTENT | BACKUP},
|
||||
{"EnhancedScc", PERSISTENT | BACKUP},
|
||||
{"FastTakeOff", PERSISTENT | BACKUP},
|
||||
{"FeatureStatus", PERSISTENT | BACKUP},
|
||||
{"FleetManagerPin", PERSISTENT},
|
||||
{"ForceOffroad", CLEAR_ON_MANAGER_START},
|
||||
@@ -330,6 +331,7 @@ std::unordered_map<std::string, uint32_t> keys = {
|
||||
{"TorqueLateralJerk", PERSISTENT | BACKUP},
|
||||
{"TorqueMaxLatAccel", PERSISTENT | BACKUP},
|
||||
{"TorquedOverride", PERSISTENT | BACKUP},
|
||||
{"ToyotaAutoHold", PERSISTENT | BACKUP},
|
||||
{"ToyotaAutoLockBySpeed", PERSISTENT | BACKUP},
|
||||
{"ToyotaAutoUnlockByShifter", PERSISTENT | BACKUP},
|
||||
{"ToyotaEnhancedBsm", PERSISTENT | BACKUP},
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
../sunnypilot/
|
||||
+1
-1
Submodule panda updated: 3b4cfcd291...827201c04a
+4
-15
@@ -31,7 +31,7 @@ class Car:
|
||||
def __init__(self, CI=None):
|
||||
self.can_sock = messaging.sub_sock('can', timeout=20)
|
||||
self.sm = messaging.SubMaster(['pandaStates', 'carControl', 'onroadEvents'])
|
||||
self.pm = messaging.PubMaster(['sendcan', 'carState', 'carParams', 'carOutput', 'carControlSP'])
|
||||
self.pm = messaging.PubMaster(['sendcan', 'carState', 'carParams', 'carOutput'])
|
||||
|
||||
self.can_rcv_cum_timeout_counter = 0
|
||||
|
||||
@@ -60,6 +60,7 @@ class Car:
|
||||
self.mads_disengage_lateral_on_brake = self.params.get_bool("DisengageLateralOnBrake")
|
||||
self.mads_dlob = self.enable_mads and self.mads_disengage_lateral_on_brake
|
||||
self.mads_ndlob = self.enable_mads and not self.mads_disengage_lateral_on_brake
|
||||
self.sp_toyota_auto_brake_hold = self.params.get_bool("ToyotaAutoHold")
|
||||
self.CP.alternativeExperience = 0
|
||||
if not self.disengage_on_accelerator:
|
||||
self.CP.alternativeExperience |= ALTERNATIVE_EXPERIENCE.DISABLE_DISENGAGE_ON_GAS
|
||||
@@ -67,15 +68,11 @@ class Car:
|
||||
self.CP.alternativeExperience |= ALTERNATIVE_EXPERIENCE.ENABLE_MADS
|
||||
elif self.mads_ndlob:
|
||||
self.CP.alternativeExperience |= ALTERNATIVE_EXPERIENCE.MADS_DISABLE_DISENGAGE_LATERAL_ON_BRAKE
|
||||
if self.sp_toyota_auto_brake_hold:
|
||||
self.CP.alternativeExperience |= ALTERNATIVE_EXPERIENCE.ALLOW_AEB
|
||||
|
||||
if self.CP.customStockLongAvailable and self.CP.pcmCruise and self.params.get_bool("CustomStockLong"):
|
||||
self.CP.pcmCruiseSpeed = False
|
||||
services = self.sm.data.keys() | {'longitudinalPlanSP'}
|
||||
self.sm = messaging.SubMaster(list(services))
|
||||
|
||||
cslc_path = f'openpilot.sunnypilot.selfdrive.car.{self.CP.carName}.custom_stock_longitudinal_controller'
|
||||
CustomStockLongitudinalController = __import__(cslc_path + '.controller', fromlist=['CustomStockLongitudinalController']).CustomStockLongitudinalController
|
||||
self.custom_stock_longitudinal_controller = CustomStockLongitudinalController(self, self.CI.CC, self.CI.CS, self.CP)
|
||||
|
||||
openpilot_enabled_toggle = self.params.get_bool("OpenpilotEnabledToggle")
|
||||
|
||||
@@ -181,16 +178,8 @@ class Car:
|
||||
# send car controls over can
|
||||
now_nanos = self.can_log_mono_time if REPLAY else int(time.monotonic() * 1e9)
|
||||
self.last_actuators_output, can_sends = self.CI.apply(CC, now_nanos)
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
can_sends.extend(self.custom_stock_longitudinal_controller.update(CS, CC))
|
||||
self.pm.send('sendcan', can_list_to_can_capnp(can_sends, msgtype='sendcan', valid=CS.canValid))
|
||||
|
||||
cc_send_sp = messaging.new_message('carControlSP')
|
||||
cc_send_sp.valid = self.sm.all_checks(['carControl'])
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
cc_send_sp.carControlSP.customStockLongitudinalControl = self.custom_stock_longitudinal_controller.state_publish()
|
||||
self.pm.send('carControlSP', cc_send_sp)
|
||||
|
||||
self.CC_prev = CC
|
||||
|
||||
def step(self):
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
from cereal import car
|
||||
|
||||
import cereal.messaging as messaging
|
||||
from common.conversions import Conversions as CV
|
||||
from opendbc.can.packer import CANPacker
|
||||
from openpilot.selfdrive.car import apply_meas_steer_torque_limits
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.selfdrive.car import DT_CTRL, apply_meas_steer_torque_limits
|
||||
from openpilot.selfdrive.car.chrysler import chryslercan
|
||||
from openpilot.selfdrive.car.chrysler.values import RAM_CARS, RAM_DT, CarControllerParams, ChryslerFlags, ChryslerFlagsSP
|
||||
from openpilot.selfdrive.car.interfaces import CarControllerBase, FORWARD_GEARS
|
||||
from openpilot.selfdrive.controls.lib.drive_helpers import FCA_V_CRUISE_MIN
|
||||
|
||||
ButtonType = car.CarState.ButtonEvent.Type
|
||||
|
||||
@@ -22,9 +26,64 @@ class CarController(CarControllerBase):
|
||||
self.packer = CANPacker(dbc_name)
|
||||
self.params = CarControllerParams(CP)
|
||||
|
||||
self.sm = messaging.SubMaster(['longitudinalPlanSP'])
|
||||
self.param_s = Params()
|
||||
self.last_speed_limit_sign_tap_prev = False
|
||||
self.speed_limit = 0.
|
||||
self.speed_limit_offset = 0
|
||||
self.timer = 0
|
||||
self.final_speed_kph = 0
|
||||
self.init_speed = 0
|
||||
self.current_speed = 0
|
||||
self.v_set_dis = 0
|
||||
self.v_cruise_min = 0
|
||||
self.button_type = 0
|
||||
self.button_select = 0
|
||||
self.button_count = 0
|
||||
self.target_speed = 0
|
||||
self.t_interval = 7
|
||||
self.slc_active_stock = False
|
||||
self.sl_force_active_timer = 0
|
||||
self.v_tsc_state = 0
|
||||
self.slc_state = 0
|
||||
self.m_tsc_state = 0
|
||||
self.cruise_button = None
|
||||
self.speed_diff = 0
|
||||
self.v_tsc = 0
|
||||
self.m_tsc = 0
|
||||
self.steady_speed = 0
|
||||
self.button_frame = 0
|
||||
|
||||
def update(self, CC, CS, now_nanos):
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
self.sm.update(0)
|
||||
|
||||
if self.sm.updated['longitudinalPlanSP']:
|
||||
self.v_tsc_state = self.sm['longitudinalPlanSP'].visionTurnControllerState
|
||||
self.slc_state = self.sm['longitudinalPlanSP'].speedLimitControlState
|
||||
self.m_tsc_state = self.sm['longitudinalPlanSP'].turnSpeedControlState
|
||||
self.speed_limit = self.sm['longitudinalPlanSP'].speedLimit
|
||||
self.speed_limit_offset = self.sm['longitudinalPlanSP'].speedLimitOffset
|
||||
self.v_tsc = self.sm['longitudinalPlanSP'].visionTurnSpeed
|
||||
self.m_tsc = self.sm['longitudinalPlanSP'].turnSpeed
|
||||
|
||||
self.v_cruise_min = FCA_V_CRUISE_MIN[CS.params_list.is_metric] * (CV.KPH_TO_MPH if not CS.params_list.is_metric else 1)
|
||||
|
||||
can_sends = []
|
||||
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
if not self.last_speed_limit_sign_tap_prev and CS.params_list.last_speed_limit_sign_tap:
|
||||
self.sl_force_active_timer = self.frame
|
||||
self.param_s.put_bool_nonblocking("LastSpeedLimitSignTap", False)
|
||||
self.last_speed_limit_sign_tap_prev = CS.params_list.last_speed_limit_sign_tap
|
||||
|
||||
sl_force_active = CS.params_list.speed_limit_control_enabled and (self.frame < (self.sl_force_active_timer * DT_CTRL + 2.0))
|
||||
sl_inactive = not sl_force_active and (not CS.params_list.speed_limit_control_enabled or (True if self.slc_state == 0 else False))
|
||||
sl_temp_inactive = not sl_force_active and (CS.params_list.speed_limit_control_enabled and (True if self.slc_state == 1 else False))
|
||||
slc_active = not sl_inactive and not sl_temp_inactive
|
||||
|
||||
self.slc_active_stock = slc_active
|
||||
|
||||
lkas_active = CC.latActive and CS.madsEnabled
|
||||
|
||||
if self.frame % 10 == 0 and self.CP.carFingerprint not in RAM_CARS:
|
||||
@@ -55,6 +114,20 @@ class CarController(CarControllerBase):
|
||||
self.last_button_frame = self.frame
|
||||
can_sends.append(chryslercan.create_cruise_buttons(self.packer, CS.button_counter + 1, das_bus, self.CP, resume=True))
|
||||
|
||||
if not (CC.cruiseControl.cancel or CC.cruiseControl.resume) and not self.CP.pcmCruiseSpeed and CS.out.cruiseState.enabled:
|
||||
self.button_frame += 1
|
||||
button_counter_offset = [1, 1, 0, None][self.button_frame % 4]
|
||||
if ram_cars:
|
||||
self.cruise_button = self.get_cruise_buttons(CS, CC.vCruise)
|
||||
elif button_counter_offset is not None:
|
||||
self.cruise_button = self.get_cruise_buttons(CS, CC.vCruise)
|
||||
|
||||
if self.cruise_button is not None:
|
||||
if ram_cars:
|
||||
can_sends.append(chryslercan.create_cruise_buttons(self.packer, CS.button_counter, das_bus, self.CP, buttons=self.cruise_button))
|
||||
elif button_counter_offset is not None:
|
||||
can_sends.append(chryslercan.create_cruise_buttons(self.packer, CS.button_counter + button_counter_offset, das_bus, self.CP, buttons=self.cruise_button))
|
||||
|
||||
# HUD alerts
|
||||
if self.frame % 25 == 0:
|
||||
if CS.lkas_car_model != -1:
|
||||
@@ -106,3 +179,122 @@ class CarController(CarControllerBase):
|
||||
new_actuators.steerOutputCan = self.apply_steer_last
|
||||
|
||||
return new_actuators, can_sends
|
||||
|
||||
# multikyd methods, sunnyhaibin logic
|
||||
def get_cruise_buttons_status(self, CS):
|
||||
if not CS.out.cruiseState.enabled:
|
||||
for be in CS.out.buttonEvents:
|
||||
if be.type in (ButtonType.accelCruise, ButtonType.decelCruise, ButtonType.resumeCruise) and be.pressed:
|
||||
self.timer = 40
|
||||
elif self.timer:
|
||||
self.timer -= 1
|
||||
else:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def get_target_speed(self, v_cruise_kph_prev):
|
||||
v_cruise_kph = v_cruise_kph_prev
|
||||
if self.slc_state > 1:
|
||||
v_cruise_kph = (self.speed_limit + self.speed_limit_offset) * CV.MS_TO_KPH
|
||||
if not self.slc_active_stock:
|
||||
v_cruise_kph = v_cruise_kph_prev
|
||||
return v_cruise_kph
|
||||
|
||||
def get_button_type(self, button_type):
|
||||
self.type_status = "type_" + str(button_type)
|
||||
self.button_picker = getattr(self, self.type_status, lambda: "default")
|
||||
return self.button_picker()
|
||||
|
||||
def reset_button(self):
|
||||
if self.button_type != 3:
|
||||
self.button_type = 0
|
||||
|
||||
def type_default(self):
|
||||
self.button_type = 0
|
||||
return None
|
||||
|
||||
def type_0(self):
|
||||
self.button_count = 0
|
||||
self.target_speed = self.init_speed
|
||||
self.speed_diff = self.target_speed - self.v_set_dis
|
||||
if self.target_speed > self.v_set_dis:
|
||||
self.button_type = 1
|
||||
elif self.target_speed < self.v_set_dis and self.v_set_dis > self.v_cruise_min:
|
||||
self.button_type = 2
|
||||
return None
|
||||
|
||||
def type_1(self):
|
||||
cruise_button = 1
|
||||
self.button_count += 1
|
||||
if self.target_speed <= self.v_set_dis:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
elif self.button_count > 5:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
return cruise_button
|
||||
|
||||
def type_2(self):
|
||||
cruise_button = 2
|
||||
self.button_count += 1
|
||||
if self.target_speed >= self.v_set_dis or self.v_set_dis <= self.v_cruise_min:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
elif self.button_count > 5:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
return cruise_button
|
||||
|
||||
def type_3(self):
|
||||
cruise_button = None
|
||||
self.button_count += 1
|
||||
if self.button_count > self.t_interval:
|
||||
self.button_type = 0
|
||||
return cruise_button
|
||||
|
||||
def get_curve_speed(self, target_speed_kph, v_cruise_kph_prev):
|
||||
if self.v_tsc_state != 0:
|
||||
vision_v_cruise_kph = self.v_tsc * CV.MS_TO_KPH
|
||||
if int(vision_v_cruise_kph) == int(v_cruise_kph_prev):
|
||||
vision_v_cruise_kph = 255
|
||||
else:
|
||||
vision_v_cruise_kph = 255
|
||||
if self.m_tsc_state > 1:
|
||||
map_v_cruise_kph = self.m_tsc * CV.MS_TO_KPH
|
||||
if int(map_v_cruise_kph) == 0.0:
|
||||
map_v_cruise_kph = 255
|
||||
else:
|
||||
map_v_cruise_kph = 255
|
||||
curve_speed = self.curve_speed_hysteresis(min(vision_v_cruise_kph, map_v_cruise_kph) + 2 * CV.MPH_TO_KPH)
|
||||
return min(target_speed_kph, curve_speed)
|
||||
|
||||
def get_button_control(self, CS, final_speed, v_cruise_kph_prev):
|
||||
self.init_speed = round(min(final_speed, v_cruise_kph_prev) * (CV.KPH_TO_MPH if not CS.params_list.is_metric else 1))
|
||||
self.v_set_dis = round(CS.out.cruiseState.speed * (CV.MS_TO_MPH if not CS.params_list.is_metric else CV.MS_TO_KPH))
|
||||
cruise_button = self.get_button_type(self.button_type)
|
||||
return cruise_button
|
||||
|
||||
def curve_speed_hysteresis(self, cur_speed: float, hyst=(0.75 * CV.MPH_TO_KPH)):
|
||||
if cur_speed > self.steady_speed:
|
||||
self.steady_speed = cur_speed
|
||||
elif cur_speed < self.steady_speed - hyst:
|
||||
self.steady_speed = cur_speed
|
||||
return self.steady_speed
|
||||
|
||||
def get_cruise_buttons(self, CS, v_cruise_kph_prev):
|
||||
cruise_button = None
|
||||
if not self.get_cruise_buttons_status(CS):
|
||||
pass
|
||||
elif CS.out.cruiseState.enabled:
|
||||
set_speed_kph = self.get_target_speed(v_cruise_kph_prev)
|
||||
if self.slc_state > 1:
|
||||
target_speed_kph = set_speed_kph
|
||||
else:
|
||||
target_speed_kph = min(v_cruise_kph_prev, set_speed_kph)
|
||||
if self.v_tsc_state != 0 or self.m_tsc_state > 1:
|
||||
self.final_speed_kph = self.get_curve_speed(target_speed_kph, v_cruise_kph_prev)
|
||||
else:
|
||||
self.final_speed_kph = target_speed_kph
|
||||
|
||||
cruise_button = self.get_button_control(CS, self.final_speed_kph, v_cruise_kph_prev) # MPH/KPH based button presses
|
||||
return cruise_button
|
||||
|
||||
@@ -65,9 +65,14 @@ def create_lkas_command(packer, CP, apply_steer, lkas_control_bit):
|
||||
|
||||
def create_cruise_buttons(packer, frame, bus, CP, cruise_buttons_msg=None, buttons=0, cancel=False, resume=False):
|
||||
|
||||
acc_accel = 1 if buttons == 1 else 0
|
||||
acc_decel = 1 if buttons == 2 else 0
|
||||
|
||||
values = {
|
||||
"ACC_Cancel": cancel,
|
||||
"ACC_Resume": resume,
|
||||
"ACC_Accel": acc_accel,
|
||||
"ACC_Decel": acc_decel,
|
||||
"COUNTER": frame % 0x10,
|
||||
}
|
||||
|
||||
|
||||
@@ -161,6 +161,8 @@ class CarInterface(CarInterfaceBase):
|
||||
if self.low_speed_alert:
|
||||
events.add(car.CarEvent.EventName.belowSteerSpeed)
|
||||
|
||||
ret.customStockLong = self.update_custom_stock_long()
|
||||
|
||||
ret.events = events.to_msg()
|
||||
|
||||
return ret
|
||||
|
||||
@@ -24,7 +24,6 @@ class CarInterface(CarInterfaceBase):
|
||||
ret.steerControlType = car.CarParams.SteerControlType.angle
|
||||
ret.steerActuatorDelay = 0.2
|
||||
ret.steerLimitTimer = 1.0
|
||||
ret.customStockLongAvailable = True
|
||||
|
||||
if Params().get("DongleId", encoding='utf8') in ("4fde83db16dc0802", "112e4d6e0cad05e1", "e36b272d5679115f", "24574459dd7fb3e0", "83a4e056c7072678"):
|
||||
ret.spFlags |= FordFlagsSP.SP_ENHANCED_LAT_CONTROL.value
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
from collections import namedtuple
|
||||
|
||||
from cereal import car
|
||||
import cereal.messaging as messaging
|
||||
from openpilot.common.conversions import Conversions as CV
|
||||
from openpilot.common.numpy_fast import clip, interp
|
||||
from openpilot.common.params import Params
|
||||
from opendbc.can.packer import CANPacker
|
||||
from openpilot.selfdrive.car import DT_CTRL, rate_limit, make_tester_present_msg, create_gas_interceptor_command
|
||||
from openpilot.selfdrive.car.honda import hondacan
|
||||
from openpilot.selfdrive.car.honda.values import CruiseButtons, VISUAL_HUD, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, HONDA_NIDEC_ALT_PCM_ACCEL, CarControllerParams
|
||||
from openpilot.selfdrive.car.interfaces import CarControllerBase
|
||||
from openpilot.selfdrive.controls.lib.drive_helpers import HONDA_V_CRUISE_MIN
|
||||
|
||||
VisualAlert = car.CarControl.HUDControl.VisualAlert
|
||||
LongCtrlState = car.CarControl.Actuators.LongControlState
|
||||
@@ -124,7 +128,48 @@ class CarController(CarControllerBase):
|
||||
self.last_steer = 0.0
|
||||
self.last_button_frame = 0
|
||||
|
||||
self.sm = messaging.SubMaster(['longitudinalPlanSP'])
|
||||
self.param_s = Params()
|
||||
self.last_speed_limit_sign_tap_prev = False
|
||||
self.speed_limit = 0.
|
||||
self.speed_limit_offset = 0
|
||||
self.timer = 0
|
||||
self.final_speed_kph = 0
|
||||
self.init_speed = 0
|
||||
self.current_speed = 0
|
||||
self.v_set_dis = 0
|
||||
self.v_cruise_min = 0
|
||||
self.button_type = 0
|
||||
self.button_select = 0
|
||||
self.button_count = 0
|
||||
self.target_speed = 0
|
||||
self.t_interval = 7
|
||||
self.slc_active_stock = False
|
||||
self.sl_force_active_timer = 0
|
||||
self.v_tsc_state = 0
|
||||
self.slc_state = 0
|
||||
self.m_tsc_state = 0
|
||||
self.cruise_button = None
|
||||
self.speed_diff = 0
|
||||
self.v_tsc = 0
|
||||
self.m_tsc = 0
|
||||
self.steady_speed = 0
|
||||
|
||||
def update(self, CC, CS, now_nanos):
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
self.sm.update(0)
|
||||
|
||||
if self.sm.updated['longitudinalPlanSP']:
|
||||
self.v_tsc_state = self.sm['longitudinalPlanSP'].visionTurnControllerState
|
||||
self.slc_state = self.sm['longitudinalPlanSP'].speedLimitControlState
|
||||
self.m_tsc_state = self.sm['longitudinalPlanSP'].turnSpeedControlState
|
||||
self.speed_limit = self.sm['longitudinalPlanSP'].speedLimit
|
||||
self.speed_limit_offset = self.sm['longitudinalPlanSP'].speedLimitOffset
|
||||
self.v_tsc = self.sm['longitudinalPlanSP'].visionTurnSpeed
|
||||
self.m_tsc = self.sm['longitudinalPlanSP'].turnSpeed
|
||||
|
||||
self.v_cruise_min = HONDA_V_CRUISE_MIN[CS.params_list.is_metric] * (CV.KPH_TO_MPH if not CS.params_list.is_metric else 1)
|
||||
|
||||
actuators = CC.actuators
|
||||
hud_control = CC.hudControl
|
||||
conversion = hondacan.get_cruise_speed_conversion(self.CP.carFingerprint, CS.is_metric)
|
||||
@@ -158,6 +203,19 @@ class CarController(CarControllerBase):
|
||||
apply_steer = int(interp(-limited_steer * self.params.STEER_MAX,
|
||||
self.params.STEER_LOOKUP_BP, self.params.STEER_LOOKUP_V))
|
||||
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
if not self.last_speed_limit_sign_tap_prev and CS.params_list.last_speed_limit_sign_tap:
|
||||
self.sl_force_active_timer = self.frame
|
||||
self.param_s.put_bool_nonblocking("LastSpeedLimitSignTap", False)
|
||||
self.last_speed_limit_sign_tap_prev = CS.params_list.last_speed_limit_sign_tap
|
||||
|
||||
sl_force_active = CS.params_list.speed_limit_control_enabled and (self.frame < (self.sl_force_active_timer * DT_CTRL + 2.0))
|
||||
sl_inactive = not sl_force_active and (not CS.params_list.speed_limit_control_enabled or (True if self.slc_state == 0 else False))
|
||||
sl_temp_inactive = not sl_force_active and (CS.params_list.speed_limit_control_enabled and (True if self.slc_state == 1 else False))
|
||||
slc_active = not sl_inactive and not sl_temp_inactive
|
||||
|
||||
self.slc_active_stock = slc_active
|
||||
|
||||
# Send CAN commands
|
||||
can_sends = []
|
||||
|
||||
@@ -207,6 +265,15 @@ class CarController(CarControllerBase):
|
||||
can_sends.append(hondacan.spam_buttons_command(self.packer, self.CAN, CruiseButtons.CANCEL, self.CP.carFingerprint))
|
||||
elif CC.cruiseControl.resume:
|
||||
can_sends.append(hondacan.spam_buttons_command(self.packer, self.CAN, CruiseButtons.RES_ACCEL, self.CP.carFingerprint))
|
||||
elif CS.out.cruiseState.enabled and not self.CP.pcmCruiseSpeed:
|
||||
self.cruise_button = self.get_cruise_buttons(CS, CC.vCruise)
|
||||
if self.cruise_button is not None:
|
||||
send_freq = 1
|
||||
if not (self.v_tsc_state != 0 or self.m_tsc_state > 1) and abs(self.target_speed - self.v_set_dis) <= 2:
|
||||
send_freq = 3
|
||||
if (self.frame - self.last_button_frame) * DT_CTRL > 0.01 * send_freq:
|
||||
can_sends.append(hondacan.spam_buttons_command(self.packer, self.CAN, self.cruise_button, self.CP.carFingerprint))
|
||||
self.last_button_frame = self.frame
|
||||
|
||||
else:
|
||||
# Send gas and brake commands.
|
||||
@@ -268,3 +335,120 @@ class CarController(CarControllerBase):
|
||||
|
||||
self.frame += 1
|
||||
return new_actuators, can_sends
|
||||
|
||||
# multikyd methods, sunnyhaibin logic
|
||||
def get_cruise_buttons_status(self, CS):
|
||||
if not CS.out.cruiseState.enabled or CS.cruise_buttons != 0:
|
||||
self.timer = 40
|
||||
elif self.timer:
|
||||
self.timer -= 1
|
||||
else:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def get_target_speed(self, v_cruise_kph_prev):
|
||||
v_cruise_kph = v_cruise_kph_prev
|
||||
if self.slc_state > 1:
|
||||
v_cruise_kph = (self.speed_limit + self.speed_limit_offset) * CV.MS_TO_KPH
|
||||
if not self.slc_active_stock:
|
||||
v_cruise_kph = v_cruise_kph_prev
|
||||
return v_cruise_kph
|
||||
|
||||
def get_button_type(self, button_type):
|
||||
self.type_status = "type_" + str(button_type)
|
||||
self.button_picker = getattr(self, self.type_status, lambda: "default")
|
||||
return self.button_picker()
|
||||
|
||||
def reset_button(self):
|
||||
if self.button_type != 3:
|
||||
self.button_type = 0
|
||||
|
||||
def type_default(self):
|
||||
self.button_type = 0
|
||||
return None
|
||||
|
||||
def type_0(self):
|
||||
self.button_count = 0
|
||||
self.target_speed = self.init_speed
|
||||
self.speed_diff = self.target_speed - self.v_set_dis
|
||||
if self.target_speed > self.v_set_dis:
|
||||
self.button_type = 1
|
||||
elif self.target_speed < self.v_set_dis and self.v_set_dis > self.v_cruise_min:
|
||||
self.button_type = 2
|
||||
return None
|
||||
|
||||
def type_1(self):
|
||||
cruise_button = CruiseButtons.RES_ACCEL
|
||||
self.button_count += 1
|
||||
if self.target_speed <= self.v_set_dis:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
elif self.button_count > 5:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
return cruise_button
|
||||
|
||||
def type_2(self):
|
||||
cruise_button = CruiseButtons.DECEL_SET
|
||||
self.button_count += 1
|
||||
if self.target_speed >= self.v_set_dis or self.v_set_dis <= self.v_cruise_min:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
elif self.button_count > 5:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
return cruise_button
|
||||
|
||||
def type_3(self):
|
||||
cruise_button = None
|
||||
self.button_count += 1
|
||||
if self.button_count > self.t_interval:
|
||||
self.button_type = 0
|
||||
return cruise_button
|
||||
|
||||
def get_curve_speed(self, target_speed_kph, v_cruise_kph_prev):
|
||||
if self.v_tsc_state != 0:
|
||||
vision_v_cruise_kph = self.v_tsc * CV.MS_TO_KPH
|
||||
if int(vision_v_cruise_kph) == int(v_cruise_kph_prev):
|
||||
vision_v_cruise_kph = 255
|
||||
else:
|
||||
vision_v_cruise_kph = 255
|
||||
if self.m_tsc_state > 1:
|
||||
map_v_cruise_kph = self.m_tsc * CV.MS_TO_KPH
|
||||
if int(map_v_cruise_kph) == 0.0:
|
||||
map_v_cruise_kph = 255
|
||||
else:
|
||||
map_v_cruise_kph = 255
|
||||
curve_speed = self.curve_speed_hysteresis(min(vision_v_cruise_kph, map_v_cruise_kph) + 2 * CV.MPH_TO_KPH)
|
||||
return min(target_speed_kph, curve_speed)
|
||||
|
||||
def get_button_control(self, CS, final_speed, v_cruise_kph_prev):
|
||||
self.init_speed = round(min(final_speed, v_cruise_kph_prev) * (CV.KPH_TO_MPH if not CS.params_list.is_metric else 1))
|
||||
self.v_set_dis = round(CS.out.cruiseState.speed * (CV.MS_TO_MPH if not CS.params_list.is_metric else CV.MS_TO_KPH))
|
||||
cruise_button = self.get_button_type(self.button_type)
|
||||
return cruise_button
|
||||
|
||||
def curve_speed_hysteresis(self, cur_speed: float, hyst=(0.75 * CV.MPH_TO_KPH)):
|
||||
if cur_speed > self.steady_speed:
|
||||
self.steady_speed = cur_speed
|
||||
elif cur_speed < self.steady_speed - hyst:
|
||||
self.steady_speed = cur_speed
|
||||
return self.steady_speed
|
||||
|
||||
def get_cruise_buttons(self, CS, v_cruise_kph_prev):
|
||||
cruise_button = None
|
||||
if not self.get_cruise_buttons_status(CS):
|
||||
pass
|
||||
elif CS.out.cruiseState.enabled:
|
||||
set_speed_kph = self.get_target_speed(v_cruise_kph_prev)
|
||||
if self.slc_state > 1:
|
||||
target_speed_kph = set_speed_kph
|
||||
else:
|
||||
target_speed_kph = min(v_cruise_kph_prev, set_speed_kph)
|
||||
if self.v_tsc_state != 0 or self.m_tsc_state > 1:
|
||||
self.final_speed_kph = self.get_curve_speed(target_speed_kph, v_cruise_kph_prev)
|
||||
else:
|
||||
self.final_speed_kph = target_speed_kph
|
||||
|
||||
cruise_button = self.get_button_control(CS, self.final_speed_kph, v_cruise_kph_prev) # MPH/KPH based button presses
|
||||
return cruise_button
|
||||
|
||||
@@ -329,6 +329,8 @@ class CarInterface(CarInterfaceBase):
|
||||
if self.CS.CP.minEnableSpeed > 0 and ret.vEgo < 0.001:
|
||||
events.add(EventName.manualRestart)
|
||||
|
||||
ret.customStockLong = self.update_custom_stock_long()
|
||||
|
||||
ret.events = events.to_msg()
|
||||
|
||||
return ret
|
||||
|
||||
@@ -126,7 +126,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
if 0x1fa in fingerprint[CAN.ECAN]:
|
||||
ret.spFlags |= HyundaiFlagsSP.SP_NAV_MSG.value
|
||||
if Params().get("DongleId", encoding='utf8') in ("012c95f06918eca4", "68d6a96e703c00c9", "11c1f1909ca37bca"):
|
||||
if Params().get("DongleId", encoding='utf8') in ("012c95f06918eca4", "68d6a96e703c00c9"):
|
||||
ret.spFlags |= HyundaiFlagsSP.SP_UPSTREAM_TACO.value
|
||||
else:
|
||||
ret.enableBsm = 0x58b in fingerprint[0]
|
||||
@@ -296,6 +296,8 @@ class CarInterface(CarInterfaceBase):
|
||||
if self.CS.params_list.hyundai_radar_tracks_available and not self.CS.params_list.hyundai_radar_tracks_available_cache:
|
||||
events.add(car.CarEvent.EventName.hyundaiRadarTracksAvailable)
|
||||
|
||||
ret.customStockLong = self.update_custom_stock_long()
|
||||
|
||||
ret.events = events.to_msg()
|
||||
|
||||
return ret
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
from cereal import car
|
||||
import cereal.messaging as messaging
|
||||
from openpilot.common.conversions import Conversions as CV
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.common.realtime import DT_CTRL
|
||||
from opendbc.can.packer import CANPacker
|
||||
from openpilot.selfdrive.car import apply_driver_steer_torque_limits
|
||||
from openpilot.selfdrive.car.interfaces import CarControllerBase
|
||||
from openpilot.selfdrive.car.mazda import mazdacan
|
||||
from openpilot.selfdrive.car.mazda.values import CarControllerParams, Buttons
|
||||
from openpilot.selfdrive.controls.lib.drive_helpers import MAZDA_V_CRUISE_MIN
|
||||
|
||||
VisualAlert = car.CarControl.HUDControl.VisualAlert
|
||||
ButtonType = car.CarState.ButtonEvent.Type
|
||||
@@ -16,9 +21,63 @@ class CarController(CarControllerBase):
|
||||
self.packer = CANPacker(dbc_name)
|
||||
self.brake_counter = 0
|
||||
|
||||
self.sm = messaging.SubMaster(['longitudinalPlanSP'])
|
||||
self.param_s = Params()
|
||||
self.last_speed_limit_sign_tap_prev = False
|
||||
self.speed_limit = 0.
|
||||
self.speed_limit_offset = 0
|
||||
self.timer = 0
|
||||
self.final_speed_kph = 0
|
||||
self.init_speed = 0
|
||||
self.current_speed = 0
|
||||
self.v_set_dis = 0
|
||||
self.v_cruise_min = 0
|
||||
self.button_type = 0
|
||||
self.button_select = 0
|
||||
self.button_count = 0
|
||||
self.target_speed = 0
|
||||
self.t_interval = 7
|
||||
self.slc_active_stock = False
|
||||
self.sl_force_active_timer = 0
|
||||
self.v_tsc_state = 0
|
||||
self.slc_state = 0
|
||||
self.m_tsc_state = 0
|
||||
self.cruise_button = None
|
||||
self.speed_diff = 0
|
||||
self.v_tsc = 0
|
||||
self.m_tsc = 0
|
||||
self.steady_speed = 0
|
||||
|
||||
def update(self, CC, CS, now_nanos):
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
self.sm.update(0)
|
||||
|
||||
if self.sm.updated['longitudinalPlanSP']:
|
||||
self.v_tsc_state = self.sm['longitudinalPlanSP'].visionTurnControllerState
|
||||
self.slc_state = self.sm['longitudinalPlanSP'].speedLimitControlState
|
||||
self.m_tsc_state = self.sm['longitudinalPlanSP'].turnSpeedControlState
|
||||
self.speed_limit = self.sm['longitudinalPlanSP'].speedLimit
|
||||
self.speed_limit_offset = self.sm['longitudinalPlanSP'].speedLimitOffset
|
||||
self.v_tsc = self.sm['longitudinalPlanSP'].visionTurnSpeed
|
||||
self.m_tsc = self.sm['longitudinalPlanSP'].turnSpeed
|
||||
|
||||
self.v_cruise_min = MAZDA_V_CRUISE_MIN[CS.params_list.is_metric] * (CV.KPH_TO_MPH if not CS.params_list.is_metric else 1)
|
||||
|
||||
can_sends = []
|
||||
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
if not self.last_speed_limit_sign_tap_prev and CS.params_list.last_speed_limit_sign_tap:
|
||||
self.sl_force_active_timer = self.frame
|
||||
self.param_s.put_bool_nonblocking("LastSpeedLimitSignTap", False)
|
||||
self.last_speed_limit_sign_tap_prev = CS.params_list.last_speed_limit_sign_tap
|
||||
|
||||
sl_force_active = CS.params_list.speed_limit_control_enabled and (self.frame < (self.sl_force_active_timer * DT_CTRL + 2.0))
|
||||
sl_inactive = not sl_force_active and (not CS.params_list.speed_limit_control_enabled or (True if self.slc_state == 0 else False))
|
||||
sl_temp_inactive = not sl_force_active and (CS.params_list.speed_limit_control_enabled and (True if self.slc_state == 1 else False))
|
||||
slc_active = not sl_inactive and not sl_temp_inactive
|
||||
|
||||
self.slc_active_stock = slc_active
|
||||
|
||||
apply_steer = 0
|
||||
|
||||
if CC.latActive:
|
||||
@@ -43,6 +102,11 @@ class CarController(CarControllerBase):
|
||||
# Mazda Stop and Go requires a RES button (or gas) press if the car stops more than 3 seconds
|
||||
# Send Resume button when planner wants car to move
|
||||
can_sends.append(mazdacan.create_button_cmd(self.packer, self.CP, CS.crz_btns_counter, Buttons.RESUME))
|
||||
elif CS.out.cruiseState.enabled and not self.CP.pcmCruiseSpeed:
|
||||
self.cruise_button = self.get_cruise_buttons(CS, CC.vCruise)
|
||||
if self.cruise_button is not None:
|
||||
if self.frame % 10 == 0:
|
||||
can_sends.append(mazdacan.create_button_cmd(self.packer, self.CP, self.frame // 10, self.cruise_button))
|
||||
|
||||
self.apply_steer_last = apply_steer
|
||||
|
||||
@@ -64,3 +128,125 @@ class CarController(CarControllerBase):
|
||||
|
||||
self.frame += 1
|
||||
return new_actuators, can_sends
|
||||
|
||||
# multikyd methods, sunnyhaibin logic
|
||||
def get_cruise_buttons_status(self, CS):
|
||||
if not CS.out.cruiseState.enabled:
|
||||
for be in CS.out.buttonEvents:
|
||||
if be.type in (ButtonType.accelCruise, ButtonType.resumeCruise,
|
||||
ButtonType.decelCruise, ButtonType.setCruise) and be.pressed:
|
||||
self.timer = 40
|
||||
elif self.timer:
|
||||
self.timer -= 1
|
||||
else:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def get_target_speed(self, v_cruise_kph_prev):
|
||||
v_cruise_kph = v_cruise_kph_prev
|
||||
if self.slc_state > 1:
|
||||
v_cruise_kph = (self.speed_limit + self.speed_limit_offset) * CV.MS_TO_KPH
|
||||
if not self.slc_active_stock:
|
||||
v_cruise_kph = v_cruise_kph_prev
|
||||
return v_cruise_kph
|
||||
|
||||
def get_button_type(self, button_type):
|
||||
self.type_status = "type_" + str(button_type)
|
||||
self.button_picker = getattr(self, self.type_status, lambda: "default")
|
||||
return self.button_picker()
|
||||
|
||||
def reset_button(self):
|
||||
if self.button_type != 3:
|
||||
self.button_type = 0
|
||||
|
||||
def type_default(self):
|
||||
self.button_type = 0
|
||||
return None
|
||||
|
||||
def type_0(self):
|
||||
self.button_count = 0
|
||||
self.target_speed = self.init_speed
|
||||
self.speed_diff = self.target_speed - self.v_set_dis
|
||||
if self.target_speed > self.v_set_dis:
|
||||
return Buttons.SET_PLUS
|
||||
self.button_type = 1
|
||||
elif self.target_speed < self.v_set_dis and self.v_set_dis > self.v_cruise_min:
|
||||
return Buttons.SET_MINUS
|
||||
self.button_type = 2
|
||||
return None
|
||||
|
||||
def type_1(self):
|
||||
cruise_button = Buttons.SET_PLUS
|
||||
self.button_count += 1
|
||||
if self.target_speed <= self.v_set_dis:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
elif self.button_count > 5:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
return cruise_button
|
||||
|
||||
def type_2(self):
|
||||
cruise_button = Buttons.SET_MINUS
|
||||
self.button_count += 1
|
||||
if self.target_speed >= self.v_set_dis or self.v_set_dis <= self.v_cruise_min:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
elif self.button_count > 5:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
return cruise_button
|
||||
|
||||
def type_3(self):
|
||||
cruise_button = None
|
||||
self.button_count += 1
|
||||
if self.button_count > self.t_interval:
|
||||
self.button_type = 0
|
||||
return cruise_button
|
||||
|
||||
def get_curve_speed(self, target_speed_kph, v_cruise_kph_prev):
|
||||
if self.v_tsc_state != 0:
|
||||
vision_v_cruise_kph = self.v_tsc * CV.MS_TO_KPH
|
||||
if int(vision_v_cruise_kph) == int(v_cruise_kph_prev):
|
||||
vision_v_cruise_kph = 255
|
||||
else:
|
||||
vision_v_cruise_kph = 255
|
||||
if self.m_tsc_state > 1:
|
||||
map_v_cruise_kph = self.m_tsc * CV.MS_TO_KPH
|
||||
if int(map_v_cruise_kph) == 0.0:
|
||||
map_v_cruise_kph = 255
|
||||
else:
|
||||
map_v_cruise_kph = 255
|
||||
curve_speed = self.curve_speed_hysteresis(min(vision_v_cruise_kph, map_v_cruise_kph) + 2 * CV.MPH_TO_KPH)
|
||||
return min(target_speed_kph, curve_speed)
|
||||
|
||||
def get_button_control(self, CS, final_speed, v_cruise_kph_prev):
|
||||
self.init_speed = round(min(final_speed, v_cruise_kph_prev) * (CV.KPH_TO_MPH if not CS.params_list.is_metric else 1))
|
||||
self.v_set_dis = round(CS.out.cruiseState.speed * (CV.MS_TO_MPH if not CS.params_list.is_metric else CV.MS_TO_KPH))
|
||||
cruise_button = self.get_button_type(self.button_type)
|
||||
return cruise_button
|
||||
|
||||
def curve_speed_hysteresis(self, cur_speed: float, hyst=(0.75 * CV.MPH_TO_KPH)):
|
||||
if cur_speed > self.steady_speed:
|
||||
self.steady_speed = cur_speed
|
||||
elif cur_speed < self.steady_speed - hyst:
|
||||
self.steady_speed = cur_speed
|
||||
return self.steady_speed
|
||||
|
||||
def get_cruise_buttons(self, CS, v_cruise_kph_prev):
|
||||
cruise_button = None
|
||||
if not self.get_cruise_buttons_status(CS):
|
||||
pass
|
||||
elif CS.out.cruiseState.enabled:
|
||||
set_speed_kph = self.get_target_speed(v_cruise_kph_prev)
|
||||
if self.slc_state > 1:
|
||||
target_speed_kph = set_speed_kph
|
||||
else:
|
||||
target_speed_kph = min(v_cruise_kph_prev, set_speed_kph)
|
||||
if self.v_tsc_state != 0 or self.m_tsc_state > 1:
|
||||
self.final_speed_kph = self.get_curve_speed(target_speed_kph, v_cruise_kph_prev)
|
||||
else:
|
||||
self.final_speed_kph = target_speed_kph
|
||||
|
||||
cruise_button = self.get_button_control(CS, self.final_speed_kph, v_cruise_kph_prev) # MPH/KPH based button presses
|
||||
return cruise_button
|
||||
|
||||
@@ -89,6 +89,8 @@ class CarInterface(CarInterfaceBase):
|
||||
if self.CS.low_speed_alert:
|
||||
events.add(EventName.belowSteerSpeed)
|
||||
|
||||
ret.customStockLong = self.update_custom_stock_long()
|
||||
|
||||
ret.events = events.to_msg()
|
||||
|
||||
return ret
|
||||
|
||||
@@ -92,20 +92,22 @@ def create_button_cmd(packer, CP, counter, button):
|
||||
|
||||
can = int(button == Buttons.CANCEL)
|
||||
res = int(button == Buttons.RESUME)
|
||||
inc = int(button == Buttons.SET_PLUS)
|
||||
dec = int(button == Buttons.SET_MINUS)
|
||||
|
||||
if CP.flags & MazdaFlags.GEN1:
|
||||
values = {
|
||||
"CAN_OFF": can,
|
||||
"CAN_OFF_INV": (can + 1) % 2,
|
||||
|
||||
"SET_P": 0,
|
||||
"SET_P_INV": 1,
|
||||
"SET_P": inc,
|
||||
"SET_P_INV": (inc + 1) % 2,
|
||||
|
||||
"RES": res,
|
||||
"RES_INV": (res + 1) % 2,
|
||||
|
||||
"SET_M": 0,
|
||||
"SET_M_INV": 1,
|
||||
"SET_M": dec,
|
||||
"SET_M_INV": (dec + 1) % 2,
|
||||
|
||||
"DISTANCE_LESS": 0,
|
||||
"DISTANCE_LESS_INV": 1,
|
||||
|
||||
@@ -55,6 +55,13 @@ class CarController(CarControllerBase):
|
||||
self.last_blindspot_frame = 0
|
||||
|
||||
self._auto_lock_speed = 0.0
|
||||
|
||||
if CP.spFlags & ToyotaFlagsSP.SP_AUTO_BRAKE_HOLD:
|
||||
self.brake_hold_active: bool = False
|
||||
self._brake_hold_counter: int = 0
|
||||
self._brake_hold_reset: bool = False
|
||||
self._prev_brake_pressed: bool = False
|
||||
|
||||
self._auto_lock_once = False
|
||||
self._gear_prev = GearShifter.park
|
||||
|
||||
@@ -168,6 +175,9 @@ class CarController(CarControllerBase):
|
||||
|
||||
self.last_standstill = CS.out.standstill
|
||||
|
||||
if self.CP.spFlags & ToyotaFlagsSP.SP_AUTO_BRAKE_HOLD:
|
||||
can_sends.extend(self.create_auto_brake_hold_messages(CS))
|
||||
|
||||
# handle UI messages
|
||||
fcw_alert = hud_control.visualAlert == VisualAlert.fcw
|
||||
steer_alert = hud_control.visualAlert in (VisualAlert.steerRequired, VisualAlert.ldw)
|
||||
@@ -286,3 +296,25 @@ class CarController(CarControllerBase):
|
||||
# print("bsm poll right")
|
||||
|
||||
return can_sends
|
||||
|
||||
# auto brake hold (https://github.com/AlexandreSato/)
|
||||
def create_auto_brake_hold_messages(self, CS: car.CarState, brake_hold_allowed_timer: int = 100):
|
||||
can_sends = []
|
||||
disallowed_gears = [GearShifter.park, GearShifter.reverse]
|
||||
brake_hold_allowed = CS.out.standstill and CS.out.cruiseState.available and not CS.out.gasPressed and \
|
||||
not CS.out.cruiseState.enabled and (CS.out.gearShifter not in disallowed_gears)
|
||||
|
||||
if brake_hold_allowed:
|
||||
self._brake_hold_counter += 1
|
||||
self.brake_hold_active = self._brake_hold_counter > brake_hold_allowed_timer and not self._brake_hold_reset
|
||||
self._brake_hold_reset = not self._prev_brake_pressed and CS.out.brakePressed and not self._brake_hold_reset
|
||||
else:
|
||||
self._brake_hold_counter = 0
|
||||
self.brake_hold_active = False
|
||||
self._brake_hold_reset = False
|
||||
self._prev_brake_pressed = CS.out.brakePressed
|
||||
|
||||
if self.frame % 2 == 0:
|
||||
can_sends.append(toyotacan.create_brake_hold_command(self.packer, self.frame, CS.pre_collision_2, self.brake_hold_active))
|
||||
|
||||
return can_sends
|
||||
|
||||
@@ -79,6 +79,9 @@ class CarState(CarStateBase):
|
||||
self._right_blindspot_d2 = 0
|
||||
self._right_blindspot_counter = 0
|
||||
|
||||
if CP.spFlags & ToyotaFlagsSP.SP_AUTO_BRAKE_HOLD:
|
||||
self.pre_collision_2 = {}
|
||||
|
||||
self.frame = 0
|
||||
|
||||
def update(self, cp, cp_cam):
|
||||
@@ -260,6 +263,9 @@ class CarState(CarStateBase):
|
||||
if self.CP.spFlags & ToyotaFlagsSP.SP_ENHANCED_BSM and self.frame > 199:
|
||||
ret.leftBlindspot, ret.rightBlindspot = self.sp_get_enhanced_bsm(cp)
|
||||
|
||||
if self.CP.spFlags & ToyotaFlagsSP.SP_AUTO_BRAKE_HOLD:
|
||||
self.pre_collision_2 = copy.copy(cp_cam.vl["PRE_COLLISION_2"])
|
||||
|
||||
self._update_traffic_signals(cp_cam)
|
||||
ret.cruiseState.speedLimit = self._calculate_speed_limit()
|
||||
self.frame += 1
|
||||
@@ -463,4 +469,7 @@ class CarState(CarStateBase):
|
||||
("PCS_HUD", 1),
|
||||
]
|
||||
|
||||
if CP.spFlags & ToyotaFlagsSP.SP_AUTO_BRAKE_HOLD:
|
||||
messages.append(("PRE_COLLISION_2", 33))
|
||||
|
||||
return CANParser(DBC[CP.carFingerprint]["pt"], messages, 2)
|
||||
|
||||
@@ -160,26 +160,23 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
sp_tss2_long_tune = Params().get_bool("ToyotaTSS2Long")
|
||||
|
||||
# hand tuned (August 26, 2024)
|
||||
# hand tuned (August 12, 2024)
|
||||
def custom_tss2_longitudinal_tuning():
|
||||
ret.vEgoStopping = 0.25
|
||||
ret.vEgoStarting = 0.25
|
||||
ret.stoppingDecelRate = 0.0074
|
||||
|
||||
ret.vEgoStopping = 0.01
|
||||
ret.vEgoStarting = 0.01
|
||||
ret.stoppingDecelRate = 0.007
|
||||
def default_tss2_longitudinal_tuning():
|
||||
ret.vEgoStopping = 0.25
|
||||
ret.vEgoStarting = 0.25
|
||||
ret.stoppingDecelRate = 0.3 # reach stopping target smoothly
|
||||
|
||||
def default_longitudinal_tuning():
|
||||
tune.kiBP = [0., 5., 35.]
|
||||
tune.kiV = [3.6, 2.4, 1.5]
|
||||
|
||||
tune = ret.longitudinalTuning
|
||||
if candidate in TSS2_CAR or ret.enableGasInterceptorDEPRECATED:
|
||||
if sp_tss2_long_tune:
|
||||
tune.kiBP = [0., 3., 8., 12., 20., 27., 36., 50]
|
||||
tune.kiV = [0.322, 0.244, 0.224, 0.202, 0.17, 0.12, 0.08, 0.06]
|
||||
tune.kiBP = [ 0., 5., 12., 20., 27., 40.]
|
||||
tune.kiV = [.35, .228, .205, .195, .10, .01]
|
||||
custom_tss2_longitudinal_tuning()
|
||||
else:
|
||||
tune.kpV = [0.0]
|
||||
@@ -195,6 +192,9 @@ class CarInterface(CarInterfaceBase):
|
||||
if candidate == CAR.TOYOTA_PRIUS_TSS2:
|
||||
ret.spFlags |= ToyotaFlagsSP.SP_NEED_DEBUG_BSM.value
|
||||
|
||||
if Params().get_bool("ToyotaAutoHold") and candidate in (TSS2_CAR - RADAR_ACC_CAR):
|
||||
ret.spFlags |= ToyotaFlagsSP.SP_AUTO_BRAKE_HOLD.value
|
||||
|
||||
return ret
|
||||
|
||||
@staticmethod
|
||||
@@ -268,6 +268,11 @@ class CarInterface(CarInterfaceBase):
|
||||
# while in standstill, send a user alert
|
||||
events.add(EventName.manualRestart)
|
||||
|
||||
# auto brake hold
|
||||
if self.CP.spFlags & ToyotaFlagsSP.SP_AUTO_BRAKE_HOLD:
|
||||
if self.CC.brake_hold_active and not ret.brakeHoldActive:
|
||||
events.add(EventName.spAutoBrakeHold)
|
||||
|
||||
ret.events = events.to_msg()
|
||||
|
||||
return ret
|
||||
|
||||
@@ -130,3 +130,37 @@ def create_set_bsm_debug_mode(lr_blindspot, enabled):
|
||||
|
||||
def create_bsm_polling_status(lr_blindspot):
|
||||
return make_can_msg(0x750, lr_blindspot + b"\x02\x21\x69\x00\x00\x00\x00", 0)
|
||||
|
||||
|
||||
# auto brake hold
|
||||
def create_brake_hold_command(packer, frame, pre_collision_2, brake_hold_active):
|
||||
# forward PRE_COLLISION_2 when auto brake hold is not active
|
||||
values = {s: pre_collision_2[s] for s in [
|
||||
"DSS1GDRV",
|
||||
"DS1STAT2",
|
||||
"DS1STBK2",
|
||||
"PCSWAR",
|
||||
"PCSALM",
|
||||
"PCSOPR",
|
||||
"PCSABK",
|
||||
"PBATRGR",
|
||||
"PPTRGR",
|
||||
"IBTRGR",
|
||||
"CLEXTRGR",
|
||||
"IRLT_REQ",
|
||||
"BRKHLD",
|
||||
"AVSTRGR",
|
||||
"VGRSTRGR",
|
||||
"PREFILL",
|
||||
"PBRTRGR",
|
||||
"PCSDIS",
|
||||
"PBPREPMP",
|
||||
]}
|
||||
|
||||
if brake_hold_active:
|
||||
values = {
|
||||
"DSS1GDRV": 0x3FF,
|
||||
"PBRTRGR": frame % 730 < 727, # cut actuation for 3 frames
|
||||
}
|
||||
|
||||
return packer.make_can_msg("PRE_COLLISION_2", 0, values)
|
||||
|
||||
@@ -16,7 +16,7 @@ PEDAL_TRANSITION = 10. * CV.MPH_TO_MS
|
||||
|
||||
|
||||
class CarControllerParams:
|
||||
ACCEL_MAX = 1.5 # m/s2, lower than allowed 2.0 m/s2 for tuning reasons
|
||||
ACCEL_MAX = 2.0 # m/s2, lower than allowed 2.0 m/s2 for tuning reasons
|
||||
ACCEL_MIN = -3.5 # m/s2
|
||||
|
||||
STEER_STEP = 1
|
||||
@@ -64,6 +64,7 @@ class ToyotaFlagsSP(IntFlag):
|
||||
SP_ZSS = 1
|
||||
SP_ENHANCED_BSM = 2
|
||||
SP_NEED_DEBUG_BSM = 4
|
||||
SP_AUTO_BRAKE_HOLD = 8
|
||||
|
||||
|
||||
class Footnote(Enum):
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
from cereal import car
|
||||
import cereal.messaging as messaging
|
||||
from opendbc.can.packer import CANPacker
|
||||
from openpilot.common.numpy_fast import clip
|
||||
from openpilot.common.conversions import Conversions as CV
|
||||
from openpilot.common.params import Params
|
||||
from openpilot.selfdrive.car import DT_CTRL, apply_driver_steer_torque_limits
|
||||
from openpilot.selfdrive.car.interfaces import CarControllerBase
|
||||
from openpilot.selfdrive.car.volkswagen import mqbcan, pqcan
|
||||
from openpilot.selfdrive.car.volkswagen.values import CANBUS, CarControllerParams, VolkswagenFlags
|
||||
from openpilot.selfdrive.controls.lib.drive_helpers import VOLKSWAGEN_V_CRUISE_MIN
|
||||
|
||||
VisualAlert = car.CarControl.HUDControl.VisualAlert
|
||||
LongCtrlState = car.CarControl.Actuators.LongControlState
|
||||
@@ -25,12 +28,70 @@ class CarController(CarControllerBase):
|
||||
self.eps_timer_soft_disable_alert = False
|
||||
self.hca_frame_timer_running = 0
|
||||
self.hca_frame_same_torque = 0
|
||||
self.last_button_frame = 0
|
||||
|
||||
self.sm = messaging.SubMaster(['longitudinalPlanSP'])
|
||||
self.param_s = Params()
|
||||
self.last_speed_limit_sign_tap_prev = False
|
||||
self.speed_limit = 0.
|
||||
self.speed_limit_offset = 0
|
||||
self.timer = 0
|
||||
self.final_speed_kph = 0
|
||||
self.init_speed = 0
|
||||
self.current_speed = 0
|
||||
self.v_set_dis = 0
|
||||
self.v_set_dis_prev = 0
|
||||
self.v_cruise_min = 0
|
||||
self.button_type = 0
|
||||
self.button_select = 0
|
||||
self.button_count = 0
|
||||
self.target_speed = 0
|
||||
self.t_interval = 7
|
||||
self.slc_active_stock = False
|
||||
self.sl_force_active_timer = 0
|
||||
self.v_tsc_state = 0
|
||||
self.slc_state = 0
|
||||
self.m_tsc_state = 0
|
||||
self.cruise_button = None
|
||||
self.last_cruise_button = None
|
||||
self.speed_diff = 0
|
||||
self.v_tsc = 0
|
||||
self.m_tsc = 0
|
||||
self.steady_speed = 0
|
||||
self.acc_type = -1
|
||||
self.send_count = 0
|
||||
|
||||
def update(self, CC, CS, now_nanos):
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
self.sm.update(0)
|
||||
|
||||
if self.sm.updated['longitudinalPlanSP']:
|
||||
self.v_tsc_state = self.sm['longitudinalPlanSP'].visionTurnControllerState
|
||||
self.slc_state = self.sm['longitudinalPlanSP'].speedLimitControlState
|
||||
self.m_tsc_state = self.sm['longitudinalPlanSP'].turnSpeedControlState
|
||||
self.speed_limit = self.sm['longitudinalPlanSP'].speedLimit
|
||||
self.speed_limit_offset = self.sm['longitudinalPlanSP'].speedLimitOffset
|
||||
self.v_tsc = self.sm['longitudinalPlanSP'].visionTurnSpeed
|
||||
self.m_tsc = self.sm['longitudinalPlanSP'].turnSpeed
|
||||
|
||||
self.v_cruise_min = VOLKSWAGEN_V_CRUISE_MIN[CS.params_list.is_metric] * (CV.KPH_TO_MPH if not CS.params_list.is_metric else 1)
|
||||
actuators = CC.actuators
|
||||
hud_control = CC.hudControl
|
||||
can_sends = []
|
||||
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
if not self.last_speed_limit_sign_tap_prev and CS.params_list.last_speed_limit_sign_tap:
|
||||
self.sl_force_active_timer = self.frame
|
||||
self.param_s.put_bool_nonblocking("LastSpeedLimitSignTap", False)
|
||||
self.last_speed_limit_sign_tap_prev = CS.params_list.last_speed_limit_sign_tap
|
||||
|
||||
sl_force_active = CS.params_list.speed_limit_control_enabled and (self.frame < (self.sl_force_active_timer * DT_CTRL + 2.0))
|
||||
sl_inactive = not sl_force_active and (not CS.params_list.speed_limit_control_enabled or (True if self.slc_state == 0 else False))
|
||||
sl_temp_inactive = not sl_force_active and (CS.params_list.speed_limit_control_enabled and (True if self.slc_state == 1 else False))
|
||||
slc_active = not sl_inactive and not sl_temp_inactive
|
||||
|
||||
self.slc_active_stock = slc_active
|
||||
|
||||
# **** Steering Controls ************************************************ #
|
||||
|
||||
if self.frame % self.CCP.STEER_STEP == 0:
|
||||
@@ -110,11 +171,155 @@ class CarController(CarControllerBase):
|
||||
if gra_send_ready and (CC.cruiseControl.cancel or CC.cruiseControl.resume):
|
||||
can_sends.append(self.CCS.create_acc_buttons_control(self.packer_pt, self.ext_bus, CS.gra_stock_values,
|
||||
cancel=CC.cruiseControl.cancel, resume=CC.cruiseControl.resume))
|
||||
if not (CC.cruiseControl.cancel or CC.cruiseControl.resume) and CS.out.cruiseState.enabled:
|
||||
if not self.CP.pcmCruiseSpeed:
|
||||
self.cruise_button = self.get_cruise_buttons(CS, CC.vCruise)
|
||||
if self.cruise_button is not None:
|
||||
if self.acc_type == -1:
|
||||
if self.button_count >= 2 and self.v_set_dis_prev != self.v_set_dis:
|
||||
self.acc_type = 1 if abs(self.v_set_dis - self.v_set_dis_prev) >= 10 and self.last_cruise_button in (1, 2) else \
|
||||
0 if abs(self.v_set_dis - self.v_set_dis_prev) < 10 and self.last_cruise_button not in (1, 2) else 1
|
||||
if self.send_count >= 10 and self.v_set_dis_prev == self.v_set_dis:
|
||||
self.cruise_button = 3 if self.cruise_button == 1 else 4
|
||||
if self.acc_type == 0:
|
||||
self.cruise_button = 1 if self.cruise_button == 1 else 2 # accel, decel
|
||||
elif self.acc_type == 1:
|
||||
self.cruise_button = 3 if self.cruise_button == 1 else 4 # resume, set
|
||||
if self.frame % self.CCP.BTN_STEP == 0:
|
||||
can_sends.append(self.CCS.create_acc_buttons_control(self.packer_pt, CS.gra_stock_values, frame=(self.frame // self.CCP.BTN_STEP),
|
||||
buttons=self.cruise_button, custom_stock_long=True))
|
||||
self.send_count += 1
|
||||
else:
|
||||
self.send_count = 0
|
||||
self.last_cruise_button = self.cruise_button
|
||||
|
||||
new_actuators = actuators.as_builder()
|
||||
new_actuators.steer = self.apply_steer_last / self.CCP.STEER_MAX
|
||||
new_actuators.steerOutputCan = self.apply_steer_last
|
||||
|
||||
self.gra_acc_counter_last = CS.gra_stock_values["COUNTER"]
|
||||
self.v_set_dis_prev = self.v_set_dis
|
||||
self.frame += 1
|
||||
return new_actuators, can_sends
|
||||
|
||||
# multikyd methods, sunnyhaibin logic
|
||||
def get_cruise_buttons_status(self, CS):
|
||||
if not CS.out.cruiseState.enabled:
|
||||
for be in CS.out.buttonEvents:
|
||||
if be.type in (ButtonType.accelCruise, ButtonType.resumeCruise,
|
||||
ButtonType.decelCruise, ButtonType.setCruise) and be.pressed:
|
||||
self.timer = 40
|
||||
elif be.type == ButtonType.gapAdjustCruise and be.pressed:
|
||||
self.timer = 300
|
||||
elif self.timer:
|
||||
self.timer -= 1
|
||||
else:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
def get_target_speed(self, v_cruise_kph_prev):
|
||||
v_cruise_kph = v_cruise_kph_prev
|
||||
if self.slc_state > 1:
|
||||
v_cruise_kph = (self.speed_limit + self.speed_limit_offset) * CV.MS_TO_KPH
|
||||
if not self.slc_active_stock:
|
||||
v_cruise_kph = v_cruise_kph_prev
|
||||
return v_cruise_kph
|
||||
|
||||
def get_button_type(self, button_type):
|
||||
self.type_status = "type_" + str(button_type)
|
||||
self.button_picker = getattr(self, self.type_status, lambda: "default")
|
||||
return self.button_picker()
|
||||
|
||||
def reset_button(self):
|
||||
if self.button_type != 3:
|
||||
self.button_type = 0
|
||||
|
||||
def type_default(self):
|
||||
self.button_type = 0
|
||||
return None
|
||||
|
||||
def type_0(self):
|
||||
self.button_count = 0
|
||||
self.target_speed = self.init_speed
|
||||
self.speed_diff = self.target_speed - self.v_set_dis
|
||||
if self.target_speed > self.v_set_dis:
|
||||
self.button_type = 1
|
||||
elif self.target_speed < self.v_set_dis and self.v_set_dis > self.v_cruise_min:
|
||||
self.button_type = 2
|
||||
return None
|
||||
|
||||
def type_1(self):
|
||||
cruise_button = 1
|
||||
self.button_count += 1
|
||||
if self.target_speed <= self.v_set_dis:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
elif self.button_count > 5:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
return cruise_button
|
||||
|
||||
def type_2(self):
|
||||
cruise_button = 2
|
||||
self.button_count += 1
|
||||
if self.target_speed >= self.v_set_dis or self.v_set_dis <= self.v_cruise_min:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
elif self.button_count > 5:
|
||||
self.button_count = 0
|
||||
self.button_type = 3
|
||||
return cruise_button
|
||||
|
||||
def type_3(self):
|
||||
cruise_button = None
|
||||
self.button_count += 1
|
||||
if self.button_count > self.t_interval:
|
||||
self.button_type = 0
|
||||
return cruise_button
|
||||
|
||||
def get_curve_speed(self, target_speed_kph, v_cruise_kph_prev):
|
||||
if self.v_tsc_state != 0:
|
||||
vision_v_cruise_kph = self.v_tsc * CV.MS_TO_KPH
|
||||
if int(vision_v_cruise_kph) == int(v_cruise_kph_prev):
|
||||
vision_v_cruise_kph = 255
|
||||
else:
|
||||
vision_v_cruise_kph = 255
|
||||
if self.m_tsc_state > 1:
|
||||
map_v_cruise_kph = self.m_tsc * CV.MS_TO_KPH
|
||||
if int(map_v_cruise_kph) == 0.0:
|
||||
map_v_cruise_kph = 255
|
||||
else:
|
||||
map_v_cruise_kph = 255
|
||||
curve_speed = self.curve_speed_hysteresis(min(vision_v_cruise_kph, map_v_cruise_kph) + 2 * CV.MPH_TO_KPH)
|
||||
return min(target_speed_kph, curve_speed)
|
||||
|
||||
def get_button_control(self, CS, final_speed, v_cruise_kph_prev):
|
||||
self.init_speed = round(min(final_speed, v_cruise_kph_prev) * (CV.KPH_TO_MPH if not CS.params_list.is_metric else 1))
|
||||
self.v_set_dis = round(CS.out.cruiseState.speed * (CV.MS_TO_MPH if not CS.params_list.is_metric else CV.MS_TO_KPH))
|
||||
cruise_button = self.get_button_type(self.button_type)
|
||||
return cruise_button
|
||||
|
||||
def curve_speed_hysteresis(self, cur_speed: float, hyst=(0.75 * CV.MPH_TO_KPH)):
|
||||
if cur_speed > self.steady_speed:
|
||||
self.steady_speed = cur_speed
|
||||
elif cur_speed < self.steady_speed - hyst:
|
||||
self.steady_speed = cur_speed
|
||||
return self.steady_speed
|
||||
|
||||
def get_cruise_buttons(self, CS, v_cruise_kph_prev):
|
||||
cruise_button = None
|
||||
if not self.get_cruise_buttons_status(CS):
|
||||
pass
|
||||
elif CS.out.cruiseState.enabled:
|
||||
set_speed_kph = self.get_target_speed(v_cruise_kph_prev)
|
||||
if self.slc_state > 1:
|
||||
target_speed_kph = set_speed_kph
|
||||
else:
|
||||
target_speed_kph = min(v_cruise_kph_prev, set_speed_kph)
|
||||
if self.v_tsc_state != 0 or self.m_tsc_state > 1:
|
||||
self.final_speed_kph = self.get_curve_speed(target_speed_kph, v_cruise_kph_prev)
|
||||
else:
|
||||
self.final_speed_kph = target_speed_kph
|
||||
|
||||
cruise_button = self.get_button_control(CS, self.final_speed_kph, v_cruise_kph_prev) # MPH/KPH based button presses
|
||||
return cruise_button
|
||||
|
||||
@@ -171,6 +171,8 @@ class CarInterface(CarInterfaceBase):
|
||||
if self.CC.eps_timer_soft_disable_alert:
|
||||
events.add(EventName.steerTimeLimit)
|
||||
|
||||
ret.customStockLong = self.update_custom_stock_long()
|
||||
|
||||
ret.events = events.to_msg()
|
||||
|
||||
return ret
|
||||
|
||||
@@ -49,7 +49,7 @@ def create_lka_hud_control(packer, bus, ldw_stock_values, lat_active, steering_p
|
||||
return packer.make_can_msg("LDW_02", bus, values)
|
||||
|
||||
|
||||
def create_acc_buttons_control(packer, bus, gra_stock_values, cancel=False, resume=False):
|
||||
def create_acc_buttons_control(packer, bus, gra_stock_values, frame=0, buttons=0, cancel=False, resume=False, custom_stock_long=False):
|
||||
values = {s: gra_stock_values[s] for s in [
|
||||
"GRA_Hauptschalter", # ACC button, on/off
|
||||
"GRA_Typ_Hauptschalter", # ACC main button type
|
||||
@@ -58,10 +58,18 @@ def create_acc_buttons_control(packer, bus, gra_stock_values, cancel=False, resu
|
||||
"GRA_ButtonTypeInfo", # unknown related to stalk type
|
||||
]}
|
||||
|
||||
accel_cruise = 1 if buttons == 1 else 0
|
||||
decel_cruise = 1 if buttons == 2 else 0
|
||||
resume_cruise = 1 if buttons == 3 else 0
|
||||
set_cruise = 1 if buttons == 4 else 0
|
||||
|
||||
values.update({
|
||||
"COUNTER": (gra_stock_values["COUNTER"] + 1) % 16,
|
||||
"COUNTER": (frame + 1) % 0x10 if custom_stock_long else (gra_stock_values["COUNTER"] + 1) % 16,
|
||||
"GRA_Abbrechen": cancel,
|
||||
"GRA_Tip_Wiederaufnahme": resume,
|
||||
"GRA_Tip_Wiederaufnahme": resume or resume_cruise,
|
||||
"GRA_Tip_Setzen": set_cruise,
|
||||
"GRA_Tip_Runter": decel_cruise,
|
||||
"GRA_Tip_Hoch": accel_cruise,
|
||||
})
|
||||
|
||||
return packer.make_can_msg("GRA_ACC_01", bus, values)
|
||||
|
||||
@@ -31,7 +31,7 @@ def create_lka_hud_control(packer, bus, ldw_stock_values, lat_active, steering_p
|
||||
return packer.make_can_msg("LDW_Status", bus, values)
|
||||
|
||||
|
||||
def create_acc_buttons_control(packer, bus, gra_stock_values, cancel=False, resume=False):
|
||||
def create_acc_buttons_control(packer, bus, gra_stock_values, frame=0, buttons=0, cancel=False, resume=False, custom_stock_long=False):
|
||||
values = {s: gra_stock_values[s] for s in [
|
||||
"GRA_Hauptschalt", # ACC button, on/off
|
||||
"GRA_Typ_Hauptschalt", # ACC button, momentary vs latching
|
||||
@@ -39,10 +39,18 @@ def create_acc_buttons_control(packer, bus, gra_stock_values, cancel=False, resu
|
||||
"GRA_Sender", # ACC button, CAN message originator
|
||||
]}
|
||||
|
||||
accel_cruise = 1 if buttons == 1 else 0
|
||||
decel_cruise = 1 if buttons == 2 else 0
|
||||
resume_cruise = 1 if buttons == 3 else 0
|
||||
set_cruise = 1 if buttons == 4 else 0
|
||||
|
||||
values.update({
|
||||
"COUNTER": (gra_stock_values["COUNTER"] + 1) % 16,
|
||||
"COUNTER": (frame + 1) % 0x10 if custom_stock_long else (gra_stock_values["COUNTER"] + 1) % 16,
|
||||
"GRA_Abbrechen": cancel,
|
||||
"GRA_Recall": resume,
|
||||
"GRA_Recall": resume or resume_cruise,
|
||||
"GRA_Neu_Setzen": set_cruise,
|
||||
"GRA_Down_kurz": decel_cruise,
|
||||
"GRA_Up_kurz": accel_cruise,
|
||||
})
|
||||
|
||||
return packer.make_can_msg("GRA_Neu", bus, values)
|
||||
|
||||
@@ -744,6 +744,14 @@ EVENTS: dict[int, dict[str, Alert | AlertCallbackType]] = {
|
||||
ET.NO_ENTRY: NoEntryAlert("Brake Hold Active"),
|
||||
},
|
||||
|
||||
EventName.spAutoBrakeHold: {
|
||||
ET.PERMANENT: Alert(
|
||||
"sunnypilot Brake Hold Active",
|
||||
"",
|
||||
AlertStatus.normal, AlertSize.small,
|
||||
Priority.LOWEST, VisualAlert.none, AudibleAlert.prompt, 0.),
|
||||
},
|
||||
|
||||
EventName.parkBrake: {
|
||||
ET.USER_DISABLE: EngagementAlert(AudibleAlert.disengage),
|
||||
ET.NO_ENTRY: NoEntryAlert("Parking Brake Engaged"),
|
||||
|
||||
@@ -4,6 +4,7 @@ import time
|
||||
import numpy as np
|
||||
from cereal import custom
|
||||
from openpilot.common.numpy_fast import clip
|
||||
from openpilot.common.conversions import Conversions as CV
|
||||
from openpilot.common.realtime import DT_MDL
|
||||
from openpilot.common.swaglog import cloudlog
|
||||
# WARNING: imports outside of constants will not trigger a rebuild
|
||||
@@ -63,9 +64,9 @@ def get_jerk_factor(personality=custom.LongitudinalPersonalitySP.standard):
|
||||
elif personality==custom.LongitudinalPersonalitySP.standard:
|
||||
return 1.0
|
||||
elif personality==custom.LongitudinalPersonalitySP.moderate:
|
||||
return 0.85
|
||||
return 0.95
|
||||
elif personality==custom.LongitudinalPersonalitySP.aggressive:
|
||||
return 0.8
|
||||
return 0.9
|
||||
elif personality==custom.LongitudinalPersonalitySP.overtake:
|
||||
return 0.1
|
||||
else:
|
||||
@@ -93,21 +94,35 @@ def get_dynamic_personality(v_ego, personality=custom.LongitudinalPersonalitySP.
|
||||
y_dist = [1.0, 1.0, 1.75, 1.75, 1.83]
|
||||
elif personality==custom.LongitudinalPersonalitySP.standard:
|
||||
x_vel = [0, 20., 27.7]
|
||||
y_dist = [1.75, 1.75, 1.70]
|
||||
y_dist = [1.70, 1.70, 1.70]
|
||||
elif personality==custom.LongitudinalPersonalitySP.moderate:
|
||||
x_vel = [0, 27.69, 27.7]
|
||||
y_dist = [1.45, 1.45, 1.40]
|
||||
y_dist = [1.40, 1.40, 1.45]
|
||||
elif personality==custom.LongitudinalPersonalitySP.aggressive:
|
||||
x_vel = [0, 20.0, 20.01, 27.69, 27.7]
|
||||
y_dist = [1.07, 1.07, 1.12, 1.12, 1.20]
|
||||
x_vel = [0, 5., 20.0, 20.01, 27.69, 27.7]
|
||||
y_dist = [0.80, 1.10, 1.10, 1.12, 1.12, 1.20]
|
||||
else:
|
||||
raise NotImplementedError("Dynamic personality not supported")
|
||||
return np.interp(v_ego, x_vel, y_dist)
|
||||
|
||||
|
||||
def get_stopped_equivalence_factor(v_lead):
|
||||
return (v_lead**2) / (2 * COMFORT_BRAKE)
|
||||
|
||||
def get_stopped_equivalence_factor_krkeegen(v_lead, v_ego):
|
||||
# KRKeegan this offset rapidly decreases the following distance when the lead pulls
|
||||
# away, resulting in an early demand for acceleration.
|
||||
v_diff_offset = 0
|
||||
v_diff_offset_max = 12
|
||||
speed_to_reach_max_v_diff_offset = 26 # in kp/h
|
||||
speed_to_reach_max_v_diff_offset = speed_to_reach_max_v_diff_offset * CV.KPH_TO_MS
|
||||
delta_speed = v_lead - v_ego
|
||||
if np.all(delta_speed > 0):
|
||||
v_diff_offset = delta_speed * 2
|
||||
v_diff_offset = np.clip(v_diff_offset, 0, v_diff_offset_max)
|
||||
# increase in a linear behavior
|
||||
v_diff_offset = np.maximum(v_diff_offset * ((speed_to_reach_max_v_diff_offset - v_ego)/speed_to_reach_max_v_diff_offset), 0)
|
||||
return (v_lead**2) / (2 * COMFORT_BRAKE) + v_diff_offset
|
||||
|
||||
def get_safe_obstacle_distance(v_ego, t_follow):
|
||||
return (v_ego**2) / (2 * COMFORT_BRAKE) + t_follow * v_ego + STOP_DISTANCE
|
||||
|
||||
@@ -302,15 +317,24 @@ class LongitudinalMpc:
|
||||
for i in range(N):
|
||||
self.solver.cost_set(i, 'Zl', Zl)
|
||||
|
||||
def set_weights(self, prev_accel_constraint=True, personality=custom.LongitudinalPersonalitySP.standard):
|
||||
def set_weights(self, prev_accel_constraint=True, personality=custom.LongitudinalPersonalitySP.standard, v_lead0=0, v_lead1=0):
|
||||
jerk_factor = get_jerk_factor(personality)
|
||||
v_ego = self.x0[1]
|
||||
v_ego_bps = [0, 10]
|
||||
# KRKeegan adjustments to improve sluggish acceleration
|
||||
# do not apply to deceleration
|
||||
j_ego_v_ego = 1
|
||||
a_change_v_ego = 1
|
||||
if (v_lead0 - v_ego >= 0) and (v_lead1 - v_ego >= 0):
|
||||
j_ego_v_ego = np.interp(v_ego, v_ego_bps, [.05, 1.])
|
||||
a_change_v_ego = np.interp(v_ego, v_ego_bps, [.05, 1.])
|
||||
if self.mode == 'acc':
|
||||
a_change_cost = A_CHANGE_COST if prev_accel_constraint else 0
|
||||
cost_weights = [X_EGO_OBSTACLE_COST, X_EGO_COST, V_EGO_COST, A_EGO_COST, jerk_factor * a_change_cost, jerk_factor * J_EGO_COST]
|
||||
cost_weights = [X_EGO_OBSTACLE_COST, X_EGO_COST, V_EGO_COST, A_EGO_COST, jerk_factor * a_change_cost * a_change_v_ego, jerk_factor * J_EGO_COST * j_ego_v_ego]
|
||||
constraint_cost_weights = [LIMIT_COST, LIMIT_COST, LIMIT_COST, DANGER_ZONE_COST]
|
||||
elif self.mode == 'blended':
|
||||
a_change_cost = 40.0 if prev_accel_constraint else 0
|
||||
cost_weights = [0., 0.1, 0.2, 5.0, a_change_cost, 1.0]
|
||||
cost_weights = [0., 0.1, 0.2, 5.0, a_change_cost * a_change_v_ego, 1.0]
|
||||
constraint_cost_weights = [LIMIT_COST, LIMIT_COST, LIMIT_COST, 50.0]
|
||||
else:
|
||||
raise NotImplementedError(f'Planner mode {self.mode} not recognized in planner cost set')
|
||||
@@ -362,7 +386,7 @@ class LongitudinalMpc:
|
||||
self.max_a = max_a
|
||||
|
||||
def update(self, radarstate, v_cruise, x, v, a, j, personality=custom.LongitudinalPersonalitySP.standard,
|
||||
dynamic_personality=False, overtaking_acceleration_assist=False):
|
||||
dynamic_personality=False, overtaking_acceleration_assist=False, fast_take_off = False):
|
||||
v_ego = self.x0[1]
|
||||
t_follow = get_dynamic_personality(v_ego, personality) if dynamic_personality else get_T_FOLLOW(personality)
|
||||
t_follow = get_T_FOLLOW(custom.LongitudinalPersonalitySP.overtake) if overtaking_acceleration_assist else t_follow
|
||||
@@ -374,8 +398,12 @@ class LongitudinalMpc:
|
||||
# To estimate a safe distance from a moving lead, we calculate how much stopping
|
||||
# distance that lead needs as a minimum. We can add that to the current distance
|
||||
# and then treat that as a stopped car/obstacle at this new distance.
|
||||
lead_0_obstacle = lead_xv_0[:,0] + get_stopped_equivalence_factor(lead_xv_0[:,1])
|
||||
lead_1_obstacle = lead_xv_1[:,0] + get_stopped_equivalence_factor(lead_xv_1[:,1])
|
||||
if fast_take_off:
|
||||
lead_0_obstacle = lead_xv_0[:,0] + get_stopped_equivalence_factor_krkeegen(lead_xv_0[:,1], v_ego)
|
||||
lead_1_obstacle = lead_xv_1[:,0] + get_stopped_equivalence_factor_krkeegen(lead_xv_1[:,1], v_ego)
|
||||
else:
|
||||
lead_0_obstacle = lead_xv_0[:,0] + get_stopped_equivalence_factor(lead_xv_0[:,1])
|
||||
lead_1_obstacle = lead_xv_1[:,0] + get_stopped_equivalence_factor(lead_xv_1[:,1])
|
||||
|
||||
cruise_target_e2ex = T_IDXS * np.clip(v_cruise, v_ego - 2.0, 1e3) + x[0]
|
||||
e2e_xforward = ((v[1:] + v[:-1]) / 2) * (T_IDXS[1:] - T_IDXS[:-1])
|
||||
|
||||
@@ -103,6 +103,7 @@ class LongitudinalPlanner:
|
||||
self.turn_speed_controller = TurnSpeedController()
|
||||
self.dynamic_experimental_controller = DynamicExperimentalController()
|
||||
self.accel_controller = AccelController()
|
||||
self.fast_take_off = False
|
||||
|
||||
def read_param(self):
|
||||
try:
|
||||
@@ -110,6 +111,7 @@ class LongitudinalPlanner:
|
||||
except AttributeError:
|
||||
self.dynamic_experimental_controller = DynamicExperimentalController()
|
||||
self.accel_controller = AccelController()
|
||||
self.fast_take_off = self.params.get_bool("FastTakeOff")
|
||||
|
||||
@staticmethod
|
||||
def parse_model(model_msg, model_error):
|
||||
@@ -202,7 +204,7 @@ class LongitudinalPlanner:
|
||||
self.mpc.set_cur_state(self.v_desired_filter.x, self.a_desired)
|
||||
x, v, a, j = self.parse_model(sm['modelV2'], self.v_model_error)
|
||||
self.mpc.update(sm['radarState'], v_cruise, x, v, a, j, personality=sm['controlsStateSP'].personality,
|
||||
dynamic_personality=sm['controlsStateSP'].dynamicPersonality, overtaking_acceleration_assist=overtaking_accel_engaged)
|
||||
dynamic_personality=sm['controlsStateSP'].dynamicPersonality, overtaking_acceleration_assist=overtaking_accel_engaged, fast_take_off=self.fast_take_off)
|
||||
|
||||
self.v_desired_trajectory = np.interp(CONTROL_N_T_IDX, T_IDXS_MPC, self.mpc.v_solution)
|
||||
self.a_desired_trajectory = np.interp(CONTROL_N_T_IDX, T_IDXS_MPC, self.mpc.a_solution)
|
||||
|
||||
@@ -29,17 +29,18 @@ from openpilot.common.numpy_fast import interp
|
||||
AccelPersonality = custom.AccelerationPersonality
|
||||
|
||||
# accel personality by @arne182 modified by cgw and kumar
|
||||
_DP_CRUISE_MIN_V = [-0.031, -0.031, -0.080, -0.080, -0.19, -0.19, -0.59, -0.59, -0.79, -0.79, -1.0, -1.0]
|
||||
_DP_CRUISE_MIN_V_ECO = [-0.030, -0.030, -0.075, -0.075, -0.18, -0.18, -0.58, -0.58, -0.78, -0.78, -1.0, -1.0]
|
||||
_DP_CRUISE_MIN_V_SPORT = [-0.102, -0.102, -0.085, -0.085, -0.20, -0.20, -0.60, -0.60, -0.80, -0.80, -1.0, -1.0]
|
||||
_DP_CRUISE_MIN_V = [-0.69, -0.69, -0.69, -0.69, -0.69, -0.69, -0.79, -0.79, -0.79, -0.79, -1.0, -1.0]
|
||||
_DP_CRUISE_MIN_V_ECO = [-0.68, -0.68, -0.68, -0.68, -0.68, -0.68, -0.78, -0.78, -0.88, -0.88, -1.0, -1.0]
|
||||
_DP_CRUISE_MIN_V_SPORT = [-0.70, -0.70, -0.70, -0.70, -0.70, -0.70, -0.80, -0.80, -0.90, -0.90, -1.0, -1.0]
|
||||
_DP_CRUISE_MIN_BP = [0., 3.0, 3.01, 10., 10.01, 14., 14.01, 18., 18.01, 22., 22.01, 30.]
|
||||
|
||||
_DP_CRUISE_MAX_V = [2.0, 2.0, 2.0, 1.70, 1.11, .70, .54, .38, .17]
|
||||
_DP_CRUISE_MAX_V_ECO = [2.0, 2.0, 1.8, 1.40, 0.90, .53, .43, .32, .09]
|
||||
_DP_CRUISE_MAX_V = [2.0, 2.0, 2.0, 1.80, 1.11, .70, .54, .38, .17]
|
||||
_DP_CRUISE_MAX_V_ECO = [2.0, 2.0, 2.0, 1.60, 0.90, .53, .43, .32, .09]
|
||||
_DP_CRUISE_MAX_V_SPORT = [2.0, 2.0, 2.0, 2.00, 1.40, .90, .70, .50, .30]
|
||||
_DP_CRUISE_MAX_BP = [0., 4., 6., 8., 11., 20., 25., 30., 40.]
|
||||
|
||||
|
||||
|
||||
class AccelController:
|
||||
def __init__(self):
|
||||
self._personality = AccelPersonality.stock
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
#
|
||||
# Version = 2024-8-26
|
||||
# Version = 2024-7-11
|
||||
from common.numpy_fast import interp
|
||||
import numpy as np
|
||||
|
||||
@@ -112,6 +112,7 @@ class DynamicExperimentalController:
|
||||
self._mode_changed = False
|
||||
self._frame = 0
|
||||
|
||||
# Use weighted moving average for filtering leads
|
||||
self._lead_gmac = WeightedMovingAverageCalculator(window_size=LEAD_WINDOW_SIZE)
|
||||
self._has_lead_filtered = False
|
||||
self._has_lead_filtered_prev = False
|
||||
@@ -371,4 +372,4 @@ class DynamicExperimentalController:
|
||||
self._set_mode_timeout = SET_MODE_TIMEOUT
|
||||
|
||||
if self._set_mode_timeout > 0:
|
||||
self._set_mode_timeout -= 1
|
||||
self._set_mode_timeout -= 1
|
||||
|
||||
@@ -43,6 +43,12 @@ SunnypilotPanel::SunnypilotPanel(QWidget *parent) : QFrame(parent) {
|
||||
tr("Enable the beloved M.A.D.S. feature. Disable toggle to revert back to stock openpilot engagement/disengagement."),
|
||||
"../assets/offroad/icon_blank.png",
|
||||
},
|
||||
{
|
||||
"FastTakeOff",
|
||||
tr("Very fast prius"),
|
||||
tr("When prius goes faster then sunnys car :) vroom"),
|
||||
"../assets/offroad/icon_blank.png",
|
||||
},
|
||||
{
|
||||
"VisionCurveLaneless",
|
||||
tr("Laneless for Curves in \"Auto\" Mode"),
|
||||
|
||||
@@ -159,6 +159,18 @@ SPVehiclesTogglesPanel::SPVehiclesTogglesPanel(VehiclePanel *parent) : ListWidge
|
||||
toyotaTss2LongTune->setConfirmation(true, false);
|
||||
addItem(toyotaTss2LongTune);
|
||||
|
||||
auto toyotaAbh = new ParamControlSP(
|
||||
"ToyotaAutoHold",
|
||||
tr("Enable Automatic Brake Hold (AHB)"),
|
||||
QString("<b>%1</b><br><br>%2<br><br><b>%3</b>")
|
||||
.arg(tr("WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK."))
|
||||
.arg(tr("When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold."))
|
||||
.arg(tr("Changing this setting takes effect when the car is powered off.")),
|
||||
"../assets/offroad/icon_blank.png"
|
||||
);
|
||||
toyotaAbh->setConfirmation(true, false);
|
||||
addItem(toyotaAbh);
|
||||
|
||||
toyotaEnhancedBsm = new ParamControlSP(
|
||||
"ToyotaEnhancedBsm",
|
||||
tr("Enable Enhanced Blind Spot Monitor"),
|
||||
@@ -207,6 +219,7 @@ SPVehiclesTogglesPanel::SPVehiclesTogglesPanel(VehiclePanel *parent) : ListWidge
|
||||
hkgCustomLongTuning->setEnabled(offroad);
|
||||
hyundaiCruiseMainDefault->setEnabled(offroad);
|
||||
toyotaTss2LongTune->setEnabled(offroad);
|
||||
toyotaAbh->setEnabled(offroad);
|
||||
toyotaEnhancedBsm->setEnabled(offroad);
|
||||
toyotaSngHack->setEnabled(offroad);
|
||||
volkswagenCCOnly->setEnabled(offroad);
|
||||
|
||||
@@ -216,6 +216,7 @@ void AnnotatedCameraWidgetSP::updateState(const UIStateSP &s) {
|
||||
latAccelFactorFiltered = ltp.getLatAccelFactorFiltered();
|
||||
frictionCoefficientFiltered = ltp.getFrictionCoefficientFiltered();
|
||||
liveValid = ltp.getLiveValid();
|
||||
ecoMode = vEgo > 0 && car_state.getEngineRpm() == 0;
|
||||
// ############################## DEV UI END ##############################
|
||||
|
||||
btnPerc = s.scene.sleep_btn_opacity * 0.05;
|
||||
@@ -523,10 +524,32 @@ void AnnotatedCameraWidgetSP::drawHud(QPainter &p) {
|
||||
|
||||
// current speed
|
||||
if (!hideVEgoUi) {
|
||||
// Set up the font for the speed text
|
||||
p.setFont(InterFont(176, QFont::Bold));
|
||||
drawColoredText(p, rect().center().x(), 210, speedStr, brakeLights ? QColor(0xff, 0, 0, 255) : QColor(0xff, 0xff, 0xff, 255));
|
||||
|
||||
// Define text coordinates
|
||||
int centerX = rect().center().x();
|
||||
int centerY = 210;
|
||||
|
||||
// Draw a red border if brakeLights is active
|
||||
if (brakeLights) {
|
||||
for (int offsetX = -6; offsetX <= 6; offsetX++) {
|
||||
for (int offsetY = -6; offsetY <= 6; offsetY++) {
|
||||
// Avoid drawing at the original text position
|
||||
if (offsetX != 0 || offsetY != 0) {
|
||||
drawColoredText(p, centerX + offsetX, centerY + offsetY, speedStr, QColor(255, 0, 0, 255)); // Red border
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the main speed text: green if ecoMode is on, otherwise white
|
||||
QColor speedTextColor = ecoMode ? QColor(0, 245, 0) : QColor(255, 255, 255, 255);
|
||||
drawColoredText(p, centerX, centerY, speedStr, speedTextColor);
|
||||
|
||||
// Draw the speed unit below the main text
|
||||
p.setFont(InterFont(66));
|
||||
drawText(p, rect().center().x(), 290, speedUnit, 200);
|
||||
drawText(p, centerX, 290, speedUnit, 200);
|
||||
}
|
||||
|
||||
if (!reversing) {
|
||||
@@ -1165,7 +1188,7 @@ void AnnotatedCameraWidgetSP::drawLaneLines(QPainter &painter, const UIStateSP *
|
||||
}
|
||||
|
||||
// TODO: Fix empty spaces when curiving back on itself
|
||||
painter.setBrush(QColor::fromRgbF(1.0, 0.0, 0.0, 0.2));
|
||||
painter.setBrush(QColor::fromRgbF(1.0, 0.0, 0.0, 0.4));
|
||||
if (left_blindspot) painter.drawPolygon(scene.lane_barrier_vertices[0]);
|
||||
if (right_blindspot) painter.drawPolygon(scene.lane_barrier_vertices[1]);
|
||||
|
||||
@@ -1290,46 +1313,25 @@ void AnnotatedCameraWidgetSP::drawDriverState(QPainter &painter, const UIStateSP
|
||||
}
|
||||
|
||||
void AnnotatedCameraWidgetSP::rocketFuel(QPainter &p) {
|
||||
UIState *s = uiState();
|
||||
float accel = (*s->sm)["carControl"].getCarControl().getActuators().getAccel();
|
||||
int widgetHeight = rect().height();
|
||||
float halfHeightAbs = std::abs(accel) * widgetHeight / 2.0f;
|
||||
const float scannerWidth = 15;
|
||||
QRect scannerRect;
|
||||
|
||||
static const int ct_n = 1;
|
||||
static float ct;
|
||||
|
||||
int rect_w = rect().width();
|
||||
int rect_h = rect().height();
|
||||
|
||||
const int n = 15 + 1; //Add one off screen due to timing issues
|
||||
static float t[n];
|
||||
int dim_n = (sin(ct / 5) + 1) * (n - 0.01);
|
||||
t[dim_n] = 1.0;
|
||||
t[(int)(ct/ct_n)] = 1.0;
|
||||
|
||||
UIStateSP *s = uiStateSP();
|
||||
float vc_accel0 = (*s->sm)["carState"].getCarState().getAEgo();
|
||||
static float vc_accel;
|
||||
vc_accel = vc_accel + (vc_accel0 - vc_accel) / 5;
|
||||
float hha = 0;
|
||||
if (vc_accel > 0) {
|
||||
hha = 0.85 - 0.1 / vc_accel; // only extend up to 85%
|
||||
if (accel > 0) {
|
||||
p.setBrush(QColor(0, 245, 0, 200));
|
||||
}
|
||||
if (vc_accel < 0) {
|
||||
hha = 0.85 + 0.1 / vc_accel; // only extend up to 85%
|
||||
p.setBrush(QColor(245, 0, 0, 200));
|
||||
}
|
||||
if (hha < 0) {
|
||||
hha = 0;
|
||||
}
|
||||
hha = hha * rect_h;
|
||||
float wp = 28;
|
||||
if (vc_accel > 0) {
|
||||
QRect ra = QRect(rect_w - wp, rect_h / 2 - hha / 2, wp, hha / 2);
|
||||
p.drawRect(ra);
|
||||
scannerRect = QRect(0, widgetHeight / 2 - halfHeightAbs, scannerWidth, halfHeightAbs);
|
||||
} else {
|
||||
QRect ra = QRect(rect_w - wp, rect_h / 2, wp, hha / 2);
|
||||
p.drawRect(ra);
|
||||
p.setBrush(QColor(245, 0, 0, 200));
|
||||
scannerRect = QRect(0, widgetHeight / 2, scannerWidth, halfHeightAbs);
|
||||
}
|
||||
|
||||
p.drawRect(scannerRect);
|
||||
}
|
||||
|
||||
|
||||
void AnnotatedCameraWidgetSP::drawLead(QPainter &painter, const cereal::RadarState::LeadData::Reader &lead_data, const QPointF &vd,
|
||||
int num, const cereal::CarState::Reader &car_data, int chevron_data) {
|
||||
painter.save();
|
||||
|
||||
@@ -176,6 +176,7 @@ private:
|
||||
float latAccelFactorFiltered;
|
||||
float frictionCoefficientFiltered;
|
||||
bool liveValid;
|
||||
bool ecoMode;
|
||||
// ############################## DEV UI END ##############################
|
||||
|
||||
float btnPerc;
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
<source>mph</source>
|
||||
<translation type="unfinished">ميل/س</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>blended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MAX</source>
|
||||
<translation type="unfinished">MAX</translation>
|
||||
@@ -1466,11 +1474,15 @@ This may take up to a minute.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Smoother Stopping Performance (Beta)</source>
|
||||
<source>HKG: Custom Tuning for New Longitudinal API</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smoother stopping behind a stopped car or desired stopping event. This is only applicable to HKG CAN platforms using openpilot longitudinal control.</source>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -1517,6 +1529,22 @@ This may take up to a minute.</source>
|
||||
<source>Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars. Big thanks to dragonpilot-community for this implementation.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Automatic Brake Hold (AHB)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changing this setting takes effect when the car is powered off.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Enhanced Blind Spot Monitor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1583,14 +1611,6 @@ Reboot Required.</source>
|
||||
<source>Tested on RAV4 TSS1, Lexus LSS1, Toyota TSS1/1.5, and Prius TSS2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
@@ -2517,6 +2537,14 @@ Reboot Required.</source>
|
||||
<source>Neural Network Lateral Control (NNLC)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NNLC: Remove Lateral Jerk Response (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When NNLC is active, enable this to disables the use of lateral jerk in steering torque calculations, focusing solely on lateral acceleration for a simplified control response.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Torque Lateral Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2525,6 +2553,14 @@ Reboot Required.</source>
|
||||
<source>Enable this to enforce sunnypilot to steer with Torque lateral control.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lateral Jerk with Torque Lateral Control (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Utilizes limited lateral jerk control for improved steering response, leveraging stock torque lateral controller capabilities. Designed to mimic NNLC behavior without training models or data collection.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Self-Tune</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2910,6 +2946,10 @@ Reboot Required.</source>
|
||||
This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Planner Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Experimental Mode</source>
|
||||
<translation type="unfinished">الوضع التجريبي</translation>
|
||||
@@ -3277,6 +3317,14 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Display Metrics Below Chevron</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -3305,14 +3353,6 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Display Temperature on Sidebar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiFiPromptWidget</name>
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
<source>mph</source>
|
||||
<translation type="unfinished">mph</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>blended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MAX</source>
|
||||
<translation type="unfinished">MAX</translation>
|
||||
@@ -1448,11 +1456,15 @@ This may take up to a minute.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Smoother Stopping Performance (Beta)</source>
|
||||
<source>HKG: Custom Tuning for New Longitudinal API</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smoother stopping behind a stopped car or desired stopping event. This is only applicable to HKG CAN platforms using openpilot longitudinal control.</source>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -1499,6 +1511,22 @@ This may take up to a minute.</source>
|
||||
<source>Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars. Big thanks to dragonpilot-community for this implementation.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Automatic Brake Hold (AHB)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changing this setting takes effect when the car is powered off.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Enhanced Blind Spot Monitor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1565,14 +1593,6 @@ Reboot Required.</source>
|
||||
<source>Tested on RAV4 TSS1, Lexus LSS1, Toyota TSS1/1.5, and Prius TSS2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
@@ -2501,6 +2521,14 @@ Reboot Required.</source>
|
||||
<source>Neural Network Lateral Control (NNLC)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NNLC: Remove Lateral Jerk Response (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When NNLC is active, enable this to disables the use of lateral jerk in steering torque calculations, focusing solely on lateral acceleration for a simplified control response.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Torque Lateral Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2509,6 +2537,14 @@ Reboot Required.</source>
|
||||
<source>Enable this to enforce sunnypilot to steer with Torque lateral control.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lateral Jerk with Torque Lateral Control (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Utilizes limited lateral jerk control for improved steering response, leveraging stock torque lateral controller capabilities. Designed to mimic NNLC behavior without training models or data collection.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Self-Tune</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2896,6 +2932,10 @@ Reboot Required.</source>
|
||||
This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Planner Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Experimental Mode</source>
|
||||
<translation type="unfinished">Experimenteller Modus</translation>
|
||||
@@ -3263,6 +3303,14 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Display Metrics Below Chevron</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -3291,14 +3339,6 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Display Temperature on Sidebar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiFiPromptWidget</name>
|
||||
|
||||
@@ -207,6 +207,14 @@
|
||||
<source>LIMIT</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>blended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AutoLaneChangeTimer</name>
|
||||
@@ -1445,14 +1453,6 @@ Esto puede tardar un minuto.</translation>
|
||||
<source>Hyundai/Kia/Genesis</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Smoother Stopping Performance (Beta)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smoother stopping behind a stopped car or desired stopping event. This is only applicable to HKG CAN platforms using openpilot longitudinal control.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Subaru</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1571,6 +1571,26 @@ Reboot Required.</source>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG: Custom Tuning for New Longitudinal API</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Automatic Brake Hold (AHB)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changing this setting takes effect when the car is powered off.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
@@ -2677,6 +2697,22 @@ Reboot Required.</source>
|
||||
<source>Default is Laneless. In Auto mode, sunnnypilot dynamically chooses between Laneline or Laneless model based on lane recognition confidence level on road and certain conditions.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NNLC: Remove Lateral Jerk Response (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When NNLC is active, enable this to disables the use of lateral jerk in steering torque calculations, focusing solely on lateral acceleration for a simplified control response.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lateral Jerk with Torque Lateral Control (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Utilizes limited lateral jerk control for improved steering response, leveraging stock torque lateral controller capabilities. Designed to mimic NNLC behavior without training models or data collection.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TermsPage</name>
|
||||
@@ -3042,6 +3078,10 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Enable the sunnypilot longitudinal control (alpha) toggle to allow Experimental mode.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Planner Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TorqueFriction</name>
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
<source>mph</source>
|
||||
<translation type="unfinished">mi/h</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>blended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MAX</source>
|
||||
<translation type="unfinished">MAX</translation>
|
||||
@@ -1450,11 +1458,15 @@ Cela peut prendre jusqu'à une minute.</translation>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Smoother Stopping Performance (Beta)</source>
|
||||
<source>HKG: Custom Tuning for New Longitudinal API</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smoother stopping behind a stopped car or desired stopping event. This is only applicable to HKG CAN platforms using openpilot longitudinal control.</source>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -1501,6 +1513,22 @@ Cela peut prendre jusqu'à une minute.</translation>
|
||||
<source>Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars. Big thanks to dragonpilot-community for this implementation.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Automatic Brake Hold (AHB)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changing this setting takes effect when the car is powered off.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Enhanced Blind Spot Monitor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1567,14 +1595,6 @@ Reboot Required.</source>
|
||||
<source>Tested on RAV4 TSS1, Lexus LSS1, Toyota TSS1/1.5, and Prius TSS2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
@@ -2501,6 +2521,14 @@ Reboot Required.</source>
|
||||
<source>Neural Network Lateral Control (NNLC)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NNLC: Remove Lateral Jerk Response (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When NNLC is active, enable this to disables the use of lateral jerk in steering torque calculations, focusing solely on lateral acceleration for a simplified control response.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Torque Lateral Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2509,6 +2537,14 @@ Reboot Required.</source>
|
||||
<source>Enable this to enforce sunnypilot to steer with Torque lateral control.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lateral Jerk with Torque Lateral Control (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Utilizes limited lateral jerk control for improved steering response, leveraging stock torque lateral controller capabilities. Designed to mimic NNLC behavior without training models or data collection.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Self-Tune</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2894,6 +2930,10 @@ Reboot Required.</source>
|
||||
This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Planner Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Experimental Mode</source>
|
||||
<translation type="unfinished">Mode expérimental</translation>
|
||||
@@ -3261,6 +3301,14 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Display Metrics Below Chevron</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -3289,14 +3337,6 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Display Temperature on Sidebar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiFiPromptWidget</name>
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
<source>mph</source>
|
||||
<translation type="unfinished">mph</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>blended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MAX</source>
|
||||
<translation type="unfinished">最高速度</translation>
|
||||
@@ -1444,11 +1452,15 @@ This may take up to a minute.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Smoother Stopping Performance (Beta)</source>
|
||||
<source>HKG: Custom Tuning for New Longitudinal API</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smoother stopping behind a stopped car or desired stopping event. This is only applicable to HKG CAN platforms using openpilot longitudinal control.</source>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -1495,6 +1507,22 @@ This may take up to a minute.</source>
|
||||
<source>Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars. Big thanks to dragonpilot-community for this implementation.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Automatic Brake Hold (AHB)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changing this setting takes effect when the car is powered off.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Enhanced Blind Spot Monitor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1561,14 +1589,6 @@ Reboot Required.</source>
|
||||
<source>Tested on RAV4 TSS1, Lexus LSS1, Toyota TSS1/1.5, and Prius TSS2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
@@ -2495,6 +2515,14 @@ Reboot Required.</source>
|
||||
<source>Neural Network Lateral Control (NNLC)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NNLC: Remove Lateral Jerk Response (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When NNLC is active, enable this to disables the use of lateral jerk in steering torque calculations, focusing solely on lateral acceleration for a simplified control response.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Torque Lateral Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2503,6 +2531,14 @@ Reboot Required.</source>
|
||||
<source>Enable this to enforce sunnypilot to steer with Torque lateral control.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lateral Jerk with Torque Lateral Control (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Utilizes limited lateral jerk control for improved steering response, leveraging stock torque lateral controller capabilities. Designed to mimic NNLC behavior without training models or data collection.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Self-Tune</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2888,6 +2924,10 @@ Reboot Required.</source>
|
||||
This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Planner Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Experimental Mode</source>
|
||||
<translation type="unfinished">実験モード</translation>
|
||||
@@ -3255,6 +3295,14 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Display Metrics Below Chevron</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -3283,14 +3331,6 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Display Temperature on Sidebar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiFiPromptWidget</name>
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
<source>mph</source>
|
||||
<translation type="unfinished">mph</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>blended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MAX</source>
|
||||
<translation type="unfinished">MAX</translation>
|
||||
@@ -1446,11 +1454,15 @@ This may take up to a minute.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Smoother Stopping Performance (Beta)</source>
|
||||
<source>HKG: Custom Tuning for New Longitudinal API</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smoother stopping behind a stopped car or desired stopping event. This is only applicable to HKG CAN platforms using openpilot longitudinal control.</source>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -1497,6 +1509,22 @@ This may take up to a minute.</source>
|
||||
<source>Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars. Big thanks to dragonpilot-community for this implementation.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Automatic Brake Hold (AHB)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changing this setting takes effect when the car is powered off.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Enhanced Blind Spot Monitor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1563,14 +1591,6 @@ Reboot Required.</source>
|
||||
<source>Tested on RAV4 TSS1, Lexus LSS1, Toyota TSS1/1.5, and Prius TSS2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
@@ -2497,6 +2517,14 @@ Reboot Required.</source>
|
||||
<source>Neural Network Lateral Control (NNLC)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NNLC: Remove Lateral Jerk Response (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When NNLC is active, enable this to disables the use of lateral jerk in steering torque calculations, focusing solely on lateral acceleration for a simplified control response.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Torque Lateral Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2505,6 +2533,14 @@ Reboot Required.</source>
|
||||
<source>Enable this to enforce sunnypilot to steer with Torque lateral control.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lateral Jerk with Torque Lateral Control (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Utilizes limited lateral jerk control for improved steering response, leveraging stock torque lateral controller capabilities. Designed to mimic NNLC behavior without training models or data collection.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Self-Tune</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2890,6 +2926,10 @@ Reboot Required.</source>
|
||||
This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Planner Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Experimental Mode</source>
|
||||
<translation type="unfinished">실험 모드</translation>
|
||||
@@ -3257,6 +3297,14 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Display Metrics Below Chevron</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -3285,14 +3333,6 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Display Temperature on Sidebar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiFiPromptWidget</name>
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
<source>mph</source>
|
||||
<translation type="unfinished">mph</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>blended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MAX</source>
|
||||
<translation type="unfinished">LIMITE</translation>
|
||||
@@ -1450,11 +1458,15 @@ Isso pode levar até um minuto.</translation>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Smoother Stopping Performance (Beta)</source>
|
||||
<source>HKG: Custom Tuning for New Longitudinal API</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smoother stopping behind a stopped car or desired stopping event. This is only applicable to HKG CAN platforms using openpilot longitudinal control.</source>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -1501,6 +1513,22 @@ Isso pode levar até um minuto.</translation>
|
||||
<source>Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars. Big thanks to dragonpilot-community for this implementation.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Automatic Brake Hold (AHB)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changing this setting takes effect when the car is powered off.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Enhanced Blind Spot Monitor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1567,14 +1595,6 @@ Reboot Required.</source>
|
||||
<source>Tested on RAV4 TSS1, Lexus LSS1, Toyota TSS1/1.5, and Prius TSS2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
@@ -2501,6 +2521,14 @@ Reboot Required.</source>
|
||||
<source>Neural Network Lateral Control (NNLC)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NNLC: Remove Lateral Jerk Response (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When NNLC is active, enable this to disables the use of lateral jerk in steering torque calculations, focusing solely on lateral acceleration for a simplified control response.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Torque Lateral Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2509,6 +2537,14 @@ Reboot Required.</source>
|
||||
<source>Enable this to enforce sunnypilot to steer with Torque lateral control.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lateral Jerk with Torque Lateral Control (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Utilizes limited lateral jerk control for improved steering response, leveraging stock torque lateral controller capabilities. Designed to mimic NNLC behavior without training models or data collection.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Self-Tune</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2894,6 +2930,10 @@ Reboot Required.</source>
|
||||
This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Planner Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Experimental Mode</source>
|
||||
<translation type="unfinished">Modo Experimental</translation>
|
||||
@@ -3261,6 +3301,14 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Display Metrics Below Chevron</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -3289,14 +3337,6 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Display Temperature on Sidebar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiFiPromptWidget</name>
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
<source>mph</source>
|
||||
<translation type="unfinished">ไมล์/ชม.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>blended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MAX</source>
|
||||
<translation type="unfinished">สูงสุด</translation>
|
||||
@@ -1446,11 +1454,15 @@ This may take up to a minute.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Smoother Stopping Performance (Beta)</source>
|
||||
<source>HKG: Custom Tuning for New Longitudinal API</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smoother stopping behind a stopped car or desired stopping event. This is only applicable to HKG CAN platforms using openpilot longitudinal control.</source>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -1497,6 +1509,22 @@ This may take up to a minute.</source>
|
||||
<source>Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars. Big thanks to dragonpilot-community for this implementation.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Automatic Brake Hold (AHB)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changing this setting takes effect when the car is powered off.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Enhanced Blind Spot Monitor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1563,14 +1591,6 @@ Reboot Required.</source>
|
||||
<source>Tested on RAV4 TSS1, Lexus LSS1, Toyota TSS1/1.5, and Prius TSS2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
@@ -2497,6 +2517,14 @@ Reboot Required.</source>
|
||||
<source>Neural Network Lateral Control (NNLC)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NNLC: Remove Lateral Jerk Response (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When NNLC is active, enable this to disables the use of lateral jerk in steering torque calculations, focusing solely on lateral acceleration for a simplified control response.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Torque Lateral Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2505,6 +2533,14 @@ Reboot Required.</source>
|
||||
<source>Enable this to enforce sunnypilot to steer with Torque lateral control.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lateral Jerk with Torque Lateral Control (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Utilizes limited lateral jerk control for improved steering response, leveraging stock torque lateral controller capabilities. Designed to mimic NNLC behavior without training models or data collection.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Self-Tune</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2890,6 +2926,10 @@ Reboot Required.</source>
|
||||
This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Planner Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Experimental Mode</source>
|
||||
<translation type="unfinished">โหมดทดลอง</translation>
|
||||
@@ -3257,6 +3297,14 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Display Metrics Below Chevron</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -3285,14 +3333,6 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Display Temperature on Sidebar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiFiPromptWidget</name>
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
<source>mph</source>
|
||||
<translation type="unfinished">mph</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>blended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MAX</source>
|
||||
<translation type="unfinished">MAX</translation>
|
||||
@@ -1444,11 +1452,15 @@ This may take up to a minute.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Smoother Stopping Performance (Beta)</source>
|
||||
<source>HKG: Custom Tuning for New Longitudinal API</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smoother stopping behind a stopped car or desired stopping event. This is only applicable to HKG CAN platforms using openpilot longitudinal control.</source>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -1495,6 +1507,22 @@ This may take up to a minute.</source>
|
||||
<source>Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars. Big thanks to dragonpilot-community for this implementation.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Automatic Brake Hold (AHB)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changing this setting takes effect when the car is powered off.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Enhanced Blind Spot Monitor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1561,14 +1589,6 @@ Reboot Required.</source>
|
||||
<source>Tested on RAV4 TSS1, Lexus LSS1, Toyota TSS1/1.5, and Prius TSS2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
@@ -2495,6 +2515,14 @@ Reboot Required.</source>
|
||||
<source>Neural Network Lateral Control (NNLC)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NNLC: Remove Lateral Jerk Response (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When NNLC is active, enable this to disables the use of lateral jerk in steering torque calculations, focusing solely on lateral acceleration for a simplified control response.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Torque Lateral Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2503,6 +2531,14 @@ Reboot Required.</source>
|
||||
<source>Enable this to enforce sunnypilot to steer with Torque lateral control.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lateral Jerk with Torque Lateral Control (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Utilizes limited lateral jerk control for improved steering response, leveraging stock torque lateral controller capabilities. Designed to mimic NNLC behavior without training models or data collection.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Self-Tune</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2888,6 +2924,10 @@ Reboot Required.</source>
|
||||
This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Planner Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Experimental Mode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -3255,6 +3295,14 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Display Metrics Below Chevron</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -3283,14 +3331,6 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Display Temperature on Sidebar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiFiPromptWidget</name>
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
<source>mph</source>
|
||||
<translation type="unfinished">mph</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>blended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MAX</source>
|
||||
<translation type="unfinished">最高定速</translation>
|
||||
@@ -1446,11 +1454,15 @@ This may take up to a minute.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Smoother Stopping Performance (Beta)</source>
|
||||
<source>HKG: Custom Tuning for New Longitudinal API</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smoother stopping behind a stopped car or desired stopping event. This is only applicable to HKG CAN platforms using openpilot longitudinal control.</source>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -1497,6 +1509,22 @@ This may take up to a minute.</source>
|
||||
<source>Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars. Big thanks to dragonpilot-community for this implementation.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Automatic Brake Hold (AHB)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changing this setting takes effect when the car is powered off.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Enhanced Blind Spot Monitor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1563,14 +1591,6 @@ Reboot Required.</source>
|
||||
<source>Tested on RAV4 TSS1, Lexus LSS1, Toyota TSS1/1.5, and Prius TSS2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
@@ -2497,6 +2517,14 @@ Reboot Required.</source>
|
||||
<source>Neural Network Lateral Control (NNLC)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NNLC: Remove Lateral Jerk Response (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When NNLC is active, enable this to disables the use of lateral jerk in steering torque calculations, focusing solely on lateral acceleration for a simplified control response.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Torque Lateral Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2505,6 +2533,14 @@ Reboot Required.</source>
|
||||
<source>Enable this to enforce sunnypilot to steer with Torque lateral control.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lateral Jerk with Torque Lateral Control (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Utilizes limited lateral jerk control for improved steering response, leveraging stock torque lateral controller capabilities. Designed to mimic NNLC behavior without training models or data collection.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Self-Tune</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2890,6 +2926,10 @@ Reboot Required.</source>
|
||||
This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Planner Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Experimental Mode</source>
|
||||
<translation type="unfinished">测试模式</translation>
|
||||
@@ -3257,6 +3297,14 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Display Metrics Below Chevron</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -3285,14 +3333,6 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Display Temperature on Sidebar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiFiPromptWidget</name>
|
||||
|
||||
@@ -203,6 +203,14 @@
|
||||
<source>mph</source>
|
||||
<translation type="unfinished">mph</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>blended</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>acc</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>MAX</source>
|
||||
<translation type="unfinished">最高</translation>
|
||||
@@ -1446,11 +1454,15 @@ This may take up to a minute.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Smoother Stopping Performance (Beta)</source>
|
||||
<source>HKG: Custom Tuning for New Longitudinal API</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smoother stopping behind a stopped car or desired stopping event. This is only applicable to HKG CAN platforms using openpilot longitudinal control.</source>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
@@ -1497,6 +1509,22 @@ This may take up to a minute.</source>
|
||||
<source>Smoother longitudinal performance for Toyota/Lexus TSS2/LSS2 cars. Big thanks to dragonpilot-community for this implementation.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Automatic Brake Hold (AHB)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>WARNING: Only for Toyota/Lexus vehicles with TSS2/LSS2. USE AT YOUR OWN RISK.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When you stop the vehicle completely by depressing the brake pedal, sunnypilot will activate Auto Brake Hold.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Changing this setting takes effect when the car is powered off.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Enhanced Blind Spot Monitor</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -1563,14 +1591,6 @@ Reboot Required.</source>
|
||||
<source>Tested on RAV4 TSS1, Lexus LSS1, Toyota TSS1/1.5, and Prius TSS2.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>HKG CAN: Enable Cruise Main By Default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enabling this toggle sets CRUISE MAIN to ON by default when the car starts, without engaging MADS. The user still needs to manually engage MADS</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>SettingsWindow</name>
|
||||
@@ -2497,6 +2517,14 @@ Reboot Required.</source>
|
||||
<source>Neural Network Lateral Control (NNLC)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>NNLC: Remove Lateral Jerk Response (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>When NNLC is active, enable this to disables the use of lateral jerk in steering torque calculations, focusing solely on lateral acceleration for a simplified control response.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enforce Torque Lateral Control</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2505,6 +2533,14 @@ Reboot Required.</source>
|
||||
<source>Enable this to enforce sunnypilot to steer with Torque lateral control.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lateral Jerk with Torque Lateral Control (Alpha)</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Utilizes limited lateral jerk control for improved steering response, leveraging stock torque lateral controller capabilities. Designed to mimic NNLC behavior without training models or data collection.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable Self-Tune</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -2890,6 +2926,10 @@ Reboot Required.</source>
|
||||
This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Use Planner Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Experimental Mode</source>
|
||||
<translation type="unfinished">實驗模式</translation>
|
||||
@@ -3257,6 +3297,14 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Speed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Display Metrics Below Chevron</source>
|
||||
<translation type="unfinished"></translation>
|
||||
@@ -3285,14 +3333,6 @@ This feature must be used along with SLC, and/or V-TSC, and/or M-TSC.</source>
|
||||
<source>Display Temperature on Sidebar</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Time</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>All</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WiFiPromptWidget</name>
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
from abc import abstractmethod, ABC
|
||||
|
||||
from cereal import car, custom
|
||||
from openpilot.common.conversions import Conversions as CV
|
||||
from openpilot.selfdrive.controls.lib.sunnypilot.speed_limit_controller import ACTIVE_STATES
|
||||
from openpilot.sunnypilot.controls.lib.custom_stock_longitudinal_controller.states import InactiveState, \
|
||||
LoadingState, AcceleratingState, DeceleratingState, HoldingState
|
||||
from openpilot.sunnypilot.controls.lib.custom_stock_longitudinal_controller.helpers import get_set_point, \
|
||||
speed_hysteresis, update_manual_button_timers
|
||||
|
||||
ButtonType = car.CarState.ButtonEvent.Type
|
||||
ButtonControlState = custom.CarControlSP.CustomStockLongitudinalControl.ButtonControlState
|
||||
SpeedLimitControlState = custom.LongitudinalPlanSP.SpeedLimitControlState
|
||||
TurnSpeedControlState = custom.LongitudinalPlanSP.SpeedLimitControlState
|
||||
VisionTurnControllerState = custom.LongitudinalPlanSP.VisionTurnControllerState
|
||||
|
||||
SendCan = tuple[int, bytes, int]
|
||||
|
||||
|
||||
class CustomStockLongitudinalControllerBase(ABC):
|
||||
def __init__(self, car, car_controller, car_state, CP):
|
||||
self.car = car
|
||||
self.car_controller = car_controller
|
||||
self.car_state = car_state
|
||||
self.CP = CP
|
||||
|
||||
self.v_target = 0
|
||||
self.v_cruise_cluster = 0
|
||||
self.v_cruise_min = 0
|
||||
self.cruise_button = None
|
||||
self.button_state = ButtonControlState.inactive
|
||||
|
||||
self.v_tsc_state = VisionTurnControllerState.disabled
|
||||
self.slc_state = SpeedLimitControlState.inactive
|
||||
self.m_tsc_state = TurnSpeedControlState.inactive
|
||||
self.v_tsc = 0
|
||||
self.speed_limit_offseted = 0
|
||||
self.m_tsc = 0
|
||||
|
||||
self.is_ready = False
|
||||
self.is_ready_prev = False
|
||||
self.speed_steady = 0
|
||||
|
||||
self.accel_button = None
|
||||
self.decel_button = None
|
||||
self.cruise_buttons = {ButtonType.decelCruise: 0, ButtonType.accelCruise: 0}
|
||||
|
||||
self.button_states = {
|
||||
ButtonControlState.inactive: InactiveState(self),
|
||||
ButtonControlState.loading: LoadingState(self),
|
||||
ButtonControlState.accelerating: AcceleratingState(self),
|
||||
ButtonControlState.decelerating: DeceleratingState(self),
|
||||
ButtonControlState.holding: HoldingState(self),
|
||||
}
|
||||
|
||||
@abstractmethod
|
||||
def create_mock_button_messages(self) -> list[SendCan]:
|
||||
pass
|
||||
|
||||
def state_publish(self) -> custom.CarControlSP.CustomStockLongitudinalControl:
|
||||
customStockLongitudinalControl = custom.CarControlSP.CustomStockLongitudinalControl.new_message()
|
||||
customStockLongitudinalControl.state = self.button_state
|
||||
customStockLongitudinalControl.cruiseButton = 0 if self.cruise_button is None else int(self.cruise_button)
|
||||
customStockLongitudinalControl.vTarget = float(self.v_target)
|
||||
customStockLongitudinalControl.vCruiseCluster = float(self.v_cruise_cluster)
|
||||
return customStockLongitudinalControl
|
||||
|
||||
def update_msgs(self) -> None:
|
||||
if self.car.sm.updated['longitudinalPlanSP']:
|
||||
self.v_tsc_state = self.car.sm['longitudinalPlanSP'].visionTurnControllerState
|
||||
self.slc_state = self.car.sm['longitudinalPlanSP'].speedLimitControlState
|
||||
self.m_tsc_state = self.car.sm['longitudinalPlanSP'].turnSpeedControlState
|
||||
self.v_tsc = self.car.sm['longitudinalPlanSP'].visionTurnSpeed
|
||||
|
||||
speed_limit = self.car.sm['longitudinalPlanSP'].speedLimit
|
||||
speed_limit_offset = self.car.sm['longitudinalPlanSP'].speedLimitOffset
|
||||
self.speed_limit_offseted = speed_limit + speed_limit_offset
|
||||
|
||||
self.m_tsc = self.car.sm['longitudinalPlanSP'].turnSpeed
|
||||
|
||||
def update_calculations(self, CS: car.CarState, CC: car.CarControl) -> None:
|
||||
is_metric = self.car_state.params_list.is_metric
|
||||
v_cruise_kph = CC.vCruise
|
||||
v_cruise = v_cruise_kph * CV.KPH_TO_MS
|
||||
self.v_cruise_min = get_set_point(is_metric)
|
||||
self.v_cruise_cluster = round(CS.cruiseState.speed * (CV.MS_TO_KPH if is_metric else CV.MS_TO_MPH))
|
||||
|
||||
v_targets = {'cruise': CC.vCruise}
|
||||
|
||||
if self.v_tsc_state != VisionTurnControllerState.disabled:
|
||||
v_targets['v_tsc'] = self.v_tsc
|
||||
|
||||
if self.slc_state in ACTIVE_STATES:
|
||||
v_targets['slc'] = self.speed_limit_offseted
|
||||
|
||||
if self.m_tsc_state > TurnSpeedControlState.tempInactive:
|
||||
v_targets['m_tsc'] = self.m_tsc
|
||||
|
||||
source = min(v_targets, key=v_targets.get)
|
||||
|
||||
v_target = speed_hysteresis(self, v_targets[source], self.speed_steady, 1.5 * (CV.KPH_TO_MS if is_metric else CV.MPH_TO_MS))
|
||||
v_target = min(v_target, v_cruise)
|
||||
v_target = round(v_target * (CV.MS_TO_KPH if is_metric else CV.MS_TO_MPH))
|
||||
|
||||
self.v_target = v_target
|
||||
|
||||
def update_state(self, CS: car.CarState, CC: car.CarControl) -> None:
|
||||
update_manual_button_timers(CS, self.cruise_buttons)
|
||||
|
||||
ready = CS.cruiseState.enabled and not CC.cruiseControl.cancel and not CC.cruiseControl.resume
|
||||
button_pressed = any(self.cruise_buttons[k] > 0 for k in self.cruise_buttons)
|
||||
self.is_ready = ready and not button_pressed
|
||||
|
||||
self.cruise_button = self.button_states[self.button_state]()
|
||||
|
||||
self.is_ready_prev = self.is_ready
|
||||
|
||||
def update(self, CS: car.CarState, CC: car.CarControl) -> list[SendCan]:
|
||||
self.update_msgs()
|
||||
|
||||
self.update_calculations(CS, CC)
|
||||
|
||||
self.update_state(CS, CC)
|
||||
|
||||
can_sends = self.create_mock_button_messages()
|
||||
|
||||
return can_sends
|
||||
@@ -1,30 +0,0 @@
|
||||
from cereal import car
|
||||
|
||||
ButtonType = car.CarState.ButtonEvent.Type
|
||||
|
||||
|
||||
def get_set_point(is_metric: bool) -> float:
|
||||
return 30 if is_metric else 20
|
||||
|
||||
|
||||
def speed_hysteresis(controller, speed: float, speed_steady: float, hyst: float) -> float:
|
||||
if speed > speed_steady + hyst:
|
||||
speed_steady = speed - hyst
|
||||
elif speed < speed_steady - hyst:
|
||||
speed_steady = speed + hyst
|
||||
|
||||
controller.speed_steady = speed
|
||||
|
||||
return speed_steady
|
||||
|
||||
|
||||
def update_manual_button_timers(CS: car.CarState, button_timers: dict[ButtonType, int]) -> None:
|
||||
# increment timer for buttons still pressed
|
||||
for k in button_timers:
|
||||
if button_timers[k] > 0:
|
||||
button_timers[k] += 1
|
||||
|
||||
for b in CS.buttonEvents:
|
||||
if b.type.raw in button_timers:
|
||||
# Start/end timer and store current state on change of button pressed
|
||||
button_timers[b.type.raw] = 1 if b.pressed else 0
|
||||
@@ -1,85 +0,0 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from random import randint
|
||||
|
||||
from cereal import custom
|
||||
|
||||
ButtonControlState = custom.CarControlSP.CustomStockLongitudinalControl.ButtonControlState
|
||||
|
||||
INACTIVE_TIMER = 40
|
||||
RESET_COUNT = 5
|
||||
HOLD_TIME = 7
|
||||
|
||||
|
||||
class ButtonStateBase(ABC):
|
||||
def __init__(self, controller):
|
||||
self.controller = controller
|
||||
self.button_count = 0
|
||||
self.timer = INACTIVE_TIMER
|
||||
|
||||
def __call__(self) -> int | None:
|
||||
if self.controller.is_ready:
|
||||
# TODO-SP: Validate different hold time intervals for different platforms to prevent temporary cruise fault
|
||||
pass
|
||||
else:
|
||||
if self.controller.is_ready_prev:
|
||||
self.controller.button_state = ButtonControlState.inactive
|
||||
return None
|
||||
|
||||
return self.handle()
|
||||
|
||||
@abstractmethod
|
||||
def handle(self) -> int | None:
|
||||
pass
|
||||
|
||||
|
||||
class InactiveState(ButtonStateBase):
|
||||
def handle(self) -> None:
|
||||
self.button_count = 0
|
||||
|
||||
if not self.controller.is_ready:
|
||||
self.timer = INACTIVE_TIMER
|
||||
elif self.timer > 0:
|
||||
self.timer -= 1
|
||||
else:
|
||||
self.controller.button_state = ButtonControlState.loading
|
||||
return None
|
||||
|
||||
|
||||
class LoadingState(ButtonStateBase):
|
||||
def handle(self) -> None:
|
||||
if self.controller.v_target > self.controller.v_cruise_cluster:
|
||||
self.controller.button_state = ButtonControlState.accelerating
|
||||
elif self.controller.v_target < self.controller.v_cruise_cluster and self.controller.v_cruise_cluster > self.controller.v_cruise_min:
|
||||
self.controller.button_state = ButtonControlState.decelerating
|
||||
else:
|
||||
self.controller.button_state = ButtonControlState.holding
|
||||
return None
|
||||
|
||||
|
||||
class AcceleratingState(ButtonStateBase):
|
||||
def handle(self) -> int | None:
|
||||
self.button_count += 1
|
||||
if self.controller.v_target <= self.controller.v_cruise_cluster or self.button_count > RESET_COUNT:
|
||||
self.button_count = 0
|
||||
self.controller.button_state = ButtonControlState.holding
|
||||
return None
|
||||
return self.controller.accel_button
|
||||
|
||||
|
||||
class DeceleratingState(ButtonStateBase):
|
||||
def handle(self) -> int | None:
|
||||
self.button_count += 1
|
||||
if self.controller.v_target >= self.controller.v_cruise_cluster or self.controller.v_cruise_cluster <= self.controller.v_cruise_min or self.button_count > RESET_COUNT:
|
||||
self.button_count = 0
|
||||
self.controller.button_state = ButtonControlState.holding
|
||||
return None
|
||||
return self.controller.decel_button
|
||||
|
||||
|
||||
class HoldingState(ButtonStateBase):
|
||||
def handle(self) -> None:
|
||||
self.button_count += 1
|
||||
if self.button_count > HOLD_TIME:
|
||||
self.button_count = 0
|
||||
self.controller.button_state = ButtonControlState.loading
|
||||
return None
|
||||
@@ -1,32 +0,0 @@
|
||||
from cereal import car
|
||||
from openpilot.selfdrive.car.chrysler.values import RAM_CARS
|
||||
from openpilot.sunnypilot.controls.lib.custom_stock_longitudinal_controller.controllers import CustomStockLongitudinalControllerBase, \
|
||||
SendCan
|
||||
from openpilot.sunnypilot.selfdrive.car.chrysler.custom_stock_longitudinal_controller import helpers
|
||||
|
||||
ButtonType = car.CarState.ButtonEvent.Type
|
||||
# TODO-SP: Handle this better in the base class
|
||||
ACCEL_BUTTON = 1
|
||||
DECEL_BUTTON = 2
|
||||
|
||||
|
||||
class CustomStockLongitudinalController(CustomStockLongitudinalControllerBase):
|
||||
def __init__(self, car, car_controller, car_state, CP):
|
||||
super().__init__(car, car_controller, car_state, CP)
|
||||
self.accel_button = ACCEL_BUTTON
|
||||
self.decel_button = DECEL_BUTTON
|
||||
self.cruise_buttons = {ButtonType.decelCruise: 0, ButtonType.accelCruise: 0, ButtonType.resumeCruise: 0}
|
||||
|
||||
def create_mock_button_messages(self) -> list[SendCan]:
|
||||
can_sends = []
|
||||
ram_cars = self.CP.carFingerprint in RAM_CARS
|
||||
das_bus = 2 if self.CP.carFingerprint in RAM_CARS else 0
|
||||
button_counter_offset = [1, 1, 0, None][self.car_controller.frame % 4]
|
||||
|
||||
if self.cruise_button is not None:
|
||||
if ram_cars:
|
||||
can_sends.append(helpers.create_cruise_buttons(self.car_controller.packer, self.car_state.button_counter, das_bus, self.cruise_button))
|
||||
elif button_counter_offset is not None:
|
||||
can_sends.append(helpers.create_cruise_buttons(self.car_controller.packer, self.car_state.button_counter + button_counter_offset, das_bus, self.cruise_button))
|
||||
|
||||
return can_sends
|
||||
@@ -1,9 +0,0 @@
|
||||
def create_cruise_buttons(packer, frame, bus, buttons=0):
|
||||
|
||||
values = {
|
||||
"ACC_Accel": 1 if buttons == 1 else 0,
|
||||
"ACC_Decel": 1 if buttons == 2 else 0,
|
||||
"COUNTER": frame % 0x10,
|
||||
}
|
||||
|
||||
return packer.make_can_msg("CRUISE_BUTTONS", bus, values)
|
||||
@@ -1,28 +0,0 @@
|
||||
from cereal import car
|
||||
from openpilot.selfdrive.car.ford.values import CarControllerParams
|
||||
from openpilot.sunnypilot.controls.lib.custom_stock_longitudinal_controller.controllers import CustomStockLongitudinalControllerBase, \
|
||||
SendCan
|
||||
from openpilot.sunnypilot.selfdrive.car.ford.custom_stock_longitudinal_controller import fordcan
|
||||
|
||||
ButtonType = car.CarState.ButtonEvent.Type
|
||||
# TODO-SP: Handle this better in the base class
|
||||
ACCEL_BUTTON = 1
|
||||
DECEL_BUTTON = 2
|
||||
|
||||
|
||||
class CustomStockLongitudinalController(CustomStockLongitudinalControllerBase):
|
||||
def __init__(self, car, car_controller, car_state, CP):
|
||||
super().__init__(car, car_controller, car_state, CP)
|
||||
self.accel_button = ACCEL_BUTTON
|
||||
self.decel_button = DECEL_BUTTON
|
||||
self.cruise_buttons = {ButtonType.decelCruise: 0, ButtonType.accelCruise: 0, ButtonType.gapAdjustCruise: 0,
|
||||
ButtonType.resumeCruise: 0, ButtonType.setCruise: 0}
|
||||
|
||||
def create_mock_button_messages(self) -> list[SendCan]:
|
||||
can_sends = []
|
||||
|
||||
if self.cruise_button is not None and (self.car_controller.frame % CarControllerParams.BUTTONS_STEP) == 0:
|
||||
can_sends.append(fordcan.create_button_msg(self.car_controller.packer, self.car_controller.CAN.camera, self.car_state.buttons_stock_values, buttons=self.cruise_button))
|
||||
can_sends.append(fordcan.create_button_msg(self.car_controller.packer, self.car_controller.CAN.main, self.car_state.buttons_stock_values, buttons=self.cruise_button))
|
||||
|
||||
return can_sends
|
||||
@@ -1,48 +0,0 @@
|
||||
def create_button_msg(packer, bus: int, stock_values: dict, buttons=0):
|
||||
"""
|
||||
Creates a CAN message for the Ford SCCM buttons/switches.
|
||||
|
||||
Includes cruise control buttons, turn lights and more.
|
||||
|
||||
Frequency is 10Hz.
|
||||
"""
|
||||
|
||||
values = {s: stock_values[s] for s in [
|
||||
"HeadLghtHiFlash_D_Stat", # SCCM Passthrough the remaining buttons
|
||||
"TurnLghtSwtch_D_Stat", # SCCM Turn signal switch
|
||||
"WiprFront_D_Stat",
|
||||
"LghtAmb_D_Sns",
|
||||
"AccButtnGapDecPress",
|
||||
"AccButtnGapIncPress",
|
||||
"AslButtnOnOffCnclPress",
|
||||
"AslButtnOnOffPress",
|
||||
"LaSwtchPos_D_Stat",
|
||||
"CcAslButtnCnclResPress",
|
||||
"CcAslButtnDeny_B_Actl",
|
||||
"CcAslButtnIndxDecPress",
|
||||
"CcAslButtnIndxIncPress",
|
||||
"CcAslButtnOffCnclPress",
|
||||
"CcAslButtnOnOffCncl",
|
||||
"CcAslButtnOnPress",
|
||||
"CcAslButtnResDecPress",
|
||||
"CcAslButtnResIncPress",
|
||||
"CcAslButtnSetDecPress",
|
||||
"CcAslButtnSetIncPress",
|
||||
"CcAslButtnSetPress",
|
||||
"CcButtnOffPress",
|
||||
"CcButtnOnOffCnclPress",
|
||||
"CcButtnOnOffPress",
|
||||
"CcButtnOnPress",
|
||||
"HeadLghtHiFlash_D_Actl",
|
||||
"HeadLghtHiOn_B_StatAhb",
|
||||
"AhbStat_B_Dsply",
|
||||
"AccButtnGapTogglePress",
|
||||
"WiprFrontSwtch_D_Stat",
|
||||
"HeadLghtHiCtrl_D_RqAhb",
|
||||
]}
|
||||
|
||||
values.update({
|
||||
"CcAslButtnSetIncPress": 1 if buttons == 1 else 0, # CC increase button
|
||||
"CcAslButtnSetDecPress": 1 if buttons == 2 else 0, # CC decrease button
|
||||
})
|
||||
return packer.make_can_msg("Steering_Data_FD1", bus, values)
|
||||
@@ -1,25 +0,0 @@
|
||||
from cereal import car
|
||||
from openpilot.selfdrive.car.honda import hondacan
|
||||
from openpilot.selfdrive.car.honda.values import CruiseButtons
|
||||
from openpilot.sunnypilot.controls.lib.custom_stock_longitudinal_controller.controllers import CustomStockLongitudinalControllerBase, \
|
||||
SendCan
|
||||
from openpilot.sunnypilot.selfdrive.car.honda.custom_stock_longitudinal_controller import helpers
|
||||
|
||||
ButtonType = car.CarState.ButtonEvent.Type
|
||||
|
||||
|
||||
class CustomStockLongitudinalController(CustomStockLongitudinalControllerBase):
|
||||
def __init__(self, car, car_controller, car_state, CP):
|
||||
super().__init__(car, car_controller, car_state, CP)
|
||||
self.accel_button = CruiseButtons.RES_ACCEL
|
||||
self.decel_button = CruiseButtons.DECEL_SET
|
||||
self.cruise_buttons = {ButtonType.decelCruise: 0, ButtonType.accelCruise: 0,
|
||||
ButtonType.altButton3: 0, ButtonType.cancel: 0}
|
||||
|
||||
def create_mock_button_messages(self) -> list[SendCan]:
|
||||
can_sends = []
|
||||
|
||||
if self.cruise_button is not None:
|
||||
can_sends.append(hondacan.spam_buttons_command(self.car_controller.packer, self.car_controller.CAN, self.cruise_button, self.CP.carFingerprint))
|
||||
|
||||
return can_sends
|
||||
@@ -1,58 +0,0 @@
|
||||
from random import choices
|
||||
|
||||
from cereal import car
|
||||
from openpilot.common.numpy_fast import interp
|
||||
from openpilot.selfdrive.car.hyundai import hyundaicanfd
|
||||
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags, Buttons, CANFD_CAR
|
||||
from openpilot.sunnypilot.controls.lib.custom_stock_longitudinal_controller.controllers import CustomStockLongitudinalControllerBase, \
|
||||
SendCan
|
||||
from openpilot.sunnypilot.selfdrive.car.hyundai.custom_stock_longitudinal_controller import helpers
|
||||
|
||||
ButtonType = car.CarState.ButtonEvent.Type
|
||||
|
||||
BUTTON_COPIES = 2
|
||||
BUTTON_COPIES_TIME = 7
|
||||
BUTTON_COPIES_TIME_IMPERIAL = [BUTTON_COPIES_TIME + 3, 70]
|
||||
BUTTON_COPIES_TIME_METRIC = [BUTTON_COPIES_TIME, 40]
|
||||
POPULATION = [0, 1]
|
||||
WEIGHTS = [0.51, 0.49]
|
||||
|
||||
|
||||
class CustomStockLongitudinalController(CustomStockLongitudinalControllerBase):
|
||||
def __init__(self, car, car_controller, car_state, CP):
|
||||
super().__init__(car, car_controller, car_state, CP)
|
||||
self.accel_button = Buttons.RES_ACCEL
|
||||
self.decel_button = Buttons.SET_DECEL
|
||||
self.cruise_buttons = {ButtonType.decelCruise: 0, ButtonType.accelCruise: 0, ButtonType.gapAdjustCruise: 0}
|
||||
|
||||
def create_can_mock_button_messages(self) -> list[SendCan]:
|
||||
can_sends = []
|
||||
if self.cruise_button is not None:
|
||||
copies_xp = BUTTON_COPIES_TIME_METRIC if self.car_state.params_list.is_metric else BUTTON_COPIES_TIME_IMPERIAL
|
||||
copies = int(interp(BUTTON_COPIES_TIME, copies_xp, [1, BUTTON_COPIES]))
|
||||
can_sends.extend([helpers.create_clu11(self.car_controller.packer, self.car_state.clu11, self.cruise_button, self.CP)] * copies)
|
||||
|
||||
return can_sends
|
||||
|
||||
def create_canfd_mock_button_messages(self) -> list[SendCan]:
|
||||
can_sends = []
|
||||
if self.CP.flags & HyundaiFlags.CANFD_ALT_BUTTONS:
|
||||
# TODO: resume for alt button cars
|
||||
pass
|
||||
else:
|
||||
if self.cruise_button is not None:
|
||||
for _ in range(BUTTON_COPIES):
|
||||
can_sends.append(hyundaicanfd.create_buttons(self.car_controller.packer, self.CP, self.car_controller.CAN,
|
||||
self.car_state.button_counters + choices(POPULATION, WEIGHTS)[0],
|
||||
self.cruise_button))
|
||||
|
||||
return can_sends
|
||||
|
||||
def create_mock_button_messages(self) -> list[SendCan]:
|
||||
can_sends = []
|
||||
if self.CP.carFingerprint in CANFD_CAR:
|
||||
can_sends.extend(self.create_canfd_mock_button_messages())
|
||||
else:
|
||||
can_sends.extend(self.create_can_mock_button_messages())
|
||||
|
||||
return can_sends
|
||||
@@ -1,22 +0,0 @@
|
||||
from openpilot.selfdrive.car.hyundai.values import HyundaiFlags
|
||||
|
||||
def create_clu11(packer, clu11, button, CP):
|
||||
values = {s: clu11[s] for s in [
|
||||
"CF_Clu_CruiseSwState",
|
||||
"CF_Clu_CruiseSwMain",
|
||||
"CF_Clu_SldMainSW",
|
||||
"CF_Clu_ParityBit1",
|
||||
"CF_Clu_VanzDecimal",
|
||||
"CF_Clu_Vanz",
|
||||
"CF_Clu_SPEED_UNIT",
|
||||
"CF_Clu_DetentOut",
|
||||
"CF_Clu_RheostatLevel",
|
||||
"CF_Clu_CluInfo",
|
||||
"CF_Clu_AmpInfo",
|
||||
"CF_Clu_AliveCnt1",
|
||||
]}
|
||||
values["CF_Clu_CruiseSwState"] = button
|
||||
values["CF_Clu_AliveCnt1"] = (values["CF_Clu_AliveCnt1"] + 1) % 0x10
|
||||
# send buttons to camera on camera-scc based cars
|
||||
bus = 2 if CP.flags & HyundaiFlags.CAMERA_SCC else 0
|
||||
return packer.make_can_msg("CLU11", bus, values)
|
||||
@@ -1,25 +0,0 @@
|
||||
from cereal import car
|
||||
from openpilot.selfdrive.car.mazda.values import Buttons
|
||||
from openpilot.sunnypilot.controls.lib.custom_stock_longitudinal_controller.controllers import CustomStockLongitudinalControllerBase, \
|
||||
SendCan
|
||||
from openpilot.sunnypilot.selfdrive.car.mazda.custom_stock_longitudinal_controller import helpers
|
||||
|
||||
ButtonType = car.CarState.ButtonEvent.Type
|
||||
|
||||
|
||||
class CustomStockLongitudinalController(CustomStockLongitudinalControllerBase):
|
||||
def __init__(self, car, car_controller, car_state, CP):
|
||||
super().__init__(car, car_controller, car_state, CP)
|
||||
self.accel_button = Buttons.SET_PLUS
|
||||
self.decel_button = Buttons.SET_MINUS
|
||||
self.cruise_buttons = {ButtonType.decelCruise: 0, ButtonType.accelCruise: 0,
|
||||
ButtonType.resumeCruise: 0, ButtonType.setCruise: 0}
|
||||
|
||||
def create_mock_button_messages(self) -> list[SendCan]:
|
||||
can_sends = []
|
||||
|
||||
if self.cruise_button is not None:
|
||||
if self.car_controller.frame % 10 == 0:
|
||||
can_sends.append(helpers.create_button_cmd(self.car_controller.packer, self.CP, self.car_controller.frame // 10, self.cruise_button))
|
||||
|
||||
return can_sends
|
||||
@@ -1,40 +0,0 @@
|
||||
def create_button_cmd(packer, CP, counter, button):
|
||||
|
||||
can = int(button == Buttons.CANCEL)
|
||||
res = int(button == Buttons.RESUME)
|
||||
inc = int(button == Buttons.SET_PLUS)
|
||||
dec = int(button == Buttons.SET_MINUS)
|
||||
|
||||
if CP.flags & MazdaFlags.GEN1:
|
||||
values = {
|
||||
"CAN_OFF": can,
|
||||
"CAN_OFF_INV": (can + 1) % 2,
|
||||
|
||||
"SET_P": inc,
|
||||
"SET_P_INV": (inc + 1) % 2,
|
||||
|
||||
"RES": res,
|
||||
"RES_INV": (res + 1) % 2,
|
||||
|
||||
"SET_M": dec,
|
||||
"SET_M_INV": (dec + 1) % 2,
|
||||
|
||||
"DISTANCE_LESS": 0,
|
||||
"DISTANCE_LESS_INV": 1,
|
||||
|
||||
"DISTANCE_MORE": 0,
|
||||
"DISTANCE_MORE_INV": 1,
|
||||
|
||||
"MODE_X": 0,
|
||||
"MODE_X_INV": 1,
|
||||
|
||||
"MODE_Y": 0,
|
||||
"MODE_Y_INV": 1,
|
||||
|
||||
"BIT1": 1,
|
||||
"BIT2": 1,
|
||||
"BIT3": 1,
|
||||
"CTR": (counter + 1) % 16,
|
||||
}
|
||||
|
||||
return packer.make_can_msg("CRZ_BTNS", 0, values)
|
||||
-77
@@ -1,77 +0,0 @@
|
||||
from cereal import car, custom
|
||||
from openpilot.sunnypilot.controls.lib.custom_stock_longitudinal_controller.controllers import CustomStockLongitudinalControllerBase, \
|
||||
SendCan
|
||||
|
||||
ButtonType = car.CarState.ButtonEvent.Type
|
||||
ButtonControlState = custom.CarControlSP.CustomStockLongitudinalControl.ButtonControlState
|
||||
# TODO-SP: Handle this better in the base class
|
||||
ACCEL_BUTTON = 1
|
||||
DECEL_BUTTON = 2
|
||||
RESUME_CRUISE = 3
|
||||
SET_CRUISE = 4
|
||||
|
||||
ACC_TYPE_BUTTONS = {
|
||||
0: {1: ACCEL_BUTTON, 2: DECEL_BUTTON}, # accel, decel
|
||||
1: {1: RESUME_CRUISE, 2: SET_CRUISE} # resume, set
|
||||
}
|
||||
|
||||
|
||||
class CustomStockLongitudinalController(CustomStockLongitudinalControllerBase):
|
||||
def __init__(self, car, car_controller, car_state, CP):
|
||||
super().__init__(car, car_controller, car_state, CP)
|
||||
self.accel_button = ACCEL_BUTTON
|
||||
self.decel_button = DECEL_BUTTON
|
||||
self.cruise_buttons = {ButtonType.decelCruise: 0, ButtonType.accelCruise: 0,
|
||||
ButtonType.resumeCruise: 0, ButtonType.setCruise: 0}
|
||||
|
||||
self.last_v_cruise_cluster = 0
|
||||
self.last_cruise_button = False
|
||||
|
||||
self.acc_type = -1
|
||||
self.button_frame = 0
|
||||
|
||||
self.initial_v_target = 0
|
||||
self.initial_v_cruise_cluster = 0
|
||||
|
||||
def update_checks(self) -> None:
|
||||
if self.button_state > ButtonControlState.inactive:
|
||||
self.button_frame += 1
|
||||
if self.button_frame == 1:
|
||||
self.initial_v_target = self.v_target
|
||||
self.initial_v_cruise_cluster = self.v_cruise_cluster
|
||||
|
||||
self.set_acc_type()
|
||||
else:
|
||||
self.button_frame = 0
|
||||
self.initial_v_target = 0
|
||||
self.initial_v_cruise_cluster = 0
|
||||
|
||||
def set_acc_type(self):
|
||||
current_v_cruise_diff = abs(self.v_target - self.v_cruise_cluster)
|
||||
initial_v_cruise_diff = abs(self.initial_v_target - self.initial_v_cruise_cluster)
|
||||
|
||||
if self.last_v_cruise_cluster != self.v_cruise_cluster and current_v_cruise_diff != initial_v_cruise_diff:
|
||||
if self.acc_type == -1:
|
||||
v_cruise_diff = abs(self.v_cruise_cluster - self.last_v_cruise_cluster)
|
||||
|
||||
if v_cruise_diff >= 10 and self.last_cruise_button in (ACCEL_BUTTON, DECEL_BUTTON):
|
||||
self.acc_type = 1
|
||||
else:
|
||||
self.acc_type = 0
|
||||
|
||||
if self.cruise_button is not None:
|
||||
self.cruise_button = ACC_TYPE_BUTTONS.get(self.acc_type, {}).get(self.cruise_button, self.cruise_button)
|
||||
|
||||
def create_mock_button_messages(self) -> list[SendCan]:
|
||||
can_sends = []
|
||||
|
||||
self.update_checks()
|
||||
|
||||
if self.cruise_button is not None:
|
||||
if self.car_state.gra_stock_values["COUNTER"] != self.car_controller.gra_acc_counter_last:
|
||||
can_sends.append(self.car_controller.CCS.create_acc_buttons_control(self.car_controller.packer_pt, self.car_controller.ext_bus, self.car_state.gra_stock_values, buttons=self.cruise_button))
|
||||
|
||||
self.last_cruise_button = self.cruise_button
|
||||
self.last_v_cruise_cluster = self.v_cruise_cluster
|
||||
|
||||
return can_sends
|
||||
@@ -1,18 +0,0 @@
|
||||
def create_acc_buttons_control(packer, bus, gra_stock_values, buttons=0):
|
||||
values = {s: gra_stock_values[s] for s in [
|
||||
"GRA_Hauptschalter", # ACC button, on/off
|
||||
"GRA_Typ_Hauptschalter", # ACC main button type
|
||||
"GRA_Codierung", # ACC button configuration/coding
|
||||
"GRA_Tip_Stufe_2", # unknown related to stalk type
|
||||
"GRA_ButtonTypeInfo", # unknown related to stalk type
|
||||
]}
|
||||
|
||||
values.update({
|
||||
"COUNTER": (gra_stock_values["COUNTER"] + 1) % 16,
|
||||
"GRA_Tip_Wiederaufnahme": 1 if buttons == 3 else 0,
|
||||
"GRA_Tip_Setzen": 1 if buttons == 4 else 0,
|
||||
"GRA_Tip_Runter": 1 if buttons == 2 else 0,
|
||||
"GRA_Tip_Hoch": 1 if buttons == 1 else 0,
|
||||
})
|
||||
|
||||
return packer.make_can_msg("GRA_ACC_01", bus, values)
|
||||
@@ -1,17 +0,0 @@
|
||||
def create_acc_buttons_control(packer, bus, gra_stock_values, buttons=0):
|
||||
values = {s: gra_stock_values[s] for s in [
|
||||
"GRA_Hauptschalt", # ACC button, on/off
|
||||
"GRA_Typ_Hauptschalt", # ACC button, momentary vs latching
|
||||
"GRA_Kodierinfo", # ACC button, configuration
|
||||
"GRA_Sender", # ACC button, CAN message originator
|
||||
]}
|
||||
|
||||
values.update({
|
||||
"COUNTER": (gra_stock_values["COUNTER"] + 1) % 16,
|
||||
"GRA_Recall": 1 if buttons == 3 else 0,
|
||||
"GRA_Neu_Setzen": 1 if buttons == 4 else 0,
|
||||
"GRA_Down_kurz": 1 if buttons == 2 else 0,
|
||||
"GRA_Up_kurz": 1 if buttons == 1 else 0,
|
||||
})
|
||||
|
||||
return packer.make_can_msg("GRA_Neu", bus, values)
|
||||
@@ -104,6 +104,7 @@ def manager_init() -> None:
|
||||
("TorqueDeadzoneDeg", "0"),
|
||||
("TorqueFriction", "10"),
|
||||
("TorqueMaxLatAccel", "250"),
|
||||
("ToyotaAutoHold", "0"),
|
||||
("ToyotaAutoLockBySpeed", "0"),
|
||||
("ToyotaAutoUnlockByShifter", "0"),
|
||||
("ToyotaEnhancedBsm", "0"),
|
||||
@@ -123,6 +124,7 @@ def manager_init() -> None:
|
||||
("LastSunnylinkPingTime", "0"),
|
||||
("EnableGitlabRunner", "0"),
|
||||
("EnableSunnylinkUploader", "0"),
|
||||
("FastTakeOff", "0"),
|
||||
]
|
||||
if not PC:
|
||||
default_params.append(("LastUpdateTime", datetime.datetime.now(datetime.UTC).replace(tzinfo=None).isoformat().encode('utf8')))
|
||||
|
||||
Reference in New Issue
Block a user