Compare commits

..

108 Commits

Author SHA1 Message Date
Jason Wen dc6bbb519c Update interface.py 2024-09-16 16:24:10 -04:00
Jason Wen a4290d9676 Merge branch 'controls-custom-stock-long-ford' into dev-c3-cslc-ford
# Conflicts:
#	panda
#	selfdrive/car/hyundai/carcontroller.py
2024-09-16 15:50:47 -04:00
Jason Wen b10fe24d57 implement for ford 2024-09-16 15:46:31 -04:00
Jason Wen 45739d199c fixes 2024-09-16 10:19:54 -04:00
Jason Wen 29c143e6ee unused 2024-09-16 00:16:38 -04:00
Jason Wen 6d51225a9a move to method 2024-09-16 00:12:51 -04:00
Jason Wen 2d130b41c3 decouple and implement for volkswagen (mqb & pq) 2024-09-16 00:04:44 -04:00
Jason Wen cacdb08b05 updated 2024-09-15 23:09:53 -04:00
Jason Wen ed5dbc4dd2 missed 2024-09-15 22:07:34 -04:00
Jason Wen 028a468290 init package 2024-09-15 22:03:11 -04:00
Jason Wen 5b3acfbaf6 Update helpers.py 2024-09-15 18:02:25 -04:00
Jason Wen d54bc4d0b4 Fix 2024-09-15 17:57:22 -04:00
Jason Wen bb1ed2489c no longer needed 2024-09-15 13:47:15 -04:00
Jason Wen aee0a96e02 hkg rename 2024-09-15 10:58:17 -04:00
Jason Wen cc5a6b7fa4 fixup! decouple and implement for honda 2024-09-15 03:54:50 -04:00
Jason Wen 4cb50eeb96 decouple and implement for mazda 2024-09-15 03:47:32 -04:00
Jason Wen 3014e01865 decouple and implement for honda 2024-09-15 03:41:31 -04:00
Jason Wen fbde6d8d07 decouple and implement for fca 2024-09-15 03:30:43 -04:00
Jason Wen 457c82a3b1 todo for future investigation, default for now 2024-09-15 03:06:14 -04:00
Jason Wen e73c5dfc1d fix min set speed 2024-09-15 03:00:58 -04:00
Jason Wen 31accc75f9 more consistent button sends thanks to multikyd! 2024-09-15 02:56:53 -04:00
Jason Wen f34d61b9bd todo for future investigation, default for now 2024-09-15 02:47:05 -04:00
Jason Wen b4b494e6e9 only update hold time when ready 2024-09-15 02:16:07 -04:00
Jason Wen deafc23ea3 must check manual presses this way 2024-09-15 02:10:56 -04:00
Jason Wen f113940993 fix hysteresis 2024-09-15 01:54:03 -04:00
Jason Wen ddcabf9dea introduce random hold time (thanks to multikyd!) 2024-09-15 00:24:46 -04:00
Jason Wen 16354d4f63 initialize car state 2024-09-15 00:13:18 -04:00
Jason Wen 73e620245a add super 2024-09-15 00:11:24 -04:00
Jason Wen 2a62ca2600 set controller in constructor 2024-09-14 23:50:54 -04:00
Jason Wen 2d55dd0d12 flip them 2024-09-14 23:29:25 -04:00
Jason Wen 61b9db6666 explicit return type hint 2024-09-14 22:45:25 -04:00
Jason Wen 5135802760 newer platforms has pause/resume 2024-09-14 22:44:13 -04:00
Jason Wen be46484b6e missing symlink 2024-09-14 22:33:13 -04:00
Jason Wen 12f6278f96 redundant 2024-09-14 22:32:24 -04:00
Jason Wen 53bed607bb check not is ready once 2024-09-14 22:31:41 -04:00
Jason Wen 6aaba7bda4 make sure to immediately apply state change 2024-09-14 21:18:54 -04:00
Jason Wen 8879d158f8 reset count in holding 2024-09-14 21:11:08 -04:00
Jason Wen 3889accb5d move timer to state base 2024-09-14 20:44:30 -04:00
Jason Wen c8bef28d26 less is more 2024-09-14 20:39:07 -04:00
Jason Wen 3798118a76 always reset if not ready 2024-09-14 20:34:55 -04:00
Jason Wen 6e9a2eefeb more explicit inactive and loading 2024-09-14 20:24:45 -04:00
Jason Wen 6efef44bbe keep inactive simple 2024-09-14 20:21:14 -04:00
Jason Wen 4488ad70dd move to openpilot package 2024-09-14 20:00:29 -04:00
Jason Wen 9e3f15245e only 1 instance, so no need for list 2024-09-14 18:37:00 -04:00
Jason Wen 99b61454bd simplify 2024-09-14 18:27:23 -04:00
Jason Wen cc720d2800 move subs to method 2024-09-14 18:21:12 -04:00
Jason Wen 69b43269c1 move speed hysteresis to helpers 2024-09-14 18:18:46 -04:00
Jason Wen e2872e6f32 init list 2024-09-14 17:59:53 -04:00
Jason Wen a3a202fa87 ready state refactor 2024-09-14 17:58:28 -04:00
Jason Wen a5d6fe83ae diff 2024-09-14 17:50:38 -04:00
Jason Wen a70f9a642d callable state classes 2024-09-14 17:42:24 -04:00
Jason Wen c63c7d8bfd fixes 2024-09-14 17:30:29 -04:00
Jason Wen 931e79e801 fix publishing 2024-09-14 17:15:42 -04:00
Jason Wen bc3f0fa6a4 fix typo 2024-09-14 00:24:07 -04:00
Jason Wen 121a863cbf refactor logging 2024-09-14 00:22:13 -04:00
Jason Wen 7f146c5cce less 2024-09-13 23:30:43 -04:00
Jason Wen 3b30419dee add loading state 2024-09-13 23:26:19 -04:00
Jason Wen ddad143b7f decouple even more 2024-09-13 23:01:45 -04:00
Jason Wen efa292ca3f it's ok in init only 2024-09-13 22:31:59 -04:00
Jason Wen 28c85087dc unused 2024-09-13 22:27:47 -04:00
Jason Wen ca0a00b546 updated name 2024-09-13 22:27:29 -04:00
Jason Wen 6da758f53e set directly 2024-09-13 22:26:06 -04:00
Jason Wen cb4ba22ac7 Assign to class var 2024-09-13 11:19:44 -04:00
Jason Wen 78d35cb24e rename base class 2024-09-13 09:25:48 -04:00
Jason Wen 3cc0656961 move to helpers 2024-09-13 09:24:25 -04:00
Jason Wen 675e9957f9 no longer used 2024-09-13 09:21:26 -04:00
Jason Wen f2526cf0d1 entire obj 2024-09-13 09:19:49 -04:00
Jason Wen cc4ebe717b refactor speed checks 2024-09-13 09:13:19 -04:00
Jason Wen b54d7d486e typo 2024-09-13 08:57:45 -04:00
Jason Wen 814b623bfe simplify slc checks 2024-09-13 08:48:42 -04:00
Jason Wen 72b36d5482 use cereal 2024-09-13 08:48:03 -04:00
Jason Wen cc59dabc09 type hint 2024-09-13 08:18:45 -04:00
Jason Wen e5f9885288 typo 2024-09-13 08:18:31 -04:00
Jason Wen 4e81036d6c no longer used 2024-09-13 08:00:34 -04:00
Jason Wen a0b09e7154 hyundai: decouple completely 2024-09-13 07:40:33 -04:00
Jason Wen 3097d451fe implement in card 2024-09-13 00:58:50 -04:00
Jason Wen f90cfc2d0a unused 2024-09-13 00:39:44 -04:00
Jason Wen cfc8878392 not needed 2024-09-13 00:37:34 -04:00
Jason Wen da5a198bd0 new state machine 2024-09-13 00:33:10 -04:00
Jason Wen cecf82e951 set point in base class only 2024-09-13 00:32:30 -04:00
Jason Wen 43b87b53f5 new set speed buttons 2024-09-13 00:30:03 -04:00
Jason Wen 9d84814aba new button mapping 2024-09-13 00:25:15 -04:00
Jason Wen 30718cba8b move to card 2024-09-13 00:11:28 -04:00
Jason Wen 48b7567e38 no need 2024-09-12 23:49:42 -04:00
Jason Wen ddb1c92b2e new cereal name 2024-09-12 23:29:13 -04:00
Jason Wen af5ea57188 pass car instead 2024-09-12 23:12:19 -04:00
Jason Wen 4be8029ead infra for carControlSP 2024-09-12 23:03:01 -04:00
Jason Wen 480da5f8b8 remove from car interface 2024-09-12 22:42:19 -04:00
Jason Wen 8d39d5045d cut it 2024-09-09 19:59:27 -04:00
Jason Wen 455aa3d140 more fix 2024-09-09 19:49:56 -04:00
Jason Wen 47bd75a1b1 fix 2024-09-09 19:48:41 -04:00
Jason Wen c1d08539e7 services 2024-09-09 19:46:55 -04:00
Jason Wen e8b4d7c5a8 cleaner 2024-09-09 19:24:56 -04:00
Jason Wen 659c2ab446 more 2024-09-09 19:20:50 -04:00
Jason Wen 8dff996b8b more simplify 2024-09-09 18:54:36 -04:00
Jason Wen 08ec79db30 simplify 2024-09-09 18:52:14 -04:00
Jason Wen a88412f25a type hints 2024-09-06 03:31:54 -04:00
Jason Wen 73075c8b5a unused 2024-09-06 03:23:03 -04:00
Jason Wen 859b2fb29e implement for hyundai 2024-09-06 02:48:45 -04:00
Jason Wen 59a1122851 type hint 2024-09-06 02:43:00 -04:00
Jason Wen 4a9894d843 logging 2024-09-06 02:33:02 -04:00
Jason Wen 385d8c20d2 add hyundai 2024-09-06 02:26:18 -04:00
Jason Wen 43791061bb abstract out buttons 2024-09-06 02:26:13 -04:00
Jason Wen 8eff79892c init 2024-09-05 02:00:06 -04:00
Kumar 9e6824a69e new api: human like long control v1.2 (#420)
minor tweaks
2024-08-26 18:01:24 -07:00
Kumar caa6f5e7ba Dec v1.1 (#419)
* dec update

* dec

* dec: use anomaly to filter noise

* dec: use "WeightedMovingAverageCalculator" for more responsiveness and for smoohter transtion

* bug fixes
2024-08-26 17:53:46 -07:00
Kumar 9feffca58a new api: human like long control v1.1 (#414)
* lowspeed

* slight increase
2024-08-19 21:03:20 -07:00
rav4kumar a4faa41331 return: human api 2024-08-15 05:26:06 -07:00
82 changed files with 948 additions and 1667 deletions
-3
View File
@@ -38,9 +38,6 @@ 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
-1
View File
@@ -138,7 +138,6 @@ struct CarEvent @0x9b1657f34caf3ad3 {
speedLimitConfirmed @140;
torqueNNLoad @141;
hyundaiRadarTracksAvailable @142;
spAutoBrakeHold @143;
radarCanErrorDEPRECATED @15;
communityFeatureDisallowedDEPRECATED @62;
+18 -1
View File
@@ -212,7 +212,24 @@ struct ModelDataV2SP @0xf98d843bfd7004a3 {
modelCapabilities @4 :UInt32;
}
struct CustomReserved7 @0xb86e6369214c01c8 {
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 CustomReserved8 @0xf416ec09499d9d19 {
+1 -1
View File
@@ -2388,7 +2388,7 @@ struct Event {
liveMapDataSP @111 :Custom.LiveMapDataSP;
e2eLongStateSP @112 :Custom.E2eLongStateSP;
modelV2SP @113 :Custom.ModelDataV2SP;
customReserved7 @114 :Custom.CustomReserved7;
carControlSP @114 :Custom.CarControlSP;
customReserved8 @115 :Custom.CustomReserved8;
customReserved9 @116 :Custom.CustomReserved9;
+1
View File
@@ -83,6 +83,7 @@ _services: dict[str, tuple] = {
"liveMapDataSP": (True, 0.),
"e2eLongStateSP": (True, 0.),
"modelV2SP": (True, 20., 40),
"carControlSP": (True, 100., 10),
# debug
"uiDebug": (True, 0., 1),
-2
View File
@@ -255,7 +255,6 @@ 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},
@@ -331,7 +330,6 @@ 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
View File
@@ -0,0 +1 @@
../sunnypilot/
+1 -1
Submodule panda updated: 827201c04a...3b4cfcd291
+15 -4
View File
@@ -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'])
self.pm = messaging.PubMaster(['sendcan', 'carState', 'carParams', 'carOutput', 'carControlSP'])
self.can_rcv_cum_timeout_counter = 0
@@ -60,7 +60,6 @@ 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
@@ -68,11 +67,15 @@ 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")
@@ -178,8 +181,16 @@ 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 -193
View File
@@ -1,14 +1,10 @@
from cereal import car
import cereal.messaging as messaging
from common.conversions import Conversions as CV
from opendbc.can.packer import CANPacker
from openpilot.common.params import Params
from openpilot.selfdrive.car import DT_CTRL, apply_meas_steer_torque_limits
from openpilot.selfdrive.car import 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
@@ -26,64 +22,9 @@ 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:
@@ -114,20 +55,6 @@ 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:
@@ -179,122 +106,3 @@ 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
-5
View File
@@ -65,14 +65,9 @@ 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,
}
-2
View File
@@ -161,8 +161,6 @@ 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
+1
View File
@@ -24,6 +24,7 @@ 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
-184
View File
@@ -1,16 +1,12 @@
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
@@ -128,48 +124,7 @@ 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)
@@ -203,19 +158,6 @@ 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 = []
@@ -265,15 +207,6 @@ 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.
@@ -335,120 +268,3 @@ 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
-2
View File
@@ -329,8 +329,6 @@ 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
+1 -3
View File
@@ -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"):
if Params().get("DongleId", encoding='utf8') in ("012c95f06918eca4", "68d6a96e703c00c9", "11c1f1909ca37bca"):
ret.spFlags |= HyundaiFlagsSP.SP_UPSTREAM_TACO.value
else:
ret.enableBsm = 0x58b in fingerprint[0]
@@ -296,8 +296,6 @@ 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
-186
View File
@@ -1,14 +1,9 @@
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
@@ -21,63 +16,9 @@ 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:
@@ -102,11 +43,6 @@ 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
@@ -128,125 +64,3 @@ 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
-2
View File
@@ -89,8 +89,6 @@ 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
+4 -6
View File
@@ -92,22 +92,20 @@ 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,
"SET_P": 0,
"SET_P_INV": 1,
"RES": res,
"RES_INV": (res + 1) % 2,
"SET_M": dec,
"SET_M_INV": (dec + 1) % 2,
"SET_M": 0,
"SET_M_INV": 1,
"DISTANCE_LESS": 0,
"DISTANCE_LESS_INV": 1,
-32
View File
@@ -55,13 +55,6 @@ 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
@@ -175,9 +168,6 @@ 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)
@@ -296,25 +286,3 @@ 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
-9
View File
@@ -79,9 +79,6 @@ 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):
@@ -263,9 +260,6 @@ 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
@@ -469,7 +463,4 @@ 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)
+9 -14
View File
@@ -160,23 +160,26 @@ class CarInterface(CarInterfaceBase):
sp_tss2_long_tune = Params().get_bool("ToyotaTSS2Long")
# hand tuned (August 12, 2024)
# hand tuned (August 26, 2024)
def custom_tss2_longitudinal_tuning():
ret.vEgoStopping = 0.01
ret.vEgoStarting = 0.01
ret.stoppingDecelRate = 0.007
ret.vEgoStopping = 0.25
ret.vEgoStarting = 0.25
ret.stoppingDecelRate = 0.0074
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., 5., 12., 20., 27., 40.]
tune.kiV = [.35, .228, .205, .195, .10, .01]
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]
custom_tss2_longitudinal_tuning()
else:
tune.kpV = [0.0]
@@ -192,9 +195,6 @@ 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,11 +268,6 @@ 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
-34
View File
@@ -130,37 +130,3 @@ 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)
+1 -2
View File
@@ -16,7 +16,7 @@ PEDAL_TRANSITION = 10. * CV.MPH_TO_MS
class CarControllerParams:
ACCEL_MAX = 2.0 # m/s2, lower than allowed 2.0 m/s2 for tuning reasons
ACCEL_MAX = 1.5 # m/s2, lower than allowed 2.0 m/s2 for tuning reasons
ACCEL_MIN = -3.5 # m/s2
STEER_STEP = 1
@@ -64,7 +64,6 @@ class ToyotaFlagsSP(IntFlag):
SP_ZSS = 1
SP_ENHANCED_BSM = 2
SP_NEED_DEBUG_BSM = 4
SP_AUTO_BRAKE_HOLD = 8
class Footnote(Enum):
-205
View File
@@ -1,14 +1,11 @@
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
@@ -28,70 +25,12 @@ 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:
@@ -171,155 +110,11 @@ 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
-2
View File
@@ -171,8 +171,6 @@ 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
+3 -11
View File
@@ -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, frame=0, buttons=0, cancel=False, resume=False, custom_stock_long=False):
def create_acc_buttons_control(packer, bus, gra_stock_values, cancel=False, resume=False):
values = {s: gra_stock_values[s] for s in [
"GRA_Hauptschalter", # ACC button, on/off
"GRA_Typ_Hauptschalter", # ACC main button type
@@ -58,18 +58,10 @@ def create_acc_buttons_control(packer, bus, gra_stock_values, frame=0, buttons=0
"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": (frame + 1) % 0x10 if custom_stock_long else (gra_stock_values["COUNTER"] + 1) % 16,
"COUNTER": (gra_stock_values["COUNTER"] + 1) % 16,
"GRA_Abbrechen": cancel,
"GRA_Tip_Wiederaufnahme": resume or resume_cruise,
"GRA_Tip_Setzen": set_cruise,
"GRA_Tip_Runter": decel_cruise,
"GRA_Tip_Hoch": accel_cruise,
"GRA_Tip_Wiederaufnahme": resume,
})
return packer.make_can_msg("GRA_ACC_01", bus, values)
+3 -11
View File
@@ -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, frame=0, buttons=0, cancel=False, resume=False, custom_stock_long=False):
def create_acc_buttons_control(packer, bus, gra_stock_values, cancel=False, resume=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,18 +39,10 @@ def create_acc_buttons_control(packer, bus, gra_stock_values, frame=0, buttons=0
"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": (frame + 1) % 0x10 if custom_stock_long else (gra_stock_values["COUNTER"] + 1) % 16,
"COUNTER": (gra_stock_values["COUNTER"] + 1) % 16,
"GRA_Abbrechen": cancel,
"GRA_Recall": resume or resume_cruise,
"GRA_Neu_Setzen": set_cruise,
"GRA_Down_kurz": decel_cruise,
"GRA_Up_kurz": accel_cruise,
"GRA_Recall": resume,
})
return packer.make_can_msg("GRA_Neu", bus, values)
-8
View File
@@ -744,14 +744,6 @@ 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,7 +4,6 @@ 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
@@ -64,9 +63,9 @@ def get_jerk_factor(personality=custom.LongitudinalPersonalitySP.standard):
elif personality==custom.LongitudinalPersonalitySP.standard:
return 1.0
elif personality==custom.LongitudinalPersonalitySP.moderate:
return 0.95
return 0.85
elif personality==custom.LongitudinalPersonalitySP.aggressive:
return 0.9
return 0.8
elif personality==custom.LongitudinalPersonalitySP.overtake:
return 0.1
else:
@@ -94,35 +93,21 @@ 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.70, 1.70, 1.70]
y_dist = [1.75, 1.75, 1.70]
elif personality==custom.LongitudinalPersonalitySP.moderate:
x_vel = [0, 27.69, 27.7]
y_dist = [1.40, 1.40, 1.45]
y_dist = [1.45, 1.45, 1.40]
elif personality==custom.LongitudinalPersonalitySP.aggressive:
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]
x_vel = [0, 20.0, 20.01, 27.69, 27.7]
y_dist = [1.07, 1.07, 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
@@ -317,24 +302,15 @@ 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, v_lead0=0, v_lead1=0):
def set_weights(self, prev_accel_constraint=True, personality=custom.LongitudinalPersonalitySP.standard):
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 * a_change_v_ego, jerk_factor * J_EGO_COST * j_ego_v_ego]
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]
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 * a_change_v_ego, 1.0]
cost_weights = [0., 0.1, 0.2, 5.0, a_change_cost, 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')
@@ -386,7 +362,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, fast_take_off = False):
dynamic_personality=False, overtaking_acceleration_assist=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
@@ -398,12 +374,8 @@ 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.
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])
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,7 +103,6 @@ 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:
@@ -111,7 +110,6 @@ 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):
@@ -204,7 +202,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, fast_take_off=self.fast_take_off)
dynamic_personality=sm['controlsStateSP'].dynamicPersonality, overtaking_acceleration_assist=overtaking_accel_engaged)
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,18 +29,17 @@ from openpilot.common.numpy_fast import interp
AccelPersonality = custom.AccelerationPersonality
# accel personality by @arne182 modified by cgw and kumar
_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_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_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.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 = [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_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-7-11
# Version = 2024-8-26
from common.numpy_fast import interp
import numpy as np
@@ -112,7 +112,6 @@ 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
@@ -372,4 +371,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,12 +43,6 @@ 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,18 +159,6 @@ 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"),
@@ -219,7 +207,6 @@ 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,7 +216,6 @@ 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;
@@ -524,32 +523,10 @@ void AnnotatedCameraWidgetSP::drawHud(QPainter &p) {
// current speed
if (!hideVEgoUi) {
// Set up the font for the speed text
p.setFont(InterFont(176, QFont::Bold));
// 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
drawColoredText(p, rect().center().x(), 210, speedStr, brakeLights ? QColor(0xff, 0, 0, 255) : QColor(0xff, 0xff, 0xff, 255));
p.setFont(InterFont(66));
drawText(p, centerX, 290, speedUnit, 200);
drawText(p, rect().center().x(), 290, speedUnit, 200);
}
if (!reversing) {
@@ -1188,7 +1165,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.4));
painter.setBrush(QColor::fromRgbF(1.0, 0.0, 0.0, 0.2));
if (left_blindspot) painter.drawPolygon(scene.lane_barrier_vertices[0]);
if (right_blindspot) painter.drawPolygon(scene.lane_barrier_vertices[1]);
@@ -1313,25 +1290,46 @@ 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;
if (accel > 0) {
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%
p.setBrush(QColor(0, 245, 0, 200));
scannerRect = QRect(0, widgetHeight / 2 - halfHeightAbs, scannerWidth, halfHeightAbs);
} else {
p.setBrush(QColor(245, 0, 0, 200));
scannerRect = QRect(0, widgetHeight / 2, scannerWidth, halfHeightAbs);
}
p.drawRect(scannerRect);
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);
} else {
QRect ra = QRect(rect_w - wp, rect_h / 2, wp, hha / 2);
p.drawRect(ra);
}
}
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,7 +176,6 @@ private:
float latAccelFactorFiltered;
float frictionCoefficientFiltered;
bool liveValid;
bool ecoMode;
// ############################## DEV UI END ##############################
float btnPerc;
+18 -58
View File
@@ -203,14 +203,6 @@
<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>
@@ -1474,15 +1466,11 @@ This may take up to a minute.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>HKG: Custom Tuning for New Longitudinal API</source>
<source>HKG CAN: Smoother Stopping Performance (Beta)</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>
<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>
@@ -1529,22 +1517,6 @@ 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>
@@ -1611,6 +1583,14 @@ 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>
@@ -2537,14 +2517,6 @@ 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>
@@ -2553,14 +2525,6 @@ 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>
@@ -2946,10 +2910,6 @@ 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>
@@ -3317,14 +3277,6 @@ 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>
@@ -3353,6 +3305,14 @@ 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>
+18 -58
View File
@@ -203,14 +203,6 @@
<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>
@@ -1456,15 +1448,11 @@ This may take up to a minute.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>HKG: Custom Tuning for New Longitudinal API</source>
<source>HKG CAN: Smoother Stopping Performance (Beta)</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>
<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>
@@ -1511,22 +1499,6 @@ 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>
@@ -1593,6 +1565,14 @@ 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>
@@ -2521,14 +2501,6 @@ 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>
@@ -2537,14 +2509,6 @@ 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>
@@ -2932,10 +2896,6 @@ 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>
@@ -3303,14 +3263,6 @@ 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>
@@ -3339,6 +3291,14 @@ 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>
+8 -48
View File
@@ -207,14 +207,6 @@
<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>
@@ -1453,6 +1445,14 @@ 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,26 +1571,6 @@ 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>
@@ -2697,22 +2677,6 @@ 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>
@@ -3078,10 +3042,6 @@ 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>
+18 -58
View File
@@ -203,14 +203,6 @@
<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>
@@ -1458,15 +1450,11 @@ Cela peut prendre jusqu&apos;à une minute.</translation>
<translation type="unfinished"></translation>
</message>
<message>
<source>HKG: Custom Tuning for New Longitudinal API</source>
<source>HKG CAN: Smoother Stopping Performance (Beta)</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>
<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>
@@ -1513,22 +1501,6 @@ Cela peut prendre jusqu&apos;à 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>
@@ -1595,6 +1567,14 @@ 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>
@@ -2521,14 +2501,6 @@ 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>
@@ -2537,14 +2509,6 @@ 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>
@@ -2930,10 +2894,6 @@ 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>
@@ -3301,14 +3261,6 @@ 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>
@@ -3337,6 +3289,14 @@ 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>
+18 -58
View File
@@ -203,14 +203,6 @@
<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>
@@ -1452,15 +1444,11 @@ This may take up to a minute.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>HKG: Custom Tuning for New Longitudinal API</source>
<source>HKG CAN: Smoother Stopping Performance (Beta)</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>
<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>
@@ -1507,22 +1495,6 @@ 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>
@@ -1589,6 +1561,14 @@ 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>
@@ -2515,14 +2495,6 @@ 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>
@@ -2531,14 +2503,6 @@ 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>
@@ -2924,10 +2888,6 @@ 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>
@@ -3295,14 +3255,6 @@ 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>
@@ -3331,6 +3283,14 @@ 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>
+18 -58
View File
@@ -203,14 +203,6 @@
<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>
@@ -1454,15 +1446,11 @@ This may take up to a minute.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>HKG: Custom Tuning for New Longitudinal API</source>
<source>HKG CAN: Smoother Stopping Performance (Beta)</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>
<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>
@@ -1509,22 +1497,6 @@ 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>
@@ -1591,6 +1563,14 @@ 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,14 +2497,6 @@ 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>
@@ -2533,14 +2505,6 @@ 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>
@@ -2926,10 +2890,6 @@ 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>
@@ -3297,14 +3257,6 @@ 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>
@@ -3333,6 +3285,14 @@ 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>
+18 -58
View File
@@ -203,14 +203,6 @@
<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>
@@ -1458,15 +1450,11 @@ Isso pode levar até um minuto.</translation>
<translation type="unfinished"></translation>
</message>
<message>
<source>HKG: Custom Tuning for New Longitudinal API</source>
<source>HKG CAN: Smoother Stopping Performance (Beta)</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>
<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>
@@ -1513,22 +1501,6 @@ 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>
@@ -1595,6 +1567,14 @@ 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>
@@ -2521,14 +2501,6 @@ 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>
@@ -2537,14 +2509,6 @@ 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>
@@ -2930,10 +2894,6 @@ 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>
@@ -3301,14 +3261,6 @@ 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>
@@ -3337,6 +3289,14 @@ 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>
+18 -58
View File
@@ -203,14 +203,6 @@
<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>
@@ -1454,15 +1446,11 @@ This may take up to a minute.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>HKG: Custom Tuning for New Longitudinal API</source>
<source>HKG CAN: Smoother Stopping Performance (Beta)</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>
<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>
@@ -1509,22 +1497,6 @@ 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>
@@ -1591,6 +1563,14 @@ 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,14 +2497,6 @@ 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>
@@ -2533,14 +2505,6 @@ 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>
@@ -2926,10 +2890,6 @@ 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>
@@ -3297,14 +3257,6 @@ 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>
@@ -3333,6 +3285,14 @@ 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>
+18 -58
View File
@@ -203,14 +203,6 @@
<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>
@@ -1452,15 +1444,11 @@ This may take up to a minute.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>HKG: Custom Tuning for New Longitudinal API</source>
<source>HKG CAN: Smoother Stopping Performance (Beta)</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>
<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>
@@ -1507,22 +1495,6 @@ 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>
@@ -1589,6 +1561,14 @@ 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>
@@ -2515,14 +2495,6 @@ 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>
@@ -2531,14 +2503,6 @@ 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>
@@ -2924,10 +2888,6 @@ 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>
@@ -3295,14 +3255,6 @@ 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>
@@ -3331,6 +3283,14 @@ 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>
+18 -58
View File
@@ -203,14 +203,6 @@
<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>
@@ -1454,15 +1446,11 @@ This may take up to a minute.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>HKG: Custom Tuning for New Longitudinal API</source>
<source>HKG CAN: Smoother Stopping Performance (Beta)</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>
<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>
@@ -1509,22 +1497,6 @@ 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>
@@ -1591,6 +1563,14 @@ 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,14 +2497,6 @@ 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>
@@ -2533,14 +2505,6 @@ 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>
@@ -2926,10 +2890,6 @@ 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>
@@ -3297,14 +3257,6 @@ 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>
@@ -3333,6 +3285,14 @@ 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>
+18 -58
View File
@@ -203,14 +203,6 @@
<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>
@@ -1454,15 +1446,11 @@ This may take up to a minute.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>HKG: Custom Tuning for New Longitudinal API</source>
<source>HKG CAN: Smoother Stopping Performance (Beta)</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>
<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>
@@ -1509,22 +1497,6 @@ 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>
@@ -1591,6 +1563,14 @@ 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,14 +2497,6 @@ 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>
@@ -2533,14 +2505,6 @@ 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>
@@ -2926,10 +2890,6 @@ 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>
@@ -3297,14 +3257,6 @@ 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>
@@ -3333,6 +3285,14 @@ 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>
View File
View File
View File
@@ -0,0 +1,127 @@
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
@@ -0,0 +1,30 @@
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
@@ -0,0 +1,85 @@
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
View File
@@ -0,0 +1,32 @@
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
@@ -0,0 +1,9 @@
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)
@@ -0,0 +1,28 @@
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
@@ -0,0 +1,48 @@
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)
@@ -0,0 +1,25 @@
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
@@ -0,0 +1,58 @@
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
@@ -0,0 +1,22 @@
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)
@@ -0,0 +1,25 @@
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
@@ -0,0 +1,40 @@
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)
@@ -0,0 +1,77 @@
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
@@ -0,0 +1,18 @@
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)
@@ -0,0 +1,17 @@
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)
-2
View File
@@ -104,7 +104,6 @@ def manager_init() -> None:
("TorqueDeadzoneDeg", "0"),
("TorqueFriction", "10"),
("TorqueMaxLatAccel", "250"),
("ToyotaAutoHold", "0"),
("ToyotaAutoLockBySpeed", "0"),
("ToyotaAutoUnlockByShifter", "0"),
("ToyotaEnhancedBsm", "0"),
@@ -124,7 +123,6 @@ 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')))