Compare commits

..

103 Commits

Author SHA1 Message Date
firestar5683 b78cb017e6 User adjustable offsets 2026-02-07 23:33:48 -06:00
firestar5683 ecaae3f59b Integrator Smooth On Handoff 2026-02-06 15:48:27 -06:00
firestar5683 8e66bbf953 Lights 2026-02-05 22:40:53 -06:00
firestar5683 81924bcca1 New Models 2026-02-05 15:08:02 -06:00
firestar5683 e849c4ceeb Revert "merry christmas"
This reverts commit 8a9d0e5e6a.
2026-02-05 13:34:13 -06:00
firestar5683 12088b9e53 Increase Fault Resilience 2026-02-05 13:24:01 -06:00
firestarsdog fff9ef7a8e Stats 2026-02-02 01:07:28 -05:00
firestarsdog 433ef324e1 Stats 2026-02-01 22:46:33 -06:00
firestar5683 86d0954cfb friction threshold 2026-01-29 11:28:42 -06:00
firestar5683 63acba85dd tune 2026-01-29 11:28:42 -06:00
firestar5683 cfdcad5e54 lat updates 2026-01-28 23:52:15 -06:00
firestar5683 eaf78f7c99 Update override.toml 2026-01-19 21:18:47 -06:00
firestar5683 8903857cd5 Revert "Mac Update"
This reverts commit 6c20751a0b.
2026-01-19 11:45:02 -06:00
firestarsdog 7da0ff0875 Add SASCM to vehicle settings detection/stats 2026-01-19 10:38:11 -06:00
firestar5683 6c20751a0b Mac Update 2026-01-18 22:23:06 -06:00
firestarsdog f3c02aaf56 Stats 2026-01-18 22:16:51 -06:00
firestar5683 7abcd68c0d Update interface.py 2026-01-18 22:08:07 -06:00
firestar5683 f5d53574b3 Torque Controller Update 2026-01-18 21:58:49 -06:00
firestar5683 8072a0442b Update redneck 2026-01-15 22:54:24 -06:00
firestar5683 b71b07816e Split Tune 2026-01-15 19:26:03 -06:00
firestar5683 5e462fc725 fix redneck v2 2026-01-14 13:58:35 -06:00
firestar5683 a194a7c75e Remove lat smooth seconds 2026-01-14 13:50:49 -06:00
firestar5683 0664be6bd1 frogpilot migration 2026-01-12 22:12:21 -06:00
firestar5683 b33939dd5b More defaults 2026-01-12 22:04:25 -06:00
firestar5683 ac3ed7eece Update defaults 2026-01-12 22:01:19 -06:00
firestar5683 040593d359 Big Mac 2026-01-11 16:59:24 -06:00
firestar5683 20382af75a Try Higher Friction 2026-01-10 14:04:28 -06:00
firestar5683 3359805404 Autotune Off 2026-01-09 22:44:33 -06:00
firestar5683 37718176fb Revert "Pedal Braking Limits"
This reverts commit efd99af71e.
2025-12-31 20:56:00 -06:00
firestar5683 efd99af71e Pedal Braking Limits 2025-12-30 20:18:17 -06:00
firestar5683 6cf70ab06c merry christmas 2025-12-24 22:06:08 -06:00
firestar5683 4a06671a14 ds2 2025-12-24 21:30:28 -06:00
firestar5683 75f4d24e12 Try friction adjustment 2025-12-16 14:40:01 -06:00
firestar5683 08a9d254ce Update frogpilot_tracking.py 2025-12-15 00:56:38 -06:00
firestar5683 d3afbd4b15 minsteer speed 2025-12-14 14:47:44 -06:00
firestar5683 3d3870fbad Update Percentages 2025-12-13 19:14:57 -06:00
firestar5683 1acee6ea64 Trailer Load Gas Tuning 2025-12-12 10:51:18 -06:00
firestar5683 2eb5db43bc Live Friction 2025-12-11 16:55:55 -06:00
firestar5683 f184855906 Zero error 2025-12-11 15:12:40 -06:00
firestar5683 ae6ec1595e Updates
Update latcontrol_torque.py

interp friction threshold
2025-12-09 20:01:22 -06:00
firestar5683 e23776693c Change NoEntryAlert message to 'Reverse Gear' 2025-12-06 16:46:18 -06:00
firestar5683 56d7ac9704 Update events.py 2025-12-05 20:14:09 -06:00
firestar5683 8e90f233fb LattyBoi2.0 2025-12-03 23:31:34 -06:00
firestar5683 1fd0a80836 Latty Boi
Revert "Latty Boi"

This reverts commit af687e501cc4bdcda7840453d06595d7ea674148.

Reapply "Latty Boi"

This reverts commit ff5566d4439f5e4997fe83f4f21d0be62b75d75d.
2025-12-02 20:30:23 -06:00
firestar5683 392333c87b Recovery Power 2025-12-02 17:20:24 -06:00
firestar5683 f9daea40bd New planplus 2025-12-02 12:10:22 -06:00
Woohyun Rho 5581ea22e7 Update 2025-11-28 17:13:20 -06:00
firestar5683 d72a3996f6 New Lateral Changes 2025-11-18 20:50:34 -06:00
firestarsdog 37f65bd382 Gen2ACC Distance Button Sync for CC_ONLY_CAR 2025-11-16 00:49:15 -05:00
firestar5683 40dee4661c Update 2025-11-15 14:46:12 -06:00
firestar5683 dcb0104208 Accel Tests 2025-11-14 20:33:42 -06:00
firestar5683 38d725ea03 Paddle Planner 2025-11-14 19:47:31 -05:00
firestar5683 5b69250cac Revert "Upstream Lateral"
This reverts commit faf1a6755d.
2025-11-10 18:33:23 -06:00
firestar5683 faf1a6755d Upstream Lateral
Revert "Upstream Lateral"

This reverts commit 20f7d6631bb152860781b46533bb0e96223be132.

Reapply "Upstream Lateral"

This reverts commit 2a7a563e219a1b688529d341919fc377fed5038e.

Update latcontrol_torque.py

more lateral

Update ui
2025-11-07 00:14:06 -06:00
firestar5683 2d51ca9538 Revert "Pedal Panda?"
This reverts commit 938fe7a088.
2025-10-30 22:36:32 -05:00
firestar5683 78223aa635 Pedal? 2025-10-28 16:48:48 -05:00
firestar5683 724ac83641 Update 2025-10-25 15:43:52 -05:00
firestar5683 21c28cd8c8 Medium Fanta 2025-10-22 22:27:58 -05:00
firestar5683 436a2f0c1a Update interfaces.py 2025-10-20 13:49:14 -05:00
firestar5683 f5b734d6e6 no nnff 2025-10-19 17:59:30 -05:00
firestar5683 424273284a Scene Complexity 2025-10-18 14:26:02 -05:00
firestar5683 48fc133cf9 Update carcontroller.py 2025-10-17 19:10:56 -05:00
firestar5683 e2722dd9ba Update interface.py 2025-10-17 18:14:14 -05:00
firestar5683 96e80fb926 CEM 2025-10-17 17:39:31 -05:00
firestar5683 d81515be22 lite 2025-10-17 17:13:56 -05:00
firestar5683 abe891f971 Redneck 2.0 2025-10-17 16:54:17 -05:00
firestar5683 b45630fd71 Modify torque tuning parameters in interfaces.py
Adjusted torque tuning parameters for improved performance.
2025-10-17 16:54:08 -05:00
firestar5683 559184621b Hurts Donut 2025-10-16 23:58:42 -05:00
firestar5683 2e3b62432c Smoothy Boi 2025-10-16 23:36:34 -05:00
firestar5683 50cb5778bd lat3 2025-10-15 22:21:26 -05:00
firestar5683 dda6f78dcc oopsie doopsie 2025-10-12 00:12:21 -05:00
firestar5683 66df2e23aa New Lateral Changes 2025-10-10 21:00:05 -05:00
firestar5683 69cd237ef4 Fix Standard 2025-10-10 19:24:48 -05:00
firestar5683 938fe7a088 Pedal Panda? 2025-10-10 13:18:20 -05:00
firestar5683 40019815c1 pedal
Revert "pedal"

This reverts commit 164a4ac9ff39c244b23d118f38bedb097867fa2e.

f
2025-10-09 12:22:10 -05:00
firestar5683 5125403753 Update interface.py 2025-10-08 23:25:07 -05:00
firestar5683 7cea8cd192 error? 2025-10-08 23:13:38 -05:00
firestar5683 2bada45e97 Update interface.py 2025-10-08 23:00:27 -05:00
firestar5683 39cdd2f5d3 Fix Pedal 2025-10-08 22:36:11 -05:00
firestar5683 939748dd03 Fix New Devices 2025-10-08 22:19:50 -05:00
firestar5683 20447a47e5 No positive P-response for long control if user-selected parameter set 2025-10-08 07:42:41 -05:00
firestar5683 0282d33d3b Update carstate.py 2025-10-08 07:14:12 -05:00
firestar5683 d452ee2a8d Silverado 2025-10-07 18:13:15 -05:00
firestar5683 bce304c6bc Update values.py 2025-10-07 17:50:23 -05:00
firestar5683 a03826d5fa Update carcontroller.py 2025-10-07 17:03:16 -05:00
firestar5683 0f24b3383e Update carcontroller.py 2025-10-07 15:49:57 -05:00
firestar5683 5c3e33bceb Automatic updates 2025-10-04 16:03:43 -05:00
firestar5683 0b4fd887c8 Steer Alerts 2025-10-04 01:49:03 -05:00
firestar5683 36499deb71 Update frogpilot_acceleration.py 2025-10-03 22:41:54 -05:00
firestar5683 c7464f41da SteerAlerts 2025-10-03 22:13:17 -05:00
firestar5683 cab3268601 Update carcontroller.py 2025-10-03 21:58:18 -05:00
firestar5683 b91119b5e6 Update carcontroller.py 2025-10-03 21:25:35 -05:00
firestar5683 db2cf740fe Donut DM 2025-10-03 20:49:14 -05:00
firestar5683 3da42a78a3 Update gm_global_a_powertrain_generated.dbc 2025-10-03 16:14:27 -05:00
firestar5683 ac72c0e2c0 Cruise Fault? 2025-10-03 16:07:08 -05:00
firestar5683 9b7bef0877 Update 2025-10-03 00:43:33 -05:00
firestar5683 5208dd65aa Reapply "Torque Panda"
This reverts commit d0d28e661b.
2025-10-03 00:17:34 -05:00
firestar5683 bbe340147b Panda 2025-10-03 00:10:38 -05:00
firestar5683 db579b7f3c Cruise Fault?
Revert "Cruise Fault?"

This reverts commit 8de3739597a6e729b3c55fc053a13add9129a1f4.
2025-10-02 23:25:12 -05:00
firestar5683 07cb470c25 firehose 2025-09-30 20:45:22 -05:00
firestar5683 851f219cef Update tinygrad_modeld.py 2025-09-30 14:30:43 -05:00
firestar5683 2123be2eca Torque 2025-09-30 10:43:37 -05:00
firestar5683 b1bd4d1f27 Dom 2025-09-30 10:30:26 -05:00
13 changed files with 114 additions and 82 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+11 -11
View File
@@ -10,16 +10,16 @@ const SteeringLimits GM_STEERING_LIMITS = {
}; };
const LongitudinalLimits GM_ASCM_LONG_LIMITS = { const LongitudinalLimits GM_ASCM_LONG_LIMITS = {
.max_gas = 3072, .max_gas = 8191,
.min_gas = 1404, .min_gas = 5500,
.inactive_gas = 1404, .inactive_gas = 5500,
.max_brake = 400, .max_brake = 400,
}; };
const LongitudinalLimits GM_CAM_LONG_LIMITS = { const LongitudinalLimits GM_CAM_LONG_LIMITS = {
.max_gas = 3400, .max_gas = 8848,
.min_gas = 1514, .min_gas = 5610,
.inactive_gas = 1554, .inactive_gas = 5650,
.max_brake = 400, .max_brake = 400,
}; };
@@ -143,7 +143,7 @@ static void gm_rx_hook(const CANPacket_t *to_push) {
} }
if ((addr == 0xC9) && ((gm_hw == GM_CAM) || (gm_hw == GM_SDGM))) { if ((addr == 0xC9) && ((gm_hw == GM_CAM) || (gm_hw == GM_SDGM))) {
brake_pressed = GET_BIT(to_push, 40U); brake_pressed = GET_BIT(to_push, 40U) != 0U;
} }
if (addr == 0xC9) { if (addr == 0xC9) {
@@ -242,10 +242,10 @@ static bool gm_tx_hook(const CANPacket_t *to_send) {
// GAS/REGEN: safety check // GAS/REGEN: safety check
if (addr == 0x2CB) { if (addr == 0x2CB) {
bool apply = GET_BIT(to_send, 0U); bool apply = GET_BIT(to_send, 0U);
int gas_regen = ((GET_BYTE(to_send, 2) & 0x7FU) << 5) + ((GET_BYTE(to_send, 3) & 0xF8U) >> 3); int gas_regen = ((GET_BYTE(to_send, 1) & 0x1U) << 13) + ((GET_BYTE(to_send, 2) & 0xFFU) << 5) + ((GET_BYTE(to_send, 3) & 0xF8U) >> 3);
bool violation = false; bool violation = false;
// Allow apply bit in pre-enabled and overriding states, except for inactive gas // Allow apply bit in pre-enabled and overriding states // Allow apply bit in pre-enabled and overriding states
violation |= !controls_allowed && apply; violation |= !controls_allowed && apply;
violation |= longitudinal_gas_checks(gas_regen, *gm_long_limits); violation |= longitudinal_gas_checks(gas_regen, *gm_long_limits);
@@ -335,9 +335,9 @@ static safety_config gm_init(uint16_t param) {
gm_force_ascm = GET_FLAG(param, GM_PARAM_HW_ASCM_LONG); gm_force_ascm = GET_FLAG(param, GM_PARAM_HW_ASCM_LONG);
if (gm_hw == GM_ASCM || gm_force_ascm) { if (gm_hw == GM_ASCM || gm_force_ascm) {
gm_long_limits = &GM_ASCM_LONG_LIMITS; gm_long_limits = &GM_ASCM_LONG_LIMITS;
} else if ((gm_hw == GM_CAM) || (gm_hw == GM_SDGM)) { } else if ((gm_hw == GM_CAM) || (gm_hw == GM_SDGM)) {
gm_long_limits = &GM_CAM_LONG_LIMITS; gm_long_limits = &GM_CAM_LONG_LIMITS;
} else { } else {
} }
+31 -13
View File
@@ -1,5 +1,7 @@
from typing import Tuple from typing import Tuple
import time import time
import math
from openpilot.common.swaglog import cloudlog
from cereal import car from cereal import car
from openpilot.common.conversions import Conversions as CV from openpilot.common.conversions import Conversions as CV
from openpilot.common.filter_simple import FirstOrderFilter from openpilot.common.filter_simple import FirstOrderFilter
@@ -9,7 +11,7 @@ from openpilot.common.params_pyx import Params
from opendbc.can.packer import CANPacker from opendbc.can.packer import CANPacker
from openpilot.selfdrive.car import apply_driver_steer_torque_limits, create_gas_interceptor_command from openpilot.selfdrive.car import apply_driver_steer_torque_limits, create_gas_interceptor_command
from openpilot.selfdrive.car.gm import gmcan from openpilot.selfdrive.car.gm import gmcan
from openpilot.selfdrive.car.gm.values import DBC, AccState, CanBus, CarControllerParams, CruiseButtons, GMFlags, CC_ONLY_CAR, SDGM_CAR, EV_CAR, CC_REGEN_PADDLE_CAR from openpilot.selfdrive.car.gm.values import CAR, DBC, AccState, CanBus, CarControllerParams, CruiseButtons, GMFlags, CC_ONLY_CAR, SDGM_CAR, EV_CAR, CC_REGEN_PADDLE_CAR
from openpilot.selfdrive.car.interfaces import CarControllerBase from openpilot.selfdrive.car.interfaces import CarControllerBase
from openpilot.selfdrive.controls.lib.drive_helpers import apply_deadzone from openpilot.selfdrive.controls.lib.drive_helpers import apply_deadzone
from openpilot.selfdrive.controls.lib.vehicle_model import ACCELERATION_DUE_TO_GRAVITY from openpilot.selfdrive.controls.lib.vehicle_model import ACCELERATION_DUE_TO_GRAVITY
@@ -64,13 +66,20 @@ class CarController(CarControllerBase):
self.params = CarControllerParams(self.CP) self.params = CarControllerParams(self.CP)
self.params_ = Params() self.params_ = Params()
self.mass = CP.mass
self.tireRadius = 0.075 * CP.wheelbase + 0.1453
self.frontalArea = 1.05 * CP.wheelbase + 0.0679
self.coeffDrag = 0.30
self.airDensity = 1.225
self.packer_pt = CANPacker(DBC[self.CP.carFingerprint]['pt']) self.packer_pt = CANPacker(DBC[self.CP.carFingerprint]['pt'])
self.packer_obj = CANPacker(DBC[self.CP.carFingerprint]['radar']) self.packer_obj = CANPacker(DBC[self.CP.carFingerprint]['radar'])
self.packer_ch = CANPacker(DBC[self.CP.carFingerprint]['chassis']) self.packer_ch = CANPacker(DBC[self.CP.carFingerprint]['chassis'])
# FrogPilot variables # FrogPilot variables
self.accel_g = 0.0 self.accel_g = 0.0
self.pitch = FirstOrderFilter(0., 0.09 * 4, DT_CTRL * 4) # runs at 25 Hz self.pitch = FirstOrderFilter(0., 0.09 * 4, DT_CTRL * 4) # runs at 25 Hz
self.accel_g = 0.0 self.accel_g = 0.0
self.regen_paddle_pressed = False self.regen_paddle_pressed = False
@@ -350,14 +359,6 @@ class CarController(CarControllerBase):
if self.frame % 4 == 0: if self.frame % 4 == 0:
stopping = actuators.longControlState == LongCtrlState.stopping stopping = actuators.longControlState == LongCtrlState.stopping
# Pitch compensated acceleration;
# TODO: include future pitch (sm['modelDataV2'].orientation.y) to account for long actuator delay
if frogpilot_toggles.long_pitch and len(CC.orientationNED) > 1:
self.pitch.update(CC.orientationNED[1])
self.accel_g = ACCELERATION_DUE_TO_GRAVITY * apply_deadzone(self.pitch.x, PITCH_DEADZONE) # driving uphill is positive pitch
accel += self.accel_g
brake_accel = actuators.accel + self.accel_g * interp(CS.out.vEgo, BRAKE_PITCH_FACTOR_BP, BRAKE_PITCH_FACTOR_V)
at_full_stop = CC.longActive and CS.out.standstill at_full_stop = CC.longActive and CS.out.standstill
near_stop = CC.longActive and (CS.out.vEgo < self.params.NEAR_STOP_BRAKE_PHASE) near_stop = CC.longActive and (CS.out.vEgo < self.params.NEAR_STOP_BRAKE_PHASE)
interceptor_gas_cmd = 0 interceptor_gas_cmd = 0
@@ -369,9 +370,26 @@ class CarController(CarControllerBase):
self.apply_gas = self.params.INACTIVE_REGEN self.apply_gas = self.params.INACTIVE_REGEN
self.apply_brake = int(min(-100 * frogpilot_toggles.stopAccel, self.params.MAX_BRAKE)) self.apply_brake = int(min(-100 * frogpilot_toggles.stopAccel, self.params.MAX_BRAKE))
else: else:
# Normal operation if len(CC.orientationNED) == 3 and CS.out.vEgo > self.CP.vEgoStopping:
self.apply_gas = int(round(interp(accel, self.params.GAS_LOOKUP_BP, self.params.GAS_LOOKUP_V))) accel_due_to_pitch = math.sin(CC.orientationNED[1]) * ACCELERATION_DUE_TO_GRAVITY
else:
accel_due_to_pitch = 0.0
gas_max = self.params.MAX_GAS
accel_max = self.params.ACCEL_MAX
accel = clip(actuators.accel + accel_due_to_pitch, self.params.ACCEL_MIN, accel_max)
torque = self.tireRadius * ((self.mass*accel) + (0.5*self.coeffDrag*self.frontalArea*self.airDensity*CS.out.vEgo**2))
scaled_torque = torque + self.params.ZERO_GAS
apply_gas_torque = clip(scaled_torque, self.params.MAX_ACC_REGEN, gas_max)
BRAKE_SWITCH = int(round(interp(CS.out.vEgo, self.params.BRAKE_SWITCH_LOOKUP_BP, self.params.BRAKE_SWITCH_LOOKUP_V)))
brake_accel = min((scaled_torque - BRAKE_SWITCH)/(self.tireRadius*self.mass), 0)
self.apply_gas = int(round(apply_gas_torque))
self.apply_brake = int(round(interp(brake_accel, self.params.BRAKE_LOOKUP_BP, self.params.BRAKE_LOOKUP_V))) self.apply_brake = int(round(interp(brake_accel, self.params.BRAKE_LOOKUP_BP, self.params.BRAKE_LOOKUP_V)))
if self.apply_brake > 0:
self.apply_gas = self.params.INACTIVE_REGEN
# Don't allow any gas above inactive regen while stopping # Don't allow any gas above inactive regen while stopping
# FIXME: brakes aren't applied immediately when enabling at a stop # FIXME: brakes aren't applied immediately when enabling at a stop
if stopping: if stopping:
@@ -449,7 +467,7 @@ class CarController(CarControllerBase):
) and CS.out.cruiseState.enabled: ) and CS.out.cruiseState.enabled:
if (self.frame - self.last_button_frame) * DT_CTRL > 0.04: if (self.frame - self.last_button_frame) * DT_CTRL > 0.04:
self.last_button_frame = self.frame self.last_button_frame = self.frame
can_sends.append(gmcan.create_buttons(self.packer_pt, CanBus.POWERTRAIN, (CS.buttons_counter + 1) % 4, CruiseButtons.CANCEL)) can_sends.append(gmcan.create_buttons(self.packer_pt, CanBus.CAMERA, (CS.buttons_counter + 1) % 4, CruiseButtons.CANCEL))
else: else:
# While car is braking, cancel button causes ECM to enter a soft disable state with a fault status. # While car is braking, cancel button causes ECM to enter a soft disable state with a fault status.
+12 -8
View File
@@ -5,7 +5,7 @@ from openpilot.common.numpy_fast import mean
from opendbc.can.can_define import CANDefine from opendbc.can.can_define import CANDefine
from opendbc.can.parser import CANParser from opendbc.can.parser import CANParser
from openpilot.selfdrive.car.interfaces import CarStateBase from openpilot.selfdrive.car.interfaces import CarStateBase
from openpilot.selfdrive.car.gm.values import DBC, AccState, CanBus, STEER_THRESHOLD, GMFlags, CC_ONLY_CAR, CAMERA_ACC_CAR, SDGM_CAR, CC_REGEN_PADDLE_CAR from openpilot.selfdrive.car.gm.values import DBC, AccState, CanBus, STEER_THRESHOLD, GMFlags, CC_ONLY_CAR, CAMERA_ACC_CAR, SDGM_CAR, CC_REGEN_PADDLE_CAR, CAR
TransmissionType = car.CarParams.TransmissionType TransmissionType = car.CarParams.TransmissionType
NetworkLocation = car.CarParams.NetworkLocation NetworkLocation = car.CarParams.NetworkLocation
@@ -53,9 +53,6 @@ class CarState(CarStateBase):
self.moving_backward = (pt_cp.vl["EBCMWheelSpdRear"]["RLWheelDir"] == 2) or (pt_cp.vl["EBCMWheelSpdRear"]["RRWheelDir"] == 2) self.moving_backward = (pt_cp.vl["EBCMWheelSpdRear"]["RLWheelDir"] == 2) or (pt_cp.vl["EBCMWheelSpdRear"]["RRWheelDir"] == 2)
# Variables used for avoiding LKAS faults # Variables used for avoiding LKAS faults
self.loopback_lka_steering_cmd_updated = len(loopback_cp.vl_all["ASCMLKASteeringCmd"]["RollingCounter"]) > 0
if self.loopback_lka_steering_cmd_updated:
self.loopback_lka_steering_cmd_ts_nanos = loopback_cp.ts_nanos["ASCMLKASteeringCmd"]["RollingCounter"]
# Track timestamps for OEM PRNDL2 and Regen Paddle messages (used to sync spoofing timing) # Track timestamps for OEM PRNDL2 and Regen Paddle messages (used to sync spoofing timing)
self.prndl2_ts_nanos = pt_cp.ts_nanos["ECMPRDNL2"]["PRNDL2"] self.prndl2_ts_nanos = pt_cp.ts_nanos["ECMPRDNL2"]["PRNDL2"]
@@ -63,6 +60,9 @@ class CarState(CarStateBase):
self.regen_paddle_ts_nanos = pt_cp.ts_nanos["EBCMRegenPaddle"]["RegenPaddle"] self.regen_paddle_ts_nanos = pt_cp.ts_nanos["EBCMRegenPaddle"]["RegenPaddle"]
else: else:
self.regen_paddle_ts_nanos = 0 self.regen_paddle_ts_nanos = 0
self.loopback_lka_steering_cmd_updated = len(loopback_cp.vl_all["ASCMLKASteeringCmd"]["RollingCounter"]) > 0
if self.loopback_lka_steering_cmd_updated:
self.loopback_lka_steering_cmd_ts_nanos = loopback_cp.ts_nanos["ASCMLKASteeringCmd"]["RollingCounter"]
if self.CP.networkLocation == NetworkLocation.fwdCamera and not self.CP.flags & GMFlags.NO_CAMERA.value: if self.CP.networkLocation == NetworkLocation.fwdCamera and not self.CP.flags & GMFlags.NO_CAMERA.value:
self.pt_lka_steering_cmd_counter = pt_cp.vl["ASCMLKASteeringCmd"]["RollingCounter"] self.pt_lka_steering_cmd_counter = pt_cp.vl["ASCMLKASteeringCmd"]["RollingCounter"]
self.cam_lka_steering_cmd_counter = cam_cp.vl["ASCMLKASteeringCmd"]["RollingCounter"] self.cam_lka_steering_cmd_counter = cam_cp.vl["ASCMLKASteeringCmd"]["RollingCounter"]
@@ -96,7 +96,7 @@ class CarState(CarStateBase):
# Regen braking is braking # Regen braking is braking
if self.CP.transmissionType == TransmissionType.direct: if self.CP.transmissionType == TransmissionType.direct:
ret.regenBraking = pt_cp.vl["EBCMRegenPaddle"]["RegenPaddle"] != 0 ret.regenBraking = pt_cp.vl["EBCMRegenPaddle"]["RegenPaddle"] != 0
self.single_pedal_mode = ret.gearShifter == GearShifter.low or pt_cp.vl["EVDriveMode"]["SinglePedalModeActive"] == 1 or (ret.regenBraking and GearShifter.manumatic) self.single_pedal_mode = ret.gearShifter == GearShifter.low or pt_cp.vl["EVDriveMode"]["SinglePedalModeActive"] == 1 or (ret.regenBraking and GearShifter.manumatic) or (self.CP.carFingerprint in [CAR.CHEVROLET_BOLT_EUV, CAR.CHEVROLET_BOLT_CC] and self.CP.enableGasInterceptor)
if self.CP.enableGasInterceptor: if self.CP.enableGasInterceptor:
ret.gas = (pt_cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + pt_cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) / 2. ret.gas = (pt_cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + pt_cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) / 2.
@@ -163,7 +163,11 @@ class CarState(CarStateBase):
if self.CP.carFingerprint in CC_ONLY_CAR: if self.CP.carFingerprint in CC_ONLY_CAR:
ret.accFaulted = False ret.accFaulted = False
ret.cruiseState.speed = pt_cp.vl["ECMCruiseControl"]["CruiseSetSpeed"] * CV.KPH_TO_MS ret.cruiseState.speed = pt_cp.vl["ECMCruiseControl"]["CruiseSetSpeed"] * CV.KPH_TO_MS
ret.cruiseState.enabled = pt_cp.vl["ECMCruiseControl"]["CruiseActive"] != 0 # Try ASCM first for cars that might have it (like misfingerprinted Bolts), fall back to ECM
try:
ret.cruiseState.enabled = cam_cp.vl["ASCMActiveCruiseControlStatus"]["ACCCmdActive"] != 0
except:
ret.cruiseState.enabled = pt_cp.vl["ECMCruiseControl"]["CruiseActive"] != 0
if self.CP.enableBsm: if self.CP.enableBsm:
if self.CP.carFingerprint not in SDGM_CAR: if self.CP.carFingerprint not in SDGM_CAR:
@@ -173,7 +177,7 @@ class CarState(CarStateBase):
ret.leftBlindspot = cam_cp.vl["BCMBlindSpotMonitor"]["LeftBSM"] == 1 ret.leftBlindspot = cam_cp.vl["BCMBlindSpotMonitor"]["LeftBSM"] == 1
ret.rightBlindspot = cam_cp.vl["BCMBlindSpotMonitor"]["RightBSM"] == 1 ret.rightBlindspot = cam_cp.vl["BCMBlindSpotMonitor"]["RightBSM"] == 1
# FrogPilot CarState functions
self.lkas_previously_enabled = self.lkas_enabled self.lkas_previously_enabled = self.lkas_enabled
if self.CP.carFingerprint in SDGM_CAR: if self.CP.carFingerprint in SDGM_CAR:
self.lkas_enabled = cam_cp.vl["ASCMSteeringButton"]["LKAButton"] self.lkas_enabled = cam_cp.vl["ASCMSteeringButton"]["LKAButton"]
@@ -206,7 +210,7 @@ class CarState(CarStateBase):
messages += [ messages += [
("AEBCmd", 10), ("AEBCmd", 10),
] ]
if CP.carFingerprint not in CC_ONLY_CAR: # Include ASCMActiveCruiseControlStatus for all non-SDGM fwdCamera cars
messages += [ messages += [
("ASCMActiveCruiseControlStatus", 25), ("ASCMActiveCruiseControlStatus", 25),
] ]
+15 -16
View File
@@ -66,7 +66,6 @@ def create_gas_regen_command(packer, bus, throttle, idx, enabled, at_full_stop):
"GasRegenFullStopActive": at_full_stop, "GasRegenFullStopActive": at_full_stop,
"GasRegenAlwaysOne": 1, "GasRegenAlwaysOne": 1,
"GasRegenAlwaysOne2": 1, "GasRegenAlwaysOne2": 1,
"GasRegenAlwaysOne3": 1,
} }
dat = packer.make_can_msg("ASCMGasRegenCmd", bus, values)[2] dat = packer.make_can_msg("ASCMGasRegenCmd", bus, values)[2]
@@ -177,21 +176,6 @@ def create_lka_icon_command(bus, active, critical, steer):
dat = b"\x00\x00\x00" dat = b"\x00\x00\x00"
return make_can_msg(0x104c006c, dat, bus) return make_can_msg(0x104c006c, dat, bus)
def create_prndl2_command(packer, bus, press_regen_paddle):
prndl2_value = 7 if press_regen_paddle else 6
manual_mode = 1 if press_regen_paddle else 0
values = {
"Byte0": 0x0C,
"Byte1": 0x0C,
"Byte2": 0x00,
"PRNDL2": prndl2_value,
"Byte4": 0x00,
"ManualMode": manual_mode,
"TransmissionState": 1,
"Byte7": 0x00
}
return packer.make_can_msg("ECMPRDNL2", bus, values)
def create_regen_paddle_command(packer, bus, press_regen_paddle): def create_regen_paddle_command(packer, bus, press_regen_paddle):
regen_paddle_value = 2 if press_regen_paddle else 0 regen_paddle_value = 2 if press_regen_paddle else 0
values = { values = {
@@ -205,6 +189,21 @@ def create_regen_paddle_command(packer, bus, press_regen_paddle):
} }
return packer.make_can_msg("EBCMRegenPaddle", bus, values) return packer.make_can_msg("EBCMRegenPaddle", bus, values)
def create_prndl2_command(packer, bus, press_regen_paddle):
prndl2_value = 5 if press_regen_paddle else 6
manual_mode = 1 if press_regen_paddle else 0
values = {
"Byte0": 0x0C,
"Byte1": 0x0C,
"Byte2": 0x00,
"PRNDL2": prndl2_value,
"Byte4": 0x00,
"ManualMode": manual_mode,
"TransmissionState": 1,
"Byte7": 0x00
}
return packer.make_can_msg("ECMPRDNL2", bus, values)
def create_gm_cc_spam_command(packer, controller, CS, actuators, frogpilot_toggles): def create_gm_cc_spam_command(packer, controller, CS, actuators, frogpilot_toggles):
accel = actuators.accel accel = actuators.accel
Vego = CS.out.vEgo Vego = CS.out.vEgo
+7 -5
View File
@@ -28,12 +28,12 @@ ACCELERATOR_POS_MSG = 0xbe
NON_LINEAR_TORQUE_PARAMS = { NON_LINEAR_TORQUE_PARAMS = {
CAR.CHEVROLET_BOLT_EUV: { CAR.CHEVROLET_BOLT_EUV: {
"left": [1.8, 1.1, 0.27, 0.0], "left": [2.6531724862969748, 1.1, 0.1719764879840985, 0.0],
"right": [2.0, 1.0, 0.205, 0.0], "right": [2.8531724862969748, 1.0, 0.1469764879840985, 0.0],
}, },
CAR.CHEVROLET_BOLT_CC: { CAR.CHEVROLET_BOLT_CC: {
"left": [1.8, 1.1, 0.27, 0.0], "left": [2.6531724862969748, 1.1, 0.1719764879840985, 0.0],
"right": [2.0, 1.0, 0.205, 0.0], "right": [2.8531724862969748, 1.0, 0.1469764879840985, 0.0],
}, },
CAR.GMC_ACADIA: { CAR.GMC_ACADIA: {
"left": [4.78003305, 1.0, 0.3122, 0.05591772], "left": [4.78003305, 1.0, 0.3122, 0.05591772],
@@ -145,8 +145,10 @@ class CarInterface(CarInterfaceBase):
ret.experimentalLongitudinalAvailable = candidate not in CC_ONLY_CAR ret.experimentalLongitudinalAvailable = candidate not in CC_ONLY_CAR
ret.networkLocation = NetworkLocation.fwdCamera ret.networkLocation = NetworkLocation.fwdCamera
ret.radarUnavailable = True # no radar ret.radarUnavailable = True # no radar
# Use pcmCruise by default; this may be overridden below if a pedal interceptor is detected
ret.pcmCruise = True ret.pcmCruise = True
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_CAM ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_CAM
# Use default minEnableSpeed for ACC models (will be overridden by pedal interceptor section if present)
ret.minEnableSpeed = 5 * CV.KPH_TO_MS ret.minEnableSpeed = 5 * CV.KPH_TO_MS
ret.minSteerSpeed = 10 * CV.KPH_TO_MS ret.minSteerSpeed = 10 * CV.KPH_TO_MS
@@ -249,7 +251,7 @@ class CarInterface(CarInterfaceBase):
# ACC Bolts use pedal for full longitudinal control, not just sng # ACC Bolts use pedal for full longitudinal control, not just sng
ret.flags |= GMFlags.PEDAL_LONG.value ret.flags |= GMFlags.PEDAL_LONG.value
elif candidate == CAR.CHEVROLET_SILVERADO: if candidate == CAR.CHEVROLET_SILVERADO:
# On the Bolt, the ECM and camera independently check that you are either above 5 kph or at a stop # On the Bolt, the ECM and camera independently check that you are either above 5 kph or at a stop
# with foot on brake to allow engagement, but this platform only has that check in the camera. # with foot on brake to allow engagement, but this platform only has that check in the camera.
# TODO: check if this is split by EV/ICE with more platforms in the future # TODO: check if this is split by EV/ICE with more platforms in the future
+36 -19
View File
@@ -38,43 +38,60 @@ class CarControllerParams:
def __init__(self, CP): def __init__(self, CP):
# Gas/brake lookups # Gas/brake lookups
self.ZERO_GAS = 6144 # Coasting self.ZERO_GAS = 6150 # Coasting
self.MAX_BRAKE = 400 # ~ -4.0 m/s^2 with regen self.MAX_BRAKE = 400 # ~ -4.0 m/s^2 with regen
if CP.carFingerprint in CAMERA_ACC_CAR and CP.carFingerprint not in CC_ONLY_CAR and CP.carFingerprint != CAR.CHEVROLET_BOLT_EUV: if CP.carFingerprint in CAMERA_ACC_CAR and CP.carFingerprint not in CC_ONLY_CAR:
self.MAX_GAS = 7496 self.MAX_GAS = 8848
self.MAX_GAS_PLUS = 8848 self.MAX_GAS_PLUS = 8848
self.MAX_ACC_REGEN = 5610 self.MAX_ACC_REGEN = 5610
self.INACTIVE_REGEN = 5650 self.INACTIVE_REGEN = 5650
# Camera ACC vehicles have no regen while enabled. # Camera ACC vehicles have no regen while enabled.
# Camera transitions to MAX_ACC_REGEN from ZERO_GAS and uses friction brakes instantly # Camera transitions to MAX_ACC_REGEN from ZERO_GAS and uses friction brakes instantly
self.max_regen_acceleration = 0. max_regen_acceleration = 0.
self.BRAKE_SWITCH_MAX = self.MAX_ACC_REGEN if CP.carFingerprint in EV_CAR else self.ZERO_GAS
elif CP.carFingerprint in SDGM_CAR: elif CP.carFingerprint in SDGM_CAR:
self.MAX_GAS = 7496 self.MAX_GAS = 7496
self.MAX_GAS_PLUS = 7496 self.MAX_GAS_PLUS = 7496
self.MAX_ACC_REGEN = 7110 self.MAX_ACC_REGEN = 5610
self.INACTIVE_REGEN = 5650 self.INACTIVE_REGEN = 5650
self.max_regen_acceleration = 0. max_regen_acceleration = 0.
self.BRAKE_SWITCH = self.ZERO_GAS
else: else:
self.MAX_GAS = 7168 # Safety limit, not ACC max. Stock ACC >8192 from standstill. self.MAX_GAS = 8191 # Safety limit, not ACC max. Stock ACC >8192 from standstill.
self.MAX_GAS_PLUS = 8191 # 8292 uses new bit, possible but not tested. Matches Twilsonco tw-main max self.MAX_GAS_PLUS = 8191 # 8292 uses new bit, possible but not tested. Matches Twilsonco tw-main max
self.MAX_ACC_REGEN = 7110 # Increased for stronger regen braking self.MAX_ACC_REGEN = 7110 # Max ACC regen is slightly less than max paddle regen
self.INACTIVE_REGEN = 5500 self.INACTIVE_REGEN = 5500
# ICE has much less engine braking force compared to regen in EVs, # ICE has much less engine braking force compared to regen in EVs,
# lower threshold removes some braking deadzone # lower threshold removes some braking deadzone
self.max_regen_acceleration = -3. if CP.carFingerprint in EV_CAR else -0.1 # More aggressive regen for EVs max_regen_acceleration = -3. if CP.carFingerprint in EV_CAR else -0.1
self.BRAKE_SWITCH_MAX = self.MAX_ACC_REGEN if CP.carFingerprint in EV_CAR else self.ZERO_GAS
self.GAS_LOOKUP_BP = [self.max_regen_acceleration, 0., self.ACCEL_MAX] self.GAS_LOOKUP_BP = [max_regen_acceleration, 0., self.ACCEL_MAX]
self.GAS_LOOKUP_BP_PLUS = [self.max_regen_acceleration, 0., self.ACCEL_MAX_PLUS] self.GAS_LOOKUP_BP_PLUS = [max_regen_acceleration, 0., self.ACCEL_MAX_PLUS]
self.GAS_LOOKUP_V = [self.MAX_ACC_REGEN, self.ZERO_GAS, self.MAX_GAS] self.GAS_LOOKUP_V = [self.MAX_ACC_REGEN, self.ZERO_GAS, self.MAX_GAS]
self.GAS_LOOKUP_V_PLUS = [self.MAX_ACC_REGEN, self.ZERO_GAS, self.MAX_GAS_PLUS] self.GAS_LOOKUP_V_PLUS = [self.MAX_ACC_REGEN, self.ZERO_GAS, self.MAX_GAS_PLUS]
self.BRAKE_LOOKUP_BP = [self.ACCEL_MIN, self.max_regen_acceleration] self.BRAKE_LOOKUP_BP = [self.ACCEL_MIN, 0.]
self.BRAKE_LOOKUP_V = [self.MAX_BRAKE, 0.] self.BRAKE_LOOKUP_V = [self.MAX_BRAKE, 0.]
self.BRAKE_SWITCH_LOOKUP_BP = [0.5, 10]
self.BRAKE_SWITCH_LOOKUP_V = [self.ZERO_GAS, self.BRAKE_SWITCH_MAX]
# determined by letting Volt regen to a stop in L gear from 89mph,
# and by letting off gas and allowing car to creep, for determining
# the positive threshold values at very low speed
EV_GAS_BRAKE_THRESHOLD_BP = [1.29, 1.52, 1.55, 1.6, 1.7, 1.8, 2.0, 2.2, 2.5, 5.52, 9.6, 20.5, 23.5, 35.0] # [m/s]
EV_GAS_BRAKE_THRESHOLD_V = [0.0, -0.14, -0.16, -0.18, -0.215, -0.255, -0.32, -0.41, -0.5, -0.72, -0.895, -1.125, -1.145, -1.16] # [m/s^s]
def update_ev_gas_brake_threshold(self, v_ego):
gas_brake_threshold = interp(v_ego, self.EV_GAS_BRAKE_THRESHOLD_BP, self.EV_GAS_BRAKE_THRESHOLD_V)
self.GAS_LOOKUP_BP_PLUS = [self.max_regen_acceleration, 0., self.ACCEL_MAX_PLUS]
self.EV_GAS_LOOKUP_BP = [gas_brake_threshold, max(0., gas_brake_threshold), self.ACCEL_MAX]
self.EV_GAS_LOOKUP_BP_PLUS = [gas_brake_threshold, max(0., gas_brake_threshold), self.ACCEL_MAX_PLUS]
self.EV_BRAKE_LOOKUP_BP = [self.ACCEL_MIN, gas_brake_threshold]
@dataclass @dataclass
class GMCarDocs(CarDocs): class GMCarDocs(CarDocs):
@@ -158,7 +175,7 @@ class CAR(Platforms):
GMCarDocs("Chevrolet Silverado 1500 2020-21", "Safety Package II"), GMCarDocs("Chevrolet Silverado 1500 2020-21", "Safety Package II"),
GMCarDocs("GMC Sierra 1500 2020-21", "Driver Alert Package II", video_link="https://youtu.be/5HbNoBLzRwE"), GMCarDocs("GMC Sierra 1500 2020-21", "Driver Alert Package II", video_link="https://youtu.be/5HbNoBLzRwE"),
], ],
GMCarSpecs(mass=2450, wheelbase=3.75, steerRatio=16.3, tireStiffnessFactor=1.0), GMCarSpecs(mass=2994, wheelbase=3.75, steerRatio=16.3, tireStiffnessFactor=1.0),
) )
CHEVROLET_EQUINOX = GMPlatformConfig( CHEVROLET_EQUINOX = GMPlatformConfig(
[GMCarDocs("Chevrolet Equinox 2019-22")], [GMCarDocs("Chevrolet Equinox 2019-22")],
@@ -194,15 +211,15 @@ class CAR(Platforms):
CHEVROLET_SUBURBAN.specs, CHEVROLET_SUBURBAN.specs,
) )
GMC_YUKON_CC = GMPlatformConfig( GMC_YUKON_CC = GMPlatformConfig(
[GMCarDocs("GMC Yukon No ACC")], [GMCarDocs("GMC Yukon - No-ACC")],
CarSpecs(mass=2541, wheelbase=2.95, steerRatio=16.3, centerToFrontRatio=0.4), CarSpecs(mass=2541, wheelbase=2.95, steerRatio=16.3, centerToFrontRatio=0.4),
) )
CADILLAC_CT6_CC = GMPlatformConfig( CADILLAC_CT6_CC = GMPlatformConfig(
[GMCarDocs("Cadillac CT6 No ACC")], [GMCarDocs("Cadillac CT6 - No-ACC")],
CarSpecs(mass=2358, wheelbase=3.11, steerRatio=17.7, centerToFrontRatio=0.4), CarSpecs(mass=2358, wheelbase=3.11, steerRatio=17.7, centerToFrontRatio=0.4),
) )
CHEVROLET_TRAILBLAZER_CC = GMPlatformConfig( CHEVROLET_TRAILBLAZER_CC = GMPlatformConfig(
[GMCarDocs("Chevrolet Trailblazer 2021-22")], [GMCarDocs("Chevrolet Trailblazer 2021-22 - No-ACC")],
CHEVROLET_TRAILBLAZER.specs, CHEVROLET_TRAILBLAZER.specs,
) )
CADILLAC_XT4 = GMPlatformConfig( CADILLAC_XT4 = GMPlatformConfig(
@@ -210,7 +227,7 @@ class CAR(Platforms):
CarSpecs(mass=1660, wheelbase=2.78, steerRatio=14.4, centerToFrontRatio=0.4), CarSpecs(mass=1660, wheelbase=2.78, steerRatio=14.4, centerToFrontRatio=0.4),
) )
CADILLAC_XT5_CC = GMPlatformConfig( CADILLAC_XT5_CC = GMPlatformConfig(
[GMCarDocs("Cadillac XT5 No ACC")], [GMCarDocs("Cadillac XT5 - No-ACC")],
CarSpecs(mass=1810, wheelbase=2.86, steerRatio=16.34, centerToFrontRatio=0.5), CarSpecs(mass=1810, wheelbase=2.86, steerRatio=16.34, centerToFrontRatio=0.5),
) )
CHEVROLET_TRAVERSE = GMPlatformConfig( CHEVROLET_TRAVERSE = GMPlatformConfig(
@@ -222,7 +239,7 @@ class CAR(Platforms):
CarSpecs(mass=2050, wheelbase=2.86, steerRatio=16.0, centerToFrontRatio=0.5), CarSpecs(mass=2050, wheelbase=2.86, steerRatio=16.0, centerToFrontRatio=0.5),
) )
CHEVROLET_MALIBU_CC = GMPlatformConfig( CHEVROLET_MALIBU_CC = GMPlatformConfig(
[GMCarDocs("Chevrolet Malibu 2023 No ACC")], [GMCarDocs("Chevrolet Malibu 2023 - No-ACC")],
CarSpecs(mass=1450, wheelbase=2.8, steerRatio=15.8, centerToFrontRatio=0.4), CarSpecs(mass=1450, wheelbase=2.8, steerRatio=15.8, centerToFrontRatio=0.4),
) )
CHEVROLET_TRAX = GMPlatformConfig( CHEVROLET_TRAX = GMPlatformConfig(
@@ -313,8 +330,8 @@ FW_QUERY_CONFIG = FwQueryConfig(
EV_CAR = {CAR.CHEVROLET_VOLT, CAR.CHEVROLET_BOLT_EUV, CAR.CHEVROLET_VOLT_CC, CAR.CHEVROLET_BOLT_CC} EV_CAR = {CAR.CHEVROLET_VOLT, CAR.CHEVROLET_BOLT_EUV, CAR.CHEVROLET_VOLT_CC, CAR.CHEVROLET_BOLT_CC}
CC_ONLY_CAR = {CAR.CHEVROLET_VOLT_CC, CAR.CHEVROLET_BOLT_CC, CAR.CHEVROLET_EQUINOX_CC, CAR.CHEVROLET_SUBURBAN_CC, CAR.GMC_YUKON_CC, CAR.CADILLAC_CT6_CC, CAR.CHEVROLET_TRAILBLAZER_CC, CAR.CADILLAC_XT5_CC, CAR.CHEVROLET_MALIBU_CC} CC_ONLY_CAR = {CAR.CHEVROLET_VOLT_CC, CAR.CHEVROLET_BOLT_CC, CAR.CHEVROLET_EQUINOX_CC, CAR.CHEVROLET_SUBURBAN_CC, CAR.GMC_YUKON_CC, CAR.CADILLAC_CT6_CC, CAR.CHEVROLET_TRAILBLAZER_CC, CAR.CADILLAC_XT5_CC, CAR.CHEVROLET_MALIBU_CC}
CC_REGEN_PADDLE_CAR = {CAR.CHEVROLET_BOLT_CC, CAR.CHEVROLET_BOLT_EUV}
# CC_ONLY_CAR = set(c for c in CAR if str(c).endswith('_CC')) # CC_ONLY_CAR = set(c for c in CAR if str(c).endswith('_CC'))
CC_REGEN_PADDLE_CAR = {CAR.CHEVROLET_BOLT_CC, CAR.CHEVROLET_BOLT_EUV}
# We're integrated at the Safety Data Gateway Module on these cars # We're integrated at the Safety Data Gateway Module on these cars
SDGM_CAR = {CAR.CADILLAC_XT4, CAR.CHEVROLET_TRAVERSE, CAR.BUICK_BABYENCLAVE} SDGM_CAR = {CAR.CADILLAC_XT4, CAR.CHEVROLET_TRAVERSE, CAR.BUICK_BABYENCLAVE}
+1 -1
View File
@@ -199,7 +199,7 @@ class Controls:
self.event_names_to_clear = set() self.event_names_to_clear = set()
self.has_menu = self.CP.carName == "gm" and not (self.CP.flags & GMFlags.NO_CAMERA.value or self.CP.carFingerprint in CC_ONLY_CAR) self.has_menu = self.CP.carName == "gm" and not (self.CP.flags & GMFlags.NO_CAMERA.value)
self.frogpilot_AM = AlertManager() self.frogpilot_AM = AlertManager()
self.frogpilot_events = Events(frogpilot=True) self.frogpilot_events = Events(frogpilot=True)
+1 -1
View File
@@ -151,7 +151,7 @@ def laplacian_pdf(x: float, mu: float, b: float):
def match_vision_to_track(v_ego: float, lead: capnp._DynamicStructReader, model_data: capnp._DynamicStructReader, tracks: dict[int, Track], frogpilot_toggles: SimpleNamespace): def match_vision_to_track(v_ego: float, lead: capnp._DynamicStructReader, model_data: capnp._DynamicStructReader, tracks: dict[int, Track], frogpilot_toggles: SimpleNamespace):
if model_data.meta.laneChangeState == LaneChangeState.laneChangeStarting and frogpilot_toggles.human_lane_changes: if model_data.meta.laneChangeState == LaneChangeState.laneChangeStarting and getattr(frogpilot_toggles, "human_lane_changes", False):
direction = model_data.meta.laneChangeDirection direction = model_data.meta.laneChangeDirection
if direction == LaneChangeDirection.left: if direction == LaneChangeDirection.left:
-8
View File
@@ -180,14 +180,6 @@ def manager_init() -> None:
with open(lateral_tuning_migration_flag_file, "w") as f: with open(lateral_tuning_migration_flag_file, "w") as f:
f.write("migrated") f.write("migrated")
# One-time migration for MaxDesiredAcceleration to 4
max_desired_acceleration_migration_flag_file = "/data/media/0/frogpilot_max_desired_acceleration_migrated.flag"
if not os.path.exists(max_desired_acceleration_migration_flag_file):
if params.get_float("MaxDesiredAcceleration") != 4.0:
params.put_float("MaxDesiredAcceleration", 4.0)
with open(max_desired_acceleration_migration_flag_file, "w") as f:
f.write("migrated")
# set dongle id # set dongle id
reg_res = register(show_spinner=True) reg_res = register(show_spinner=True)
if reg_res: if reg_res: