Compare commits

..

52 Commits

Author SHA1 Message Date
firestar5683 d81713bb4e Update carcontroller.py 2025-06-04 20:52:07 -05:00
firestar5683 f043766864 Guard Can Disconnects 2025-06-04 14:12:32 -05:00
firestar5683 a0002ff3e4 Update carcontroller.py 2025-06-04 10:51:09 -05:00
firestar5683 a44a05fe7c Update carcontroller.py 2025-06-03 22:05:06 -05:00
firestar5683 24f122b21e Update carcontroller.py 2025-06-03 00:18:35 -05:00
firestar5683 cf2d09c511 overflow 20ms 2025-06-02 11:13:48 -05:00
firestar5683 98d6ee1d8f 15ms 2025-06-01 00:15:36 -05:00
firestar5683 3b12d08f82 Update carcontroller.py 2025-05-31 13:27:26 -05:00
firestar5683 f3327c9038 Update tinygrad_modeld.py 2025-05-31 12:59:28 -05:00
firestar5683 3a3c8bba99 Drop accumulator 2025-05-30 18:48:27 -05:00
firestar5683 415ceb9da0 Update carcontroller.py 2025-05-30 18:46:33 -05:00
firestar5683 51ca51039e Revert "Update launch_chffrplus.sh"
This reverts commit b4d070fbd58fe245be2ae7e1814589e0cfec1ad3.
2025-05-30 16:54:16 -05:00
firestar5683 40b5fbcd37 Update launch_chffrplus.sh 2025-05-30 16:54:16 -05:00
firestar5683 30d5a96f08 Delete not_vetted 2025-05-30 16:54:16 -05:00
firestar5683 d7a487ad6a 9ms 2025-05-30 16:54:16 -05:00
firestar5683 6b4a2e69ea 8ms guard 2025-05-30 16:54:16 -05:00
firestar5683 7d8187e508 Remove blending 2025-05-30 16:54:16 -05:00
firestar5683 d710061a72 Update carcontroller.py 2025-05-30 16:54:16 -05:00
firestar5683 9252b1589c fix blending 2025-05-30 16:54:16 -05:00
firestar5683 8912469fb0 Paddle Refactor and Smoothing
Paddle Smoothing
Takeoff safety

Co-Authored-By: jc01rho <rkjnice@gmail.com>
2025-05-30 16:54:16 -05:00
firestar5683 bf7d305d0f Update carcontroller.py 2025-05-30 16:54:16 -05:00
FrogAi 2e08378857 agnos 10.1.1 2025-05-30 16:54:16 -05:00
firestar5683 327e08410f Update carcontroller.py 2025-05-30 16:54:16 -05:00
firestar5683 99c3632070 Update carcontroller.py 2025-05-30 16:54:15 -05:00
firestar5683 3e35c2fb7d refactor? 2025-05-30 16:54:15 -05:00
firestar5683 f4d181e08a Update carcontroller.py 2025-05-30 16:54:15 -05:00
firestar5683 d4b422921c More consistent activation/deactivation 2025-05-30 16:54:15 -05:00
firestar5683 deb5322c40 guard off frames. 2025-05-30 16:54:15 -05:00
firestar5683 729ee3cc99 Send more off frames 2025-05-30 16:54:15 -05:00
firestar5683 95ec31a7f9 Madman Logic
Match OEM timing scheme
2025-05-30 16:54:15 -05:00
firestar5683 7db60a6c43 Update carcontroller.py 2025-05-30 16:54:15 -05:00
firestar5683 040220506f Vikander Model
Vikander Model
2025-05-30 16:54:14 -05:00
firestar5683 d732fe98ff Update carcontroller.py 2025-05-20 12:04:24 -05:00
firestar5683 153758c88b Restore Sanity
AHHHHHHH
2025-05-18 13:23:49 -05:00
firestar5683 c065aeba58 Update interface.py 2025-05-12 15:11:34 -05:00
firestar5683 888bff27e5 Update interface.py 2025-05-12 14:21:38 -05:00
firestar5683 a84adbbeac Revert "Update interface.py"
This reverts commit 6b82ff72e6.
2025-05-12 13:24:14 -05:00
firestar5683 6b82ff72e6 Update interface.py
Update interface.py

Update interface.py
2025-05-12 13:24:08 -05:00
firestar5683 2072bd521e Update carcontroller.py 2025-05-08 10:04:39 -05:00
firestar5683 e263bffd80 Revert "Update process_config.py"
This reverts commit c40a3d972c.
2025-05-07 11:16:44 -05:00
firestar5683 48b33a3f9d Update carcontroller.py 2025-05-07 08:20:52 -05:00
firestar5683 c40a3d972c Update process_config.py 2025-05-06 17:18:09 -05:00
firestar5683 d7a3930d42 Paddle
Paddle
2025-05-06 17:04:23 -05:00
firestar5683 6e77a80772 2017 2025-05-06 16:43:37 -05:00
firestar5683 68b97a87db Revert "Reapply "Tomb Raider 6""
This reverts commit f3de8169b9.
2025-05-06 16:32:19 -05:00
firestar5683 9d6211ee7c StarPilot 2025-05-06 16:31:36 -05:00
firestar5683 f3de8169b9 Reapply "Tomb Raider 6" 2025-05-06 16:17:43 -05:00
firestar5683 5095ed9d23 Update carcontroller.py 2025-05-06 16:16:55 -05:00
firestar5683 a11d2958df Logging 2025-04-23 23:15:03 -05:00
firestar5683 30ff869627 TorqueTune/Paddle 2025-04-23 16:19:57 -05:00
FrogAi d01cd48bee Compile FrogPilot 2025-04-20 15:12:33 -07:00
FrogAi 4eefdc3268 Update 2025-04-20 22:00:46 +00:00
91 changed files with 2386 additions and 3290 deletions
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
/data/themes/theme_packs/duck/colors
/data/openpilot/openpilot/frogpilot/assets/holiday_themes/easter_week/colors
+1 -1
View File
@@ -1 +1 @@
/data/themes/theme_packs/frog-animated/distance_icons
/data/openpilot/openpilot/frogpilot/assets/stock_theme/distance_icons
+1 -1
View File
@@ -1 +1 @@
/data/themes/theme_packs/duck/icons
/data/openpilot/openpilot/frogpilot/assets/holiday_themes/easter_week/icons
+1 -1
View File
@@ -1 +1 @@
/data/themes/theme_packs/duck/signals
/data/openpilot/openpilot/frogpilot/assets/holiday_themes/easter_week/signals
+1 -1
View File
@@ -1 +1 @@
/data/themes/theme_packs/duck/sounds
/data/openpilot/openpilot/frogpilot/assets/holiday_themes/easter_week/sounds
@@ -1 +0,0 @@
/data/themes/steering_wheels/pedro.gif
@@ -0,0 +1 @@
/data/openpilot/openpilot/frogpilot/assets/holiday_themes/easter_week/steering_wheel/wheel.png
Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 61 KiB

@@ -1,44 +1,44 @@
{
"LaneLines": {
"red": 76,
"green": 150,
"blue": 255,
"alpha": 255
"red": 23,
"green": 134,
"blue": 68,
"alpha": 242
},
"LeadMarker": {
"red": 76,
"green": 150,
"blue": 255,
"alpha": 255
"red": 23,
"green": 134,
"blue": 68,
"alpha": 242
},
"Path": {
"red": 76,
"green": 150,
"blue": 255,
"alpha": 255
"red": 23,
"green": 134,
"blue": 68,
"alpha": 242
},
"PathEdge": {
"red": 255,
"green": 32,
"blue": 32,
"alpha": 255
"red": 18,
"green": 107,
"blue": 54,
"alpha": 242
},
"Sidebar1": {
"red": 76,
"green": 150,
"blue": 255,
"alpha": 255
"red": 23,
"green": 134,
"blue": 68,
"alpha": 242
},
"Sidebar2": {
"red": 0,
"green": 255,
"blue": 102,
"alpha": 255
"red": 23,
"green": 134,
"blue": 68,
"alpha": 242
},
"Sidebar3": {
"red": 255,
"green": 32,
"blue": 32,
"alpha": 255
"red": 23,
"green": 134,
"blue": 68,
"alpha": 242
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 568 KiB

After

Width:  |  Height:  |  Size: 661 KiB

-1
View File
@@ -139,7 +139,6 @@ def frogpilot_boot_functions(build_metadata, params_cache):
params.put("DongleId", params.get("KonikDongleId", encoding="utf8"))
else:
params.put("KonikDongleId", register(show_spinner=True, register_konik=True))
HARDWARE.reboot()
elif params.get("StockDongleId", encoding="utf8") != None:
params.put("DongleId", params.get("StockDongleId", encoding="utf8"))
+1 -2
View File
@@ -4,7 +4,6 @@ import math
import numpy as np
import requests
import shutil
import signal
import subprocess
import threading
import time
@@ -174,7 +173,7 @@ def restart_processes(sm):
if not any(ps.ignitionLine or ps.ignitionCan for ps in sm["pandaStates"] if ps.pandaType != log.PandaState.PandaType.unknown):
for name in ["mapd", "ui"]:
get_managed_processes()[name].stop(block=True, retry=True, sig=signal.SIGKILL)
get_managed_processes()[name].stop(block=False, retry=False)
def run_cmd(cmd, success_message, fail_message, report=True):
try:
+6 -5
View File
@@ -64,7 +64,7 @@ DEFAULT_TINYGRAD_MODEL_VERSION = "v8"
EXCLUDED_KEYS = {
"AvailableModels", "AvailableModelNames", "CarParamsPersistent", "ExperimentalLongitudinalEnabled",
"ExperimentalModels", "KonikMinutes", "ModelDrivesAndScores", "ModelVersions", "openpilotMinutes",
"ExperimentalModels", "ModelDrivesAndScores", "ModelVersions", "openpilotMinutes",
"SpeedLimits", "UpdaterAvailableBranches"
}
@@ -187,7 +187,6 @@ frogpilot_default_params: list[tuple[str, str | bytes, int]] = [
("IsMetric", "0", 0),
("JerkInfo", "0", 3),
("KonikDongleId", "", 3),
("KonikMinutes", "0", 0),
("LaneChangeCustomizations", "0", 0),
("LaneChangeTime", "2.0", 0),
("LaneDetectionWidth", "0", 2),
@@ -393,8 +392,10 @@ class FrogPilotVariables:
self.frogpilot_toggles.frogs_go_moo = Path("/persist/frogsgomoo.py").is_file()
self.frogpilot_toggles.block_user = self.development_branch and not self.frogpilot_toggles.frogs_go_moo
self.not_vetted = False
self.frogpilot_toggles.use_konik_server = params.get_bool("UseKonikServer")
self.frogpilot_toggles.use_konik_server |= Path("/data/openpilot/not_vetted").is_file()
self.frogpilot_toggles.use_konik_server |= self.not_vetted
if not KONIK_PATH.is_file() and self.frogpilot_toggles.use_konik_server:
KONIK_PATH.touch()
@@ -632,8 +633,8 @@ class FrogPilotVariables:
toggle.device_shutdown_time = (device_shutdown_setting - 3) * 3600 if device_shutdown_setting >= 4 else device_shutdown_setting * (60 * 15)
toggle.increase_thermal_limits = device_management and (params.get_bool("IncreaseThermalLimits") if tuning_level >= level["IncreaseThermalLimits"] else default.get_bool("IncreaseThermalLimits"))
toggle.low_voltage_shutdown = np.clip(params.get_float("LowVoltageShutdown"), VBATT_PAUSE_CHARGING, 12.5) if device_management and tuning_level >= level["LowVoltageShutdown"] else default.get_float("LowVoltageShutdown")
toggle.no_logging = (device_management and (params.get_bool("NoLogging") if tuning_level >= level["NoLogging"] else default.get_bool("NoLogging")) or self.development_branch) and not self.vetting_branch
toggle.no_uploads = (device_management and (params.get_bool("NoUploads") if tuning_level >= level["NoUploads"] else default.get_bool("NoUploads")) or self.development_branch) and not self.vetting_branch
toggle.no_logging = (device_management and (params.get_bool("NoLogging") if tuning_level >= level["NoLogging"] else default.get_bool("NoLogging")) or self.development_branch or self.not_vetted) and not self.vetting_branch
toggle.no_uploads = (device_management and (params.get_bool("NoUploads") if tuning_level >= level["NoUploads"] else default.get_bool("NoUploads")) or self.development_branch or self.not_vetted) and not self.vetting_branch
toggle.no_onroad_uploads = toggle.no_uploads and (params.get_bool("DisableOnroadUploads") if tuning_level >= level["DisableOnroadUploads"] else default.get_bool("DisableOnroadUploads"))
toggle.offline_mode = device_management and (params.get_bool("OfflineMode") if tuning_level >= level["OfflineMode"] else default.get_bool("OfflineMode"))
@@ -77,8 +77,8 @@ class FrogPilotFollowing:
distance_factor = max(lead_distance - (v_ego * self.t_follow), 1)
standstill_offset = max(STOP_DISTANCE - v_ego, 1)
acceleration_offset = float(np.clip((v_lead - v_ego) * standstill_offset - COMFORT_BRAKE, 1, distance_factor))
self.acceleration_jerk /= standstill_offset
self.speed_jerk /= standstill_offset
self.acceleration_jerk /= acceleration_offset
self.speed_jerk /= acceleration_offset
self.t_follow /= acceleration_offset
# Offset by FrogAi for FrogPilot for a more natural approach to a slower lead
Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 402 KiB

@@ -40,7 +40,7 @@
text-align: center;
}
</style>
<title>FrogPilot: {% block title %}{% endblock %}</title>
<title>StarPilot: {% block title %}{% endblock %}</title>
</head>
<body>
<nav class="navbar navbar-fixed-top navbar-expand-sm navbar-dark bg-dark">
Binary file not shown.
+15 -3
View File
@@ -82,6 +82,12 @@ VAL_TABLE_ HandsOffSWDetectionMode 2 "Failed" 1 "Enabled" 0 "Disabled" ;
BO_ 189 EBCMRegenPaddle: 7 K17_EBCM
SG_ RegenPaddle : 7|4@0+ (1,0) [0|0] "" NEO
SG_ Byte1 : 8|8@1+ (1,0) [0|255] "" NEO
SG_ Byte2 : 16|8@1+ (1,0) [0|255] "" NEO
SG_ Byte3 : 24|8@1+ (1,0) [0|255] "" NEO
SG_ Byte4 : 32|8@1+ (1,0) [0|255] "" NEO
SG_ Byte5 : 40|8@1+ (1,0) [0|255] "" NEO
SG_ Byte6 : 48|8@1+ (1,0) [0|255] "" NEO
BO_ 190 ECMAcceleratorPos: 6 K20_ECM
SG_ BrakePedalPos : 15|8@0+ (1,0) [0|0] "sticky" NEO
@@ -192,10 +198,15 @@ BO_ 500 SportMode: 6 XXX
SG_ SportMode : 15|1@0+ (1,0) [0|1] "" XXX
BO_ 501 ECMPRDNL2: 8 K20_ECM
SG_ TransmissionState : 48|4@1+ (1,0) [0|7] "" NEO
SG_ Byte0 : 0|8@1+ (1,0) [0|255] "" NEO
SG_ Byte1 : 8|8@1+ (1,0) [0|255] "" NEO
SG_ Byte2 : 16|8@1+ (1,0) [0|255] "" NEO
SG_ PRNDL2 : 27|4@0+ (1,0) [0|255] "" NEO
SG_ Byte4 : 32|8@1+ (1,0) [0|255] "" NEO
SG_ ManualMode : 41|1@0+ (1,0) [0|1] "" NEO
SG_ TransmissionState : 48|4@1+ (1,0) [0|7] "" NEO
SG_ Byte7 : 56|8@1+ (1,0) [0|255] "" NEO
BO_ 532 BRAKE_RELATED: 6 XXX
SG_ UserBrakePressure : 0|9@0+ (1,0) [0|511] "" XXX
@@ -221,6 +232,7 @@ BO_ 715 ASCMGasRegenCmd: 8 K124_ASCM
SG_ GasRegenFullStopActive : 13|1@0+ (1,0) [0|0] "" NEO
SG_ GasRegenCmdActive : 0|1@0+ (1,0) [0|0] "" NEO
SG_ RollingCounter : 7|2@0+ (1,0) [0|0] "" NEO
SG_ GasRegenAlwaysOne3 : 23|1@0+ (1,0) [0|1] "" NEO
SG_ GasRegenCmd : 8|14@0+ (1,0) [0|0] "" NEO
BO_ 717 ASCM_2CD: 5 K124_ASCM
@@ -369,6 +381,6 @@ VAL_ 715 GasRegenCmdActive 1 "Active" 0 "Inactive" ;
VAL_ 320 Intellibeam 1 "Active" 0 "Inactive" ;
VAL_ 320 HighBeamsActive 1 "Active" 0 "Inactive" ;
VAL_ 320 HighBeamsTemporary 1 "Active" 0 "Inactive" ;
VAL_ 501 PRNDL2 6 "L" 4 "D" 3 "N" 2 "R" 1 "P" 0 "Shifting";
VAL_ 501 PRNDL2 7 "L2" 6 "L" 5 "L3" 4 "D" 3 "N" 2 "R" 1 "P" 0 "Shifting";
VAL_ 501 TransmissionState 11 "Shifting" 10 "Reverse" 9 "Forward" 8 "Disengaged";
VAL_ 501 ManualMode 1 "Active" 0 "Inactive"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 671 KiB

+190 -54
View File
@@ -1,4 +1,4 @@
import math
from typing import Tuple
from cereal import car
from openpilot.common.conversions import Conversions as CV
from openpilot.common.filter_simple import FirstOrderFilter
@@ -8,7 +8,7 @@ from openpilot.common.params_pyx import Params
from opendbc.can.packer import CANPacker
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.values import DBC, CanBus, CarControllerParams, CruiseButtons, GMFlags, CC_ONLY_CAR, SDGM_CAR, EV_CAR, AccState
from openpilot.selfdrive.car.gm.values import DBC, CanBus, CarControllerParams, CruiseButtons, GMFlags, CC_ONLY_CAR, SDGM_CAR, EV_CAR, AccState, CC_REGEN_PADDLE_CAR
from openpilot.selfdrive.car.interfaces import CarControllerBase
from openpilot.selfdrive.controls.lib.drive_helpers import apply_deadzone
from openpilot.selfdrive.controls.lib.vehicle_model import ACCELERATION_DUE_TO_GRAVITY
@@ -23,7 +23,6 @@ TransmissionType = car.CarParams.TransmissionType
CAMERA_CANCEL_DELAY_FRAMES = 10
# Enforce a minimum interval between steering messages to avoid a fault
MIN_STEER_MSG_INTERVAL_MS = 15
# Constants for pitch compensation
PITCH_DEADZONE = 0.01 # [radians] 0.01 ≈ 1% grade
BRAKE_PITCH_FACTOR_BP = [5., 10.] # [m/s] smoothly revert to planned accel at low speeds
@@ -39,6 +38,10 @@ class CarController(CarControllerBase):
self.apply_speed = 0
self.frame = 0
self.last_steer_frame = 0
self.last_steer_ts_ns = 0
self.last_regen_active = False
self.prev_steer_ts_ns = 0
self.last_spoof_ts_ns = 0
self.last_button_frame = 0
self.cancel_counter = 0
self.pedal_steady = 0.
@@ -49,12 +52,6 @@ class CarController(CarControllerBase):
self.params = CarControllerParams(self.CP)
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_obj = CANPacker(DBC[self.CP.carFingerprint]['radar'])
self.packer_ch = CANPacker(DBC[self.CP.carFingerprint]['chassis'])
@@ -62,24 +59,64 @@ class CarController(CarControllerBase):
# FrogPilot variables
self.pitch = FirstOrderFilter(0., 0.09 * 4, DT_CTRL * 4) # runs at 25 Hz
self.accel_g = 0.0
self.regen_paddle_pressed = False
self.aego = 0.0
self.regen_paddle_timer = 0
@staticmethod
def calc_pedal_command(accel: float, long_active: bool, car_velocity) -> float:
if not long_active: return 0.
# Midpoint + overflow spoof accumulator and flags
self.spoof_accum = 0.0
self.spoof_mid_sent = False
self.spoof_over_sent = False
self.last_interval_ns = 0
zero = 0.15625 # 40/256
if accel < -0.5:
pedal_gas = 0
else:
pedaloffset = interp(car_velocity, [0., 3, 6, 30], [0.10, 0.175, 0.240, 0.240])
pedal_gas = clip((pedaloffset + accel * 0.6), 0.0, 1.0)
def calc_pedal_command(self, accel: float, long_active: bool, car_velocity) -> Tuple[float, bool]:
if not long_active:
return 0., False
return pedal_gas
# Regen paddle hysteresis (frame-based): hold 30 frames, with decrement dead-zone
if not hasattr(self, 'regen_paddle_timer'):
self.regen_paddle_timer = 0 # frames
# Regen paddle hysteresis (framebased): count frames when decelerating hard, decrement only when truly released
if self.aego < -0.7:
self.regen_paddle_timer += 1
elif self.aego > -0.3:
self.regen_paddle_timer = max(self.regen_paddle_timer - 1, 0)
# else: hold timer between -0.7 and -0.3
# Base paddle press hysteresis
self.regen_paddle_pressed = self.regen_paddle_timer >= 20 # 30 frames
press_regen_paddle = self.regen_paddle_pressed
# Regen gain ratios from bin-averaged 600 deceleration sweep; Calculates stronger decel from paddle
speed_mps = [0.559, 1.678, 2.797, 3.916, 5.035, 6.154, 7.273, 8.392, 9.511, 10.63,
11.749, 12.868, 13.987, 15.106, 16.225, 17.344, 18.463, 19.582, 20.701, 21.820,
22.939, 24.058, 25.177, 26.296]
regen_gain_ratio = [1.01, 1.01, 1.02, 1.05, 1.08, 1.345979, 1.369975,
1.376302, 1.388052, 1.370367, 1.388498, 1.386030, 1.405950, 1.387555,
1.390392, 1.394946, 1.414915, 1.428535, 1.439611, 1.440106, 1.441438,
1.439395, 1.446909, 1.445738]
gain = interp(car_velocity, speed_mps, regen_gain_ratio)
pedaloffset = interp(car_velocity, [0., 3, 6, 30], [0.10, 0.175, 0.240, 0.240])
# Compute raw pedal gas
raw_pedal_gas = clip((pedaloffset + (accel / gain) * 0.6), 0.0, 1.0) if press_regen_paddle else clip((pedaloffset + accel * 0.6), 0.0, 1.0)
# --- Immediate application of raw pedal gas, no blending ---
pedal_gas = raw_pedal_gas
# Safety cap: ramp from 22% at 0 m/s to 37.25% at 10 mph (4.47 m/s), then allow full throttleAdd commentMore actions
pedal_gas_max = interp(car_velocity, [0.0, 4.47, 4.48], [0.22, 0.3725, 1.0])
pedal_gas = clip(pedal_gas, 0.0, pedal_gas_max)
return pedal_gas, press_regen_paddle
def update(self, CC, CS, now_nanos, frogpilot_toggles):
self.CS = CS
self.aego = CS.out.aEgo
actuators = CC.actuators
accel = brake_accel = actuators.accel
press_regen_paddle = False
hud_control = CC.hudControl
hud_alert = hud_control.visualAlert
hud_v_cruise = hud_control.setSpeed
@@ -88,6 +125,98 @@ class CarController(CarControllerBase):
# Send CAN commands.
can_sends = []
paddle_sends = []
raw_regen_active = (
self.CP.carFingerprint in CC_REGEN_PADDLE_CAR and
self.CP.openpilotLongitudinalControl and
CC.longActive and
self.CP.enableGasInterceptor and
self.regen_paddle_timer >= 20 # raw hysteresis-only
)
regen_active = raw_regen_active
# === Spoof scheduling: midpoint + overflow (~40Hz) ===
# Implement 1s hold-off after CAN reconnect
# Detect reconnect: loopback_lka_steering_cmd_ts_nanos == 0 and self.last_steer_ts_ns != 0
if CS.loopback_lka_steering_cmd_ts_nanos == 0 and self.last_steer_ts_ns != 0:
self.loopback_holdoff_until = now_nanos + 1_000_000_000
# Remove holdoff if expired
if hasattr(self, "loopback_holdoff_until") and now_nanos >= self.loopback_holdoff_until:
del self.loopback_holdoff_until
# Rising-edge reset on regen start
if raw_regen_active and not self.last_regen_active:
self.prev_steer_ts_ns = self.last_steer_ts_ns
self.last_spoof_ts_ns = 0
self.spoof_accum = 0.0
self.spoof_mid_sent = False
self.spoof_over_sent = False
if raw_regen_active:
# Interval between last two bus-0 steer sends
interval_ns = self.last_steer_ts_ns - self.prev_steer_ts_ns
# New steer interval? clear per-interval flags
if interval_ns != self.last_interval_ns:
self.spoof_mid_sent = False
self.spoof_over_sent = False
self.last_interval_ns = interval_ns
# Accumulate extra spoofs needed above 33Hz base to reach 40Hz
self.spoof_accum += (40.0/33.0 - 1.0)
# 500ms holdoff after reconnect: skip spoof scheduling if active
skip_spoof = hasattr(self, "loopback_holdoff_until") and now_nanos < self.loopback_holdoff_until
# Midpoint spoof: one per interval; avoid sending if loopback stale
if not skip_spoof and not self.spoof_mid_sent and interval_ns > 0:
midpoint_ns = self.prev_steer_ts_ns + interval_ns // 2
if (CS.loopback_lka_steering_cmd_ts_nanos != 0 and
now_nanos - CS.loopback_lka_steering_cmd_ts_nanos < 10_000_000 and
now_nanos >= midpoint_ns and
now_nanos - self.last_steer_ts_ns >= 26_000_000):
paddle_sends.append(gmcan.create_prndl2_command(self.packer_pt, CanBus.POWERTRAIN, True))
paddle_sends.append(gmcan.create_regen_paddle_command(self.packer_pt, CanBus.POWERTRAIN, True))
self.last_spoof_ts_ns = now_nanos
self.spoof_mid_sent = True
# Overflow spoof: insert extra when accumulator allows
if not skip_spoof and self.spoof_accum >= 0.5 and not self.spoof_over_sent and interval_ns > 0:
slot2_ns = self.prev_steer_ts_ns + (interval_ns * 2) // 3
if (CS.loopback_lka_steering_cmd_ts_nanos != 0 and
now_nanos - CS.loopback_lka_steering_cmd_ts_nanos < 10_000_000 and
now_nanos >= slot2_ns and
now_nanos - self.last_steer_ts_ns >= 28_000_000):
paddle_sends.append(gmcan.create_prndl2_command(self.packer_pt, CanBus.POWERTRAIN, True))
paddle_sends.append(gmcan.create_regen_paddle_command(self.packer_pt, CanBus.POWERTRAIN, True))
self.last_spoof_ts_ns = now_nanos
self.spoof_over_sent = True
self.spoof_accum -= 0.5
# === End Spoof scheduling ===
# === Off-pulse scheduling on regen release ===
if not raw_regen_active and self.last_regen_active:
# schedule two off-slots at 1/3 and 2/3 of the last steer interval
if self.prev_steer_ts_ns and self.last_steer_ts_ns:
intv = self.last_steer_ts_ns - self.prev_steer_ts_ns
self.off_schedule_ns = [
self.prev_steer_ts_ns + intv // 3,
self.prev_steer_ts_ns + (2 * intv) // 3
]
self.off_sent = [False, False]
if hasattr(self, "off_schedule_ns"):
for i, t_ns in enumerate(self.off_schedule_ns):
if not self.off_sent[i] and now_nanos >= t_ns and now_nanos - self.last_steer_ts_ns >= 18_000_000:
paddle_sends.append(gmcan.create_prndl2_command(self.packer_pt, CanBus.POWERTRAIN, False))
paddle_sends.append(gmcan.create_regen_paddle_command(self.packer_pt, CanBus.POWERTRAIN, False))
self.off_sent[i] = True
# clean up once both off pulses are sent
if hasattr(self, "off_sent") and all(self.off_sent):
del self.off_schedule_ns
del self.off_sent
# === End off-pulse scheduling ===
# Steering (Active: 50Hz, inactive: 10Hz)
steer_step = self.params.STEER_STEP if CC.latActive else self.params.INACTIVE_STEER_STEP
@@ -117,16 +246,37 @@ class CarController(CarControllerBase):
else:
apply_steer = 0
# shift previous steer timestamp
self.prev_steer_ts_ns = self.last_steer_ts_ns
self.last_steer_ts_ns = now_nanos
self.last_steer_frame = self.frame
self.apply_steer_last = apply_steer
idx = self.lka_steering_cmd_counter % 4
can_sends.append(gmcan.create_steering_control(self.packer_pt, CanBus.POWERTRAIN, apply_steer, idx, CC.latActive))
# Update regen_active state and last_regen_paddle_pressed for next loop
self.last_regen_active = regen_active
self.last_regen_paddle_pressed = self.regen_paddle_pressed
# Merge paddle spoof CAN frames, time-guarded only
if paddle_sends:
# wait at least 15 ms after the last bus0 steer send
if now_nanos - self.last_steer_ts_ns >= 15_000_000:
can_sends.extend(paddle_sends)
if self.CP.openpilotLongitudinalControl:
# Gas/regen, brakes, and UI commands - all at 25Hz
if self.frame % 4 == 0:
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
near_stop = CC.longActive and (CS.out.vEgo < self.params.NEAR_STOP_BRAKE_PHASE)
interceptor_gas_cmd = 0
@@ -138,43 +288,32 @@ class CarController(CarControllerBase):
self.apply_gas = self.params.INACTIVE_REGEN
self.apply_brake = int(min(-100 * self.CP.stopAccel, self.params.MAX_BRAKE))
else:
if len(CC.orientationNED) == 3 and CS.out.vEgo > self.CP.vEgoStopping:
accel_due_to_pitch = math.sin(CC.orientationNED[1]) * ACCELERATION_DUE_TO_GRAVITY
# Normal operation
if self.CP.carFingerprint in EV_CAR:
if frogpilot_toggles.sport_plus:
self.apply_gas = int(round(interp(accel, self.params.GAS_LOOKUP_BP_PLUS, self.params.GAS_LOOKUP_V_PLUS)))
else:
self.apply_gas = int(round(interp(accel, self.params.GAS_LOOKUP_BP, self.params.GAS_LOOKUP_V)))
self.apply_brake = int(round(interp(brake_accel, self.params.BRAKE_LOOKUP_BP, self.params.BRAKE_LOOKUP_V)))
else:
accel_due_to_pitch = 0.0
if frogpilot_toggles.sport_plus:
gas_max = self.params.MAX_GAS_PLUS
accel_max = self.params.ACCEL_MAX_PLUS
else:
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)))
if self.apply_brake > 0:
self.apply_gas = self.params.INACTIVE_REGEN
if frogpilot_toggles.sport_plus:
self.apply_gas = int(round(interp(accel, self.params.GAS_LOOKUP_BP_PLUS, self.params.GAS_LOOKUP_V_PLUS)))
else:
self.apply_gas = int(round(interp(accel, self.params.GAS_LOOKUP_BP, self.params.GAS_LOOKUP_V)))
self.apply_brake = int(round(interp(brake_accel, self.params.BRAKE_LOOKUP_BP, self.params.BRAKE_LOOKUP_V)))
# Don't allow any gas above inactive regen while stopping
# FIXME: brakes aren't applied immediately when enabling at a stop
if stopping:
self.apply_gas = self.params.INACTIVE_REGEN
if self.CP.carFingerprint in CC_ONLY_CAR:
# gas interceptor only used for full long control on cars without ACC
interceptor_gas_cmd = self.calc_pedal_command(actuators.accel, CC.longActive, CS.out.vEgo)
interceptor_gas_cmd, press_regen_paddle = self.calc_pedal_command(actuators.accel, CC.longActive, CS.out.vEgo)
if self.CP.enableGasInterceptor and self.apply_gas > self.params.INACTIVE_REGEN and CS.out.cruiseState.standstill:
# "Tap" the accelerator pedal to re-engage ACC
interceptor_gas_cmd = self.params.SNG_INTERCEPTOR_GAS
self.apply_brake = 0
press_regen_paddle = False
self.apply_gas = self.params.INACTIVE_REGEN
idx = (self.frame // 4) % 4
@@ -205,33 +344,30 @@ class CarController(CarControllerBase):
# GasRegenCmdActive needs to be 1 to avoid cruise faults. It describes the ACC state, not actuation
can_sends.append(gmcan.create_gas_regen_command(self.packer_pt, CanBus.POWERTRAIN, self.apply_gas, idx, acc_engaged, at_full_stop))
can_sends.append(gmcan.create_friction_brake_command(self.packer_ch, friction_brake_bus, self.apply_brake,
idx, CC.enabled, near_stop, at_full_stop, self.CP))
idx, CC.enabled, near_stop, at_full_stop, self.CP))
# Send dashboard UI commands (ACC status)
send_fcw = hud_alert == VisualAlert.fcw
can_sends.append(gmcan.create_acc_dashboard_command(self.packer_pt, CanBus.POWERTRAIN, CC.enabled,
if self.frame % 10 == 5:
can_sends.append(gmcan.create_acc_dashboard_command(self.packer_pt, CanBus.POWERTRAIN, CC.enabled,
hud_v_cruise * CV.MS_TO_KPH, hud_control, send_fcw))
else:
# to keep accel steady for logs when not sending gas
accel += self.accel_g
# Radar needs to know current speed and yaw rate (50hz),
# and that ADAS is alive (10hz)
# and that ADAS is alive (5hz, previously 10hz)
if not self.CP.radarUnavailable:
tt = self.frame * DT_CTRL
time_and_headlights_step = 10
time_and_headlights_step = 20
if self.frame % time_and_headlights_step == 0:
idx = (self.frame // time_and_headlights_step) % 4
can_sends.append(gmcan.create_adas_time_status(CanBus.OBSTACLE, int((tt - self.start_time) * 60), idx))
can_sends.append(gmcan.create_adas_headlights_status(self.packer_obj, CanBus.OBSTACLE))
speed_and_accelerometer_step = 2
if self.frame % speed_and_accelerometer_step == 0:
idx = (self.frame // speed_and_accelerometer_step) % 4
can_sends.append(gmcan.create_adas_steering_status(CanBus.OBSTACLE, idx))
can_sends.append(gmcan.create_adas_accelerometer_speed_status(CanBus.OBSTACLE, CS.out.vEgo, idx))
if self.CP.networkLocation == NetworkLocation.gateway and self.frame % self.params.ADAS_KEEPALIVE_STEP == 0:
if self.CP.networkLocation == NetworkLocation.gateway and self.frame % (self.params.ADAS_KEEPALIVE_STEP * 2) == 0:
can_sends += gmcan.create_adas_keepalive(CanBus.POWERTRAIN)
# TODO: integrate this with the code block below?
@@ -259,7 +395,7 @@ class CarController(CarControllerBase):
if self.CP.networkLocation == NetworkLocation.fwdCamera:
# Silence "Take Steering" alert sent by camera, forward PSCMStatus with HandsOffSWlDetectionStatus=1
if self.frame % 10 == 0:
if self.frame % 20 == 0:
can_sends.append(gmcan.create_pscm_status(self.packer_pt, CanBus.CAMERA, CS.pscm_status))
new_actuators = actuators.as_builder()
+9 -5
View File
@@ -56,6 +56,10 @@ class CarState(CarStateBase):
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)
self.prndl2_ts_nanos = pt_cp.ts_nanos["ECMPRDNL2"]["PRNDL2"]
self.regen_paddle_ts_nanos = pt_cp.ts_nanos["EBCMRegenPaddle"]["RegenPaddle"]
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.cam_lka_steering_cmd_counter = cam_cp.vl["ASCMLKASteeringCmd"]["RollingCounter"]
@@ -95,13 +99,13 @@ class CarState(CarStateBase):
self.single_pedal_mode = (
ret.gearShifter == GearShifter.low
or pt_cp.vl["EVDriveMode"]["SinglePedalModeActive"] == 1
or pt_cp.vl["ECMPRDNL2"]["TransmissionState"] == 21
or (ret.regenBraking and GearShifter.manumatic)
or self.CP.carFingerprint in ["CHEVROLET_BOLT_EUV", "CHEVROLET_BOLT_CC"]
)
if self.CP.enableGasInterceptor:
ret.gas = (pt_cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + pt_cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) / 2.
threshold = 12 if self.CP.carFingerprint in CAMERA_ACC_CAR else 4 # Panda 515 threshold = 10.88. Set lower to avoid panda blocking messages and GasInterceptor faulting.
threshold = 12 if self.CP.carFingerprint in CAMERA_ACC_CAR else 4 # Panda 595 threshold = 10.88. Set lower to avoid panda blocking messages and GasInterceptor faulting.
ret.gasPressed = ret.gas > threshold
else:
ret.gas = pt_cp.vl["AcceleratorPedal2"]["AcceleratorPedal2"] / 254.
@@ -174,7 +178,7 @@ class CarState(CarStateBase):
ret.leftBlindspot = cam_cp.vl["BCMBlindSpotMonitor"]["LeftBSM"] == 1
ret.rightBlindspot = cam_cp.vl["BCMBlindSpotMonitor"]["RightBSM"] == 1
# FrogPilot CarState functions
self.lkas_previously_enabled = self.lkas_enabled
if self.CP.carFingerprint in SDGM_CAR:
self.lkas_enabled = cam_cp.vl["ASCMSteeringButton"]["LKAButton"]
@@ -235,7 +239,7 @@ class CarState(CarStateBase):
]
else:
messages += [
("ECMPRDNL2", 10),
("ECMPRDNL2", 40),
("AcceleratorPedal2", 33),
("ECMEngineStatus", 100),
("BCMTurnSignals", 1),
@@ -257,7 +261,7 @@ class CarState(CarStateBase):
if CP.transmissionType == TransmissionType.direct:
messages += [
("EBCMRegenPaddle", 50),
("EBCMRegenPaddle", 40),
("EVDriveMode", 0),
]
+28
View File
@@ -66,6 +66,7 @@ def create_gas_regen_command(packer, bus, throttle, idx, enabled, at_full_stop):
"GasRegenFullStopActive": at_full_stop,
"GasRegenAlwaysOne": 1,
"GasRegenAlwaysOne2": 1,
"GasRegenAlwaysOne3": 1,
}
dat = packer.make_can_msg("ASCMGasRegenCmd", bus, values)[2]
@@ -176,6 +177,33 @@ def create_lka_icon_command(bus, active, critical, steer):
dat = b"\x00\x00\x00"
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):
regen_paddle_value = 2 if press_regen_paddle else 0
values = {
"RegenPaddle": regen_paddle_value,
"Byte1": 0,
"Byte2": 0,
"Byte3": 0,
"Byte4": 0,
"Byte5": 0,
"Byte6": 0
}
return packer.make_can_msg("EBCMRegenPaddle", bus, values)
def create_gm_cc_spam_command(packer, controller, CS, actuators):
if controller.params_.get_bool("IsMetric"):
+17 -20
View File
@@ -29,10 +29,10 @@ CAM_MSG = 0x320 # AEBCmd
ACCELERATOR_POS_MSG = 0xbe
NON_LINEAR_TORQUE_PARAMS = {
CAR.CHEVROLET_BOLT_EUV: [2.6531724862969748, 1.0, 0.1919764879840985, 0.009054123646805178],
CAR.CHEVROLET_BOLT_CC: [2.6531724862969748, 1.0, 0.1919764879840985, 0.009054123646805178],
CAR.GMC_ACADIA: [4.78003305, 1.0, 0.3122, 0.05591772],
CAR.CHEVROLET_SILVERADO: [3.29974374, 1.0, 0.25571356, 0.0465122]
CAR.CHEVROLET_BOLT_EUV: {"left": [2.15, 1.0, 0.17, -0.04], "right": [2.15, 1.0, 0.21, -0.04]},
CAR.CHEVROLET_BOLT_CC: {"left": [2.15, 1.0, 0.17, -0.04], "right": [2.15, 1.0, 0.21, -0.04]},
CAR.GMC_ACADIA: {"left": [4.78, 1.0, 0.31, 0.05], "right": [4.78, 1.0, 0.31, 0.05]},
CAR.CHEVROLET_SILVERADO: {"left": [3.30, 1.0, 0.25, 0.05], "right": [3.30, 1.0, 0.25, 0.05]}
}
NEURAL_PARAMS_PATH = os.path.join(BASEDIR, 'selfdrive/car/torque_data/neural_ff_weights.json')
@@ -74,8 +74,12 @@ class CarInterface(CarInterfaceBase):
# ToDo: To generalize to other GMs, explore tanh function as the nonlinear
non_linear_torque_params = NON_LINEAR_TORQUE_PARAMS.get(self.CP.carFingerprint)
assert non_linear_torque_params, "The params are not defined"
a, b, c, _ = non_linear_torque_params
steer_torque = (sig(latcontrol_inputs.lateral_acceleration * a) * b) + (latcontrol_inputs.lateral_acceleration * c)
if latcontrol_inputs.lateral_acceleration >= 0:
params = non_linear_torque_params["right"]
else:
params = non_linear_torque_params["left"]
a, b, c, d = params
steer_torque = (sig(latcontrol_inputs.lateral_acceleration * a) * b) + (latcontrol_inputs.lateral_acceleration * c) + d
return float(steer_torque) + friction
def torque_from_lateral_accel_neural(self, latcontrol_inputs: LatControlInputs, torque_params: car.CarParams.LateralTorqueTuning, lateral_accel_error: float,
@@ -87,13 +91,7 @@ class CarInterface(CarInterfaceBase):
return float(self.neural_ff_model.predict(inputs)) + friction
def torque_from_lateral_accel(self) -> TorqueFromLateralAccelCallbackType:
if self.CP.carFingerprint in (CAR.CHEVROLET_BOLT_EUV, CAR.CHEVROLET_BOLT_CC):
self.neural_ff_model = NanoFFModel(NEURAL_PARAMS_PATH, self.CP.carFingerprint)
return self.torque_from_lateral_accel_neural
elif self.CP.carFingerprint in NON_LINEAR_TORQUE_PARAMS:
return self.torque_from_lateral_accel_siglin
else:
return self.torque_from_lateral_accel_linear
@staticmethod
def _get_params(ret, candidate, fingerprint, car_fw, experimental_long, docs, frogpilot_toggles):
@@ -124,14 +122,13 @@ class CarInterface(CarInterfaceBase):
ret.minSteerSpeed = 10 * CV.KPH_TO_MS
# Tuning for experimental long
ret.longitudinalTuning.kiV = [0.5, 0.5, 0.5]
ret.longitudinalTuning.kiV = [2.0, 1.5]
ret.vEgoStopping = 0.1
ret.vEgoStarting = 0.1
ret.stoppingDecelRate = 1.0 # reach brake quickly after enabling
ret.stoppingDecelRate = 2.0 # reach brake quickly after enabling
ret.vEgoStopping = 0.25
ret.vEgoStarting = 0.25
ret.stopAccel = -0.25
if experimental_long:
ret.pcmCruise = False
@@ -139,7 +136,7 @@ class CarInterface(CarInterfaceBase):
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_HW_CAM_LONG
elif candidate in SDGM_CAR:
ret.longitudinalTuning.kiV = [0., 0., 0.] # TODO: tuning
ret.longitudinalTuning.kiV = [0., 0.] # TODO: tuning
ret.experimentalLongitudinalAvailable = False
ret.networkLocation = NetworkLocation.fwdCamera
ret.pcmCruise = True
@@ -158,7 +155,7 @@ class CarInterface(CarInterfaceBase):
ret.minSteerSpeed = 7 * CV.MPH_TO_MS
# Tuning
ret.longitudinalTuning.kiV = [0.5, 0.5, 0.5]
ret.longitudinalTuning.kiV = [2.4, 1.5]
if ret.enableGasInterceptor:
# Need to set ASCM long limits when using pedal interceptor, instead of camera ACC long limits
@@ -209,7 +206,7 @@ class CarInterface(CarInterfaceBase):
elif candidate in (CAR.CHEVROLET_BOLT_EUV, CAR.CHEVROLET_BOLT_CC):
ret.steerActuatorDelay = 0.2
CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning)
ret.lateralTuning.torque.kp = 0.6
ret.lateralTuning.torque.kp = 0.4
if ret.enableGasInterceptor:
# ACC Bolts use pedal for full longitudinal control, not just sng
@@ -275,7 +272,7 @@ class CarInterface(CarInterfaceBase):
ret.stoppingControl = True
ret.autoResumeSng = True
if candidate in CC_ONLY_CAR: #pedal interceptor tuning
if candidate in CC_ONLY_CAR:
ret.flags |= GMFlags.PEDAL_LONG.value
ret.safetyConfigs[0].safetyParam |= Panda.FLAG_GM_PEDAL_LONG
# Note: Low speed, stop and go not tested. Should be fairly smooth on highway
@@ -298,7 +295,7 @@ class CarInterface(CarInterfaceBase):
ret.openpilotLongitudinalControl = not params.get_bool("DisableOpenpilotLongitudinal")
ret.pcmCruise = False
if not ret.enableGasInterceptor and candidate in CC_ONLY_CAR: #redneck tuning
if not ret.enableGasInterceptor and candidate in CC_ONLY_CAR:
ret.longitudinalTuning.kpBP = [10.7, 10.8, 28.] # 10.7 m/s == 24 mph
ret.longitudinalTuning.kpV = [0., 20., 20.] # set lower end to 0 since we can't drive below that speed
ret.longitudinalTuning.deadzoneBP = [0.]
+18 -34
View File
@@ -11,13 +11,13 @@ Ecu = car.CarParams.Ecu
class CarControllerParams:
STEER_MAX = 300 # GM limit is 3Nm. Used by carcontroller to generate LKA output
STEER_MAX = 450 # GM limit is 3Nm. Used by carcontroller to generate LKA output
STEER_STEP = 3 # Active control frames per command (~33hz)
INACTIVE_STEER_STEP = 10 # Inactive control frames per command (10hz)
STEER_DELTA_UP = 10 # Delta rates require review due to observed EPS weakness
STEER_DELTA_DOWN = 15
STEER_DRIVER_ALLOWANCE = 65
STEER_DRIVER_MULTIPLIER = 4
STEER_DELTA_UP = 15 # Delta rates require review due to observed EPS weakness
STEER_DELTA_DOWN = 34
STEER_DRIVER_ALLOWANCE = 78
STEER_DRIVER_MULTIPLIER = 6
STEER_DRIVER_FACTOR = 100
NEAR_STOP_BRAKE_PHASE = 0.25 # m/s
SNG_INTERCEPTOR_GAS = 18. / 255.
@@ -38,10 +38,10 @@ class CarControllerParams:
def __init__(self, CP):
# Gas/brake lookups
self.ZERO_GAS = 6150 # Coasting
self.ZERO_GAS = 6144 # Coasting
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:
if CP.carFingerprint in CAMERA_ACC_CAR and CP.carFingerprint not in CC_ONLY_CAR and CP.carFingerprint != CAR.CHEVROLET_BOLT_EUV:
self.MAX_GAS = 7496
self.MAX_GAS_PLUS = 8848
self.MAX_ACC_REGEN = 5610
@@ -49,49 +49,32 @@ class CarControllerParams:
# Camera ACC vehicles have no regen while enabled.
# Camera transitions to MAX_ACC_REGEN from ZERO_GAS and uses friction brakes instantly
self.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:
self.MAX_GAS = 7496
self.MAX_GAS_PLUS = 7496
self.MAX_ACC_REGEN = 5610
self.MAX_ACC_REGEN = 7110
self.INACTIVE_REGEN = 5650
self.max_regen_acceleration = 0.
self.BRAKE_SWITCH = self.ZERO_GAS
else:
self.MAX_GAS = 7168 # 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_ACC_REGEN = 5500 # Max ACC regen is slightly less than max paddle regen
self.MAX_ACC_REGEN = 7110 # Increased for stronger regen braking
self.INACTIVE_REGEN = 5500
# ICE has much less engine braking force compared to regen in EVs,
# lower threshold removes some braking deadzone
self.max_regen_acceleration = -1. 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.max_regen_acceleration = -3. if CP.carFingerprint in EV_CAR else -0.1 # More aggressive regen for EVs
self.GAS_LOOKUP_BP = [self.max_regen_acceleration, 0., self.ACCEL_MAX]
self.GAS_LOOKUP_BP_PLUS = [self.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_PLUS = [self.MAX_ACC_REGEN, self.ZERO_GAS, self.MAX_GAS_PLUS]
self.BRAKE_LOOKUP_BP = [self.ACCEL_MIN, 0.]
self.BRAKE_LOOKUP_BP = [self.ACCEL_MIN, self.max_regen_acceleration]
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
class GMCarDocs(CarDocs):
@@ -175,7 +158,7 @@ class CAR(Platforms):
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"),
],
GMCarSpecs(mass=2994, wheelbase=3.75, steerRatio=16.3, tireStiffnessFactor=1.0),
GMCarSpecs(mass=2450, wheelbase=3.75, steerRatio=16.3, tireStiffnessFactor=1.0),
)
CHEVROLET_EQUINOX = GMPlatformConfig(
[GMCarDocs("Chevrolet Equinox 2019-22")],
@@ -211,15 +194,15 @@ class CAR(Platforms):
CHEVROLET_SUBURBAN.specs,
)
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),
)
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),
)
CHEVROLET_TRAILBLAZER_CC = GMPlatformConfig(
[GMCarDocs("Chevrolet Trailblazer 2021-22 - No-ACC")],
[GMCarDocs("Chevrolet Trailblazer 2021-22")],
CHEVROLET_TRAILBLAZER.specs,
)
CADILLAC_XT4 = GMPlatformConfig(
@@ -227,7 +210,7 @@ class CAR(Platforms):
CarSpecs(mass=1660, wheelbase=2.78, steerRatio=14.4, centerToFrontRatio=0.4),
)
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),
)
CHEVROLET_TRAVERSE = GMPlatformConfig(
@@ -239,7 +222,7 @@ class CAR(Platforms):
CarSpecs(mass=2050, wheelbase=2.86, steerRatio=16.0, centerToFrontRatio=0.5),
)
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),
)
CHEVROLET_TRAX = GMPlatformConfig(
@@ -328,6 +311,7 @@ FW_QUERY_CONFIG = FwQueryConfig(
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_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'))
# We're integrated at the Safety Data Gateway Module on these cars
+1 -1
View File
@@ -412,7 +412,7 @@ class CarInterfaceBase(ABC):
tune.init('torque')
tune.torque.useSteeringAngle = use_steering_angle
tune.torque.kp = 1.0
tune.torque.kp = 0.4
tune.torque.kf = 1.0
tune.torque.ki = 0.1
tune.torque.friction = params['FRICTION']
+1 -1
View File
@@ -5,7 +5,7 @@ from openpilot.selfdrive.car.interfaces import CarInterfaceBase
# mocked car interface for dashcam mode
class CarInterface(CarInterfaceBase):
def __init__(self, CP, FPCP, CarController, CarState):
def __init__(self, CP, CarController, CarState):
super().__init__(CP, CarController, CarState)
self.speed = 0.
+1 -1
View File
@@ -43,7 +43,7 @@ legend = ["LAT_ACCEL_FACTOR", "MAX_LAT_ACCEL_MEASURED", "FRICTION"]
"CADILLAC_ESCALADE" = [1.899999976158142, 1.842270016670227, 0.1120000034570694]
"CADILLAC_ESCALADE_ESV_2019" = [1.15, 1.3, 0.2]
"CADILLAC_XT4" = [1.45, 1.6, 0.2]
"CHEVROLET_BOLT_EUV" = [2.0, 2.0, 0.05]
"CHEVROLET_BOLT_EUV" = [3.0, 2.0, 0.11]
"CHEVROLET_MALIBU_CC" = [1.85, 1.85, 0.075]
"CHEVROLET_SILVERADO" = [1.9, 1.9, 0.112]
"CHEVROLET_TRAILBLAZER" = [1.33, 1.9, 0.16]
+1 -1
View File
@@ -170,7 +170,7 @@ class CarInterface(CarInterfaceBase):
*create_button_events(self.CS.cruise_decreased, self.CS.cruise_decreased_previously, {1: ButtonType.decelCruise}),
*create_button_events(self.CS.cruise_increased, self.CS.cruise_increased_previously, {1: ButtonType.accelCruise}),
*create_button_events(self.CS.distance_button, self.CS.prev_distance_button, {1: ButtonType.gapAdjustCruise}),
*create_button_events(self.CS.lkas_enabled != self.CS.lkas_previously_enabled, False, {1: FrogPilotButtonType.lkas}),
*create_button_events(self.CS.lkas_enabled, self.CS.lkas_previously_enabled, {1: FrogPilotButtonType.lkas}),
]
# events
+9 -1
View File
@@ -32,7 +32,7 @@ from openpilot.selfdrive.controls.lib.vehicle_model import VehicleModel
from openpilot.system.hardware import HARDWARE
from openpilot.frogpilot.common.frogpilot_variables import get_frogpilot_toggles, params_memory
from openpilot.frogpilot.common.frogpilot_variables import ERROR_LOGS_PATH, get_frogpilot_toggles, params_memory
from openpilot.frogpilot.controls.lib.frogpilot_acceleration import get_max_allowed_accel
SOFT_DISABLE_TIME = 3 # seconds
@@ -199,6 +199,8 @@ class Controls:
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.error_log = ERROR_LOGS_PATH / "error.txt"
def set_initial_state(self):
if REPLAY:
controls_state = self.params.get("ReplayControlsState")
@@ -429,6 +431,12 @@ class Controls:
if self.frogpilot_toggles.block_user:
self.events.add(EventName.blockUser, static=True)
if self.error_log.is_file():
if self.frogpilot_toggles.random_events:
self.events.add(EventName.openpilotCrashedRandomEvent)
else:
self.events.add(EventName.openpilotCrashed)
def data_sample(self):
"""Receive data from sockets"""
+2 -2
View File
@@ -87,7 +87,7 @@ class DesireHelper:
if torque_applied:
self.lane_change_wait_timer = frogpilot_toggles.lane_change_delay
torque_applied |= frogpilot_toggles.nudgeless and lane_available and self.lane_change_wait_timer >= frogpilot_toggles.lane_change_delay
torque_applied |= frogpilot_toggles.nudgeless
blindspot_detected = ((carstate.leftBlindspot and self.lane_change_direction == LaneChangeDirection.left) or
(carstate.rightBlindspot and self.lane_change_direction == LaneChangeDirection.right))
@@ -95,7 +95,7 @@ class DesireHelper:
if not one_blinker or below_lane_change_speed or self.lane_change_completed:
self.lane_change_state = LaneChangeState.off
self.lane_change_direction = LaneChangeDirection.none
elif torque_applied and not blindspot_detected:
elif torque_applied and not blindspot_detected and lane_available and self.lane_change_wait_timer >= frogpilot_toggles.lane_change_delay:
self.lane_change_state = LaneChangeState.laneChangeStarting
self.lane_change_completed = frogpilot_toggles.one_lane_change
self.lane_change_wait_timer = 0.0
-1
View File
@@ -353,7 +353,6 @@ def holiday_alert(CP: car.CarParams, CS: car.CarState, sm: messaging.SubMaster,
"world_frog_day": "Happy World Frog Day! 🐸",
"april_fools": "Happy April Fool's Day! 🤡",
"easter_week": "Happy Easter! 🐰",
"may_the_fourth": "May the 4th be with you! 🚀",
"cinco_de_mayo": "¡Feliz Cinco de Mayo! 🌮",
"fourth_of_july": "Happy Fourth of July! 🎆",
"halloween_week": "Happy Halloween! 🎃",
@@ -1,538 +0,0 @@
{
"acados_include_path": "/data/openpilot/third_party/acados/include",
"acados_lib_path": "/data/openpilot/third_party/acados/lib",
"code_export_directory": "/data/openpilot/selfdrive/controls/lib/lateral_mpc_lib/c_generated_code",
"constraints": {
"C": [],
"C_e": [],
"D": [],
"constr_type": "BGH",
"constr_type_e": "BGH",
"idxbu": [],
"idxbx": [
2,
3
],
"idxbx_0": [
0,
1,
2,
3
],
"idxbx_e": [],
"idxbxe_0": [
0,
1,
2,
3
],
"idxsbu": [],
"idxsbx": [],
"idxsbx_e": [],
"idxsg": [],
"idxsg_e": [],
"idxsh": [],
"idxsh_e": [],
"idxsphi": [],
"idxsphi_e": [],
"lbu": [],
"lbx": [
-1.5707963267948966,
-0.8726646259971648
],
"lbx_0": [
0.0,
0.0,
0.0,
0.0
],
"lbx_e": [],
"lg": [],
"lg_e": [],
"lh": [],
"lh_e": [],
"lphi": [],
"lphi_e": [],
"lsbu": [],
"lsbx": [],
"lsbx_e": [],
"lsg": [],
"lsg_e": [],
"lsh": [],
"lsh_e": [],
"lsphi": [],
"lsphi_e": [],
"ubu": [],
"ubx": [
1.5707963267948966,
0.8726646259971648
],
"ubx_0": [
0.0,
0.0,
0.0,
0.0
],
"ubx_e": [],
"ug": [],
"ug_e": [],
"uh": [],
"uh_e": [],
"uphi": [],
"uphi_e": [],
"usbu": [],
"usbx": [],
"usbx_e": [],
"usg": [],
"usg_e": [],
"ush": [],
"ush_e": [],
"usphi": [],
"usphi_e": []
},
"cost": {
"Vu": [],
"Vu_0": [],
"Vx": [],
"Vx_0": [],
"Vx_e": [],
"Vz": [],
"Vz_0": [],
"W": [
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
]
],
"W_0": [
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
]
],
"W_e": [
[
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0
]
],
"Zl": [],
"Zl_e": [],
"Zu": [],
"Zu_e": [],
"cost_ext_fun_type": "casadi",
"cost_ext_fun_type_0": "casadi",
"cost_ext_fun_type_e": "casadi",
"cost_type": "NONLINEAR_LS",
"cost_type_0": "NONLINEAR_LS",
"cost_type_e": "NONLINEAR_LS",
"yref": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"yref_0": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"yref_e": [
0.0,
0.0,
0.0
],
"zl": [],
"zl_e": [],
"zu": [],
"zu_e": []
},
"cython_include_dirs": [
"/usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/core/include",
"/usr/local/pyenv/versions/3.11.4/include/python3.11"
],
"dims": {
"N": 32,
"nbu": 0,
"nbx": 2,
"nbx_0": 4,
"nbx_e": 0,
"nbxe_0": 4,
"ng": 0,
"ng_e": 0,
"nh": 0,
"nh_e": 0,
"np": 2,
"nphi": 0,
"nphi_e": 0,
"nr": 0,
"nr_e": 0,
"ns": 0,
"ns_e": 0,
"nsbu": 0,
"nsbx": 0,
"nsbx_e": 0,
"nsg": 0,
"nsg_e": 0,
"nsh": 0,
"nsh_e": 0,
"nsphi": 0,
"nsphi_e": 0,
"nu": 1,
"nx": 4,
"ny": 5,
"ny_0": 5,
"ny_e": 3,
"nz": 0
},
"json_file": "/data/openpilot/selfdrive/controls/lib/lateral_mpc_lib/acados_ocp_lat.json",
"model": {
"con_h_expr": null,
"con_h_expr_e": null,
"con_phi_expr": null,
"con_phi_expr_e": null,
"con_r_expr": null,
"con_r_expr_e": null,
"con_r_in_phi": null,
"con_r_in_phi_e": null,
"cost_conl_custom_outer_hess": null,
"cost_conl_custom_outer_hess_0": null,
"cost_conl_custom_outer_hess_e": null,
"cost_expr_ext_cost": null,
"cost_expr_ext_cost_0": null,
"cost_expr_ext_cost_custom_hess": null,
"cost_expr_ext_cost_custom_hess_0": null,
"cost_expr_ext_cost_custom_hess_e": null,
"cost_expr_ext_cost_e": null,
"cost_psi_expr": null,
"cost_psi_expr_0": null,
"cost_psi_expr_e": null,
"cost_r_in_psi_expr": null,
"cost_r_in_psi_expr_0": null,
"cost_r_in_psi_expr_e": null,
"cost_y_expr": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegjaaaaaaaaaaaaaaafaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaajhpffghgpgegdaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgkaaaaaaaegpcaaaaaaaaaaaaaahaaaaaaaahdhjgpffghgpgegdaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaamaaaaaaaahdhjgpfchbgehfgpffghgpgegdaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaaahdhjgpfbgdgdgfgmgpffghgpgegeaaaaaaaaaaaaaaachjaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaachcaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaachkjjjjjjjjjjjjlpd",
"cost_y_expr_0": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegjaaaaaaaaaaaaaaafaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaajhpffghgpgegdaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgkaaaaaaaegpcaaaaaaaaaaaaaahaaaaaaaahdhjgpffghgpgegdaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaamaaaaaaaahdhjgpfchbgehfgpffghgpgegdaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaaahdhjgpfbgdgdgfgmgpffghgpgegeaaaaaaaaaaaaaaachjaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaachcaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaachkjjjjjjjjjjjjlpd",
"cost_y_expr_e": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaeghaaaaaaaaaaaaaaadaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaajhpffghgpgegdaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgkaaaaaaaegpcaaaaaaaaaaaaaahaaaaaaaahdhjgpffghgpgegdaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaamaaaaaaaahdhjgpfchbgehfgpffghgpg",
"disc_dyn_expr": null,
"dyn_disc_fun": null,
"dyn_disc_fun_jac": null,
"dyn_disc_fun_jac_hess": null,
"dyn_ext_fun_type": "casadi",
"dyn_generic_source": null,
"f_expl_expr": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegiaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegoaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaahaaaaaaaahdhjgpffghgpgegdaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaapaaaaaaachpgehbgehjgpgogpfchbgegjgfhdhegnaaaaaaaaaaaaaaachcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaamaaaaaaaahdhjgpfchbgehfgpffghgpgegbaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaachbaaaaaaaaaaaaaaaegnaaaaaaaaaaaaaaachcaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaachfaaaaaaaaaaaaaaaegoaaaaaaaaaaaaaaachcaaaaaaaaaaaaaaachiaaaaaaaaaaaaaaachiaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaaahdhjgpfbgdgdgfgmgpffghgpg",
"f_impl_expr": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegiaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaajaaaaaaaihpffghgpgpfegpgehegcaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegoaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaahaaaaaaaahdhjgpffghgpgegdaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaapaaaaaaachpgehbgehjgpgogpfchbgegjgfhdhegnaaaaaaaaaaaaaaachdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaamaaaaaaaahdhjgpfchbgehfgpffghgpgegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaajaaaaaaajhpffghgpgpfegpgehegbaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaachcaaaaaaaaaaaaaaaegnaaaaaaaaaaaaaaachdaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaachgaaaaaaaaaaaaaaaegoaaaaaaaaaaaaaaachdaaaaaaaaaaaaaaachjaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaalaaaaaaaahdhjgpffghgpgpfegpgehchjaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaaabaaaaaaahdhjgpfchbgehfgpffghgpgpfegpgehegpcaaaaaaaaaaaaaanaaaaaaaahdhjgpfbgdgdgfgmgpffghgpg",
"gnsf": {
"nontrivial_f_LO": 1,
"purely_linear": 0
},
"name": "lat",
"p": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaeggaaaaaaaaaaaaaaacaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaacaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegpcaaaaaaaaaaaaaapaaaaaaachpgehbgehjgpgogpfchbgegjgfhdh",
"u": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegfaaaaaaaaaaaaaaabaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaaahdhjgpfbgdgdgfgmgpffghgpg",
"x": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegiaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegpcaaaaaaaaaaaaaafaaaaaaajhpffghgpgegpcaaaaaaaaaaaaaahaaaaaaaahdhjgpffghgpgegpcaaaaaaaaaaaaaamaaaaaaaahdhjgpfchbgehfgpffghgpg",
"xdot": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegiaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaajaaaaaaaihpffghgpgpfegpgehegpcaaaaaaaaaaaaaajaaaaaaajhpffghgpgpfegpgehegpcaaaaaaaaaaaaaalaaaaaaaahdhjgpffghgpgpfegpgehegpcaaaaaaaaaaaaaaabaaaaaaahdhjgpfchbgehfgpffghgpgpfegpgeh",
"z": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
},
"parameter_values": [
0.0,
0.0
],
"problem_class": "OCP",
"shared_lib_ext": ".so",
"solver_options": {
"Tsim": 0.009765625,
"alpha_min": 0.05,
"alpha_reduction": 0.7,
"collocation_type": "GAUSS_LEGENDRE",
"custom_templates": [],
"custom_update_copy": true,
"custom_update_filename": "",
"custom_update_header_filename": "",
"eps_sufficient_descent": 0.0001,
"exact_hess_constr": 1,
"exact_hess_cost": 1,
"exact_hess_dyn": 1,
"ext_cost_num_hess": 0,
"ext_fun_compile_flags": "-O2",
"full_step_dual": 0,
"globalization": "FIXED_STEP",
"globalization_use_SOC": 0,
"hessian_approx": "GAUSS_NEWTON",
"hpipm_mode": "BALANCE",
"initialize_t_slacks": 0,
"integrator_type": "ERK",
"levenberg_marquardt": 0.0,
"line_search_use_sufficient_descent": 0,
"model_external_shared_lib_dir": null,
"model_external_shared_lib_name": null,
"nlp_solver_ext_qp_res": 0,
"nlp_solver_max_iter": 100,
"nlp_solver_step_length": 1.0,
"nlp_solver_tol_comp": 1e-06,
"nlp_solver_tol_eq": 1e-06,
"nlp_solver_tol_ineq": 1e-06,
"nlp_solver_tol_stat": 1e-06,
"nlp_solver_type": "SQP_RTI",
"print_level": 0,
"qp_solver": "PARTIAL_CONDENSING_HPIPM",
"qp_solver_cond_N": 1,
"qp_solver_cond_ric_alg": 1,
"qp_solver_iter_max": 1,
"qp_solver_ric_alg": 1,
"qp_solver_tol_comp": null,
"qp_solver_tol_eq": null,
"qp_solver_tol_ineq": null,
"qp_solver_tol_stat": null,
"qp_solver_warm_start": 0,
"regularize_method": null,
"shooting_nodes": [
0.0,
0.009765625,
0.0390625,
0.087890625,
0.15625,
0.244140625,
0.3515625,
0.478515625,
0.625,
0.791015625,
0.9765625,
1.181640625,
1.40625,
1.650390625,
1.9140625,
2.197265625,
2.5,
2.822265625,
3.1640625,
3.525390625,
3.90625,
4.306640625,
4.7265625,
5.166015625,
5.625,
6.103515625,
6.6015625,
7.119140625,
7.65625,
8.212890625,
8.7890625,
9.384765625,
10.0
],
"sim_method_jac_reuse": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"sim_method_newton_iter": 3,
"sim_method_newton_tol": 0.0,
"sim_method_num_stages": [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4
],
"sim_method_num_steps": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
],
"tf": 10.0,
"time_steps": [
0.009765625,
0.029296875,
0.048828125,
0.068359375,
0.087890625,
0.107421875,
0.126953125,
0.146484375,
0.166015625,
0.185546875,
0.205078125,
0.224609375,
0.244140625,
0.263671875,
0.283203125,
0.302734375,
0.322265625,
0.341796875,
0.361328125,
0.380859375,
0.400390625,
0.419921875,
0.439453125,
0.458984375,
0.478515625,
0.498046875,
0.517578125,
0.537109375,
0.556640625,
0.576171875,
0.595703125,
0.615234375
]
}
}
+1 -2
View File
@@ -92,11 +92,10 @@ class LongControl:
self.CP = CP
self.long_control_state = LongCtrlState.off
self.experimental_mode = False
pos_p_limit = 0.0
self.pid = PIDController((CP.longitudinalTuning.kpBP, CP.longitudinalTuning.kpV),
(CP.longitudinalTuning.kiBP, CP.longitudinalTuning.kiV),
k_f=CP.longitudinalTuning.kf, rate=1 / DT_CTRL,
pos_p_limit=pos_p_limit)
pos_p_limit=None)
self.v_pid = 0.0
self._mode_setup()
self.last_output_accel = 0.0
@@ -1,524 +0,0 @@
{
"acados_include_path": "/data/openpilot/third_party/acados/include",
"acados_lib_path": "/data/openpilot/third_party/acados/lib",
"code_export_directory": "/data/openpilot/selfdrive/controls/lib/longitudinal_mpc_lib/c_generated_code",
"constraints": {
"C": [],
"C_e": [],
"D": [],
"constr_type": "BGH",
"constr_type_e": "BGH",
"idxbu": [],
"idxbx": [],
"idxbx_0": [
0,
1,
2
],
"idxbx_e": [],
"idxbxe_0": [
0,
1,
2
],
"idxsbu": [],
"idxsbx": [],
"idxsbx_e": [],
"idxsg": [],
"idxsg_e": [],
"idxsh": [
0,
1,
2,
3
],
"idxsh_e": [],
"idxsphi": [],
"idxsphi_e": [],
"lbu": [],
"lbx": [],
"lbx_0": [
0.0,
0.0,
0.0
],
"lbx_e": [],
"lg": [],
"lg_e": [],
"lh": [
0.0,
0.0,
0.0,
0.0
],
"lh_e": [],
"lphi": [],
"lphi_e": [],
"lsbu": [],
"lsbx": [],
"lsbx_e": [],
"lsg": [],
"lsg_e": [],
"lsh": [
0.0,
0.0,
0.0,
0.0
],
"lsh_e": [],
"lsphi": [],
"lsphi_e": [],
"ubu": [],
"ubx": [],
"ubx_0": [
0.0,
0.0,
0.0
],
"ubx_e": [],
"ug": [],
"ug_e": [],
"uh": [
10000.0,
10000.0,
10000.0,
10000.0
],
"uh_e": [],
"uphi": [],
"uphi_e": [],
"usbu": [],
"usbx": [],
"usbx_e": [],
"usg": [],
"usg_e": [],
"ush": [
0.0,
0.0,
0.0,
0.0
],
"ush_e": [],
"usphi": [],
"usphi_e": []
},
"cost": {
"Vu": [],
"Vu_0": [],
"Vx": [],
"Vx_0": [],
"Vx_e": [],
"Vz": [],
"Vz_0": [],
"W": [
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
]
],
"W_0": [
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
]
],
"W_e": [
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
],
[
0.0,
0.0,
0.0,
0.0,
0.0
]
],
"Zl": [
0.0,
0.0,
0.0,
0.0
],
"Zl_e": [],
"Zu": [
0.0,
0.0,
0.0,
0.0
],
"Zu_e": [],
"cost_ext_fun_type": "casadi",
"cost_ext_fun_type_0": "casadi",
"cost_ext_fun_type_e": "casadi",
"cost_type": "NONLINEAR_LS",
"cost_type_0": "NONLINEAR_LS",
"cost_type_e": "NONLINEAR_LS",
"yref": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"yref_0": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"yref_e": [
0.0,
0.0,
0.0,
0.0,
0.0
],
"zl": [
0.0,
0.0,
0.0,
0.0
],
"zl_e": [],
"zu": [
0.0,
0.0,
0.0,
0.0
],
"zu_e": []
},
"cython_include_dirs": [
"/usr/local/pyenv/versions/3.11.4/lib/python3.11/site-packages/numpy/core/include",
"/usr/local/pyenv/versions/3.11.4/include/python3.11"
],
"dims": {
"N": 12,
"nbu": 0,
"nbx": 0,
"nbx_0": 3,
"nbx_e": 0,
"nbxe_0": 3,
"ng": 0,
"ng_e": 0,
"nh": 4,
"nh_e": 0,
"np": 6,
"nphi": 0,
"nphi_e": 0,
"nr": 0,
"nr_e": 0,
"ns": 4,
"ns_e": 0,
"nsbu": 0,
"nsbx": 0,
"nsbx_e": 0,
"nsg": 0,
"nsg_e": 0,
"nsh": 4,
"nsh_e": 0,
"nsphi": 0,
"nsphi_e": 0,
"nu": 1,
"nx": 3,
"ny": 6,
"ny_0": 6,
"ny_e": 5,
"nz": 0
},
"json_file": "/data/openpilot/selfdrive/controls/lib/longitudinal_mpc_lib/acados_ocp_long.json",
"model": {
"con_h_expr": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegiaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegpcaaaaaaaaaaaaaafaaaaaaabgpfngjgogegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpfngbgihchcaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaacbaaaaaamgfgbgegpfegbgoghgfgchpfggbgdgehpgchegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaachbaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhchbaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajggaaaaaaaegbaaaaaaaaaaaaaaachbaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaa",
"con_h_expr_e": null,
"con_phi_expr": null,
"con_phi_expr_e": null,
"con_r_expr": null,
"con_r_expr_e": null,
"con_r_in_phi": null,
"con_r_in_phi_e": null,
"cost_conl_custom_outer_hess": null,
"cost_conl_custom_outer_hess_0": null,
"cost_conl_custom_outer_hess_e": null,
"cost_expr_ext_cost": null,
"cost_expr_ext_cost_0": null,
"cost_expr_ext_cost_custom_hess": null,
"cost_expr_ext_cost_custom_hess_0": null,
"cost_expr_ext_cost_custom_hess_e": null,
"cost_expr_ext_cost_e": null,
"cost_psi_expr": null,
"cost_psi_expr_0": null,
"cost_psi_expr_e": null,
"cost_r_in_psi_expr": null,
"cost_r_in_psi_expr_0": null,
"cost_r_in_psi_expr_e": null,
"cost_y_expr": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegkaaaaaaaaaaaaaaagaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhcheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajggaaaaaaaegbaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaachcaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegcaaaaaaaaaaaaaaachbbaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaagaaaaaaaahchfgghpfbgegpcaaaaaaaaaaaaaafaaaaaaakgpffghgpg",
"cost_y_expr_0": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegkaaaaaaaaaaaaaaagaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhcheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajggaaaaaaaegbaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaachcaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegcaaaaaaaaaaaaaaachbbaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaagaaaaaaaahchfgghpfbgegpcaaaaaaaaaaaaaafaaaaaaakgpffghgpg",
"cost_y_expr_e": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegjaaaaaaaaaaaaaaafaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegbaaaaaaaaaaaaaaaegbaaaaaaaaaaaaaaaegeaaaaaaaaaaaaaaaeglaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegmcaaaaaaaaaaaaaajgfaaaaaaaegdaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhcheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajggaaaaaaaegbaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegmcaaaaaaaaaaaaaajgkaaaaaaachcaaaaaaaaaaaaaaacheaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegcaaaaaaaaaaaaaaachbbaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaagaaaaaaaahchfgghpfbg",
"disc_dyn_expr": null,
"dyn_disc_fun": null,
"dyn_disc_fun_jac": null,
"dyn_disc_fun_jac_hess": null,
"dyn_ext_fun_type": "casadi",
"dyn_generic_source": null,
"f_expl_expr": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaeghaaaaaaaaaaaaaaadaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegpcaaaaaaaaaaaaaafaaaaaaakgpffghgpg",
"f_impl_expr": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaeghaaaaaaaaaaaaaaadaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaajaaaaaaaihpffghgpgpfegpgehegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaajaaaaaaaghpffghgpgpfegpgehegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpgegcaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaajaaaaaaabgpffghgpgpfegpgehegpcaaaaaaaaaaaaaafaaaaaaakgpffghgpg",
"gnsf": {
"nontrivial_f_LO": 1,
"purely_linear": 0
},
"name": "long",
"p": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegkaaaaaaaaaaaaaaagaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaeaaaaaaaaaaaaaaafaaaaaaaaaaaaaaagaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaabgpfngjgogegpcaaaaaaaaaaaaaafaaaaaaabgpfngbgihegpcaaaaaaaaaaaaaakaaaaaaaihpfpgcgdhehbgdgmgfgegpcaaaaaaaaaaaaaagaaaaaaaahchfgghpfbgegpcaaaaaaaaaaaaaanaaaaaaamgfgbgegpfehpfggpgmgmgpghhegpcaaaaaaaaaaaaaacbaaaaaamgfgbgegpfegbgoghgfgchpfggbgdgehpgch",
"u": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegfaaaaaaaaaaaaaaabaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaakgpffghgpg",
"x": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaeghaaaaaaaaaaaaaaadaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaafaaaaaaaihpffghgpgegpcaaaaaaaaaaaaaafaaaaaaaghpffghgpgegpcaaaaaaaaaaaaaafaaaaaaabgpffghgpg",
"xdot": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaeghaaaaaaaaaaaaaaadaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaacaaaaaaaaaaaaaaadaaaaaaaaaaaaaaaegpcaaaaaaaaaaaaaajaaaaaaaihpffghgpgpfegpgehegpcaaaaaaaaaaaaaajaaaaaaaghpffghgpgpfegpgehegpcaaaaaaaaaaaaaajaaaaaaabgpffghgpgpfegpgeh",
"z": "jhpnnagiieahaaaadaaaaaaaaaaaaaaaaaegdaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
},
"parameter_values": [
-1.2,
1.2,
0.0,
0.0,
1.45,
0.75
],
"problem_class": "OCP",
"shared_lib_ext": ".so",
"solver_options": {
"Tsim": 0.06944444444444445,
"alpha_min": 0.05,
"alpha_reduction": 0.7,
"collocation_type": "GAUSS_LEGENDRE",
"custom_templates": [],
"custom_update_copy": true,
"custom_update_filename": "",
"custom_update_header_filename": "",
"eps_sufficient_descent": 0.0001,
"exact_hess_constr": 1,
"exact_hess_cost": 1,
"exact_hess_dyn": 1,
"ext_cost_num_hess": 0,
"ext_fun_compile_flags": "-O2",
"full_step_dual": 0,
"globalization": "FIXED_STEP",
"globalization_use_SOC": 0,
"hessian_approx": "GAUSS_NEWTON",
"hpipm_mode": "BALANCE",
"initialize_t_slacks": 0,
"integrator_type": "ERK",
"levenberg_marquardt": 0.0,
"line_search_use_sufficient_descent": 0,
"model_external_shared_lib_dir": null,
"model_external_shared_lib_name": null,
"nlp_solver_ext_qp_res": 0,
"nlp_solver_max_iter": 100,
"nlp_solver_step_length": 1.0,
"nlp_solver_tol_comp": 1e-06,
"nlp_solver_tol_eq": 1e-06,
"nlp_solver_tol_ineq": 1e-06,
"nlp_solver_tol_stat": 1e-06,
"nlp_solver_type": "SQP_RTI",
"print_level": 0,
"qp_solver": "PARTIAL_CONDENSING_HPIPM",
"qp_solver_cond_N": 1,
"qp_solver_cond_ric_alg": 1,
"qp_solver_iter_max": 10,
"qp_solver_ric_alg": 1,
"qp_solver_tol_comp": 0.001,
"qp_solver_tol_eq": 0.001,
"qp_solver_tol_ineq": 0.001,
"qp_solver_tol_stat": 0.001,
"qp_solver_warm_start": 0,
"regularize_method": null,
"shooting_nodes": [
0.0,
0.06944444444444445,
0.2777777777777778,
0.625,
1.1111111111111112,
1.7361111111111114,
2.5,
3.4027777777777786,
4.444444444444445,
5.625,
6.9444444444444455,
8.402777777777777,
10.0
],
"sim_method_jac_reuse": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"sim_method_newton_iter": 3,
"sim_method_newton_tol": 0.0,
"sim_method_num_stages": [
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4,
4
],
"sim_method_num_steps": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
],
"tf": 10.0,
"time_steps": [
0.06944444444444445,
0.20833333333333334,
0.3472222222222222,
0.48611111111111116,
0.6250000000000002,
0.7638888888888886,
0.9027777777777786,
1.041666666666666,
1.1805555555555554,
1.3194444444444455,
1.4583333333333313,
1.5972222222222232
]
}
}
Binary file not shown.
+342 -342
View File
@@ -45,326 +45,326 @@ const static double MAHA_THRESH_31 = 3.8414588206941227;
* *
* This file is part of 'ekf' *
******************************************************************************/
void err_fun(double *nom_x, double *delta_x, double *out_5662147043452870344) {
out_5662147043452870344[0] = delta_x[0] + nom_x[0];
out_5662147043452870344[1] = delta_x[1] + nom_x[1];
out_5662147043452870344[2] = delta_x[2] + nom_x[2];
out_5662147043452870344[3] = delta_x[3] + nom_x[3];
out_5662147043452870344[4] = delta_x[4] + nom_x[4];
out_5662147043452870344[5] = delta_x[5] + nom_x[5];
out_5662147043452870344[6] = delta_x[6] + nom_x[6];
out_5662147043452870344[7] = delta_x[7] + nom_x[7];
out_5662147043452870344[8] = delta_x[8] + nom_x[8];
void err_fun(double *nom_x, double *delta_x, double *out_2366717911037962719) {
out_2366717911037962719[0] = delta_x[0] + nom_x[0];
out_2366717911037962719[1] = delta_x[1] + nom_x[1];
out_2366717911037962719[2] = delta_x[2] + nom_x[2];
out_2366717911037962719[3] = delta_x[3] + nom_x[3];
out_2366717911037962719[4] = delta_x[4] + nom_x[4];
out_2366717911037962719[5] = delta_x[5] + nom_x[5];
out_2366717911037962719[6] = delta_x[6] + nom_x[6];
out_2366717911037962719[7] = delta_x[7] + nom_x[7];
out_2366717911037962719[8] = delta_x[8] + nom_x[8];
}
void inv_err_fun(double *nom_x, double *true_x, double *out_2016113788005242335) {
out_2016113788005242335[0] = -nom_x[0] + true_x[0];
out_2016113788005242335[1] = -nom_x[1] + true_x[1];
out_2016113788005242335[2] = -nom_x[2] + true_x[2];
out_2016113788005242335[3] = -nom_x[3] + true_x[3];
out_2016113788005242335[4] = -nom_x[4] + true_x[4];
out_2016113788005242335[5] = -nom_x[5] + true_x[5];
out_2016113788005242335[6] = -nom_x[6] + true_x[6];
out_2016113788005242335[7] = -nom_x[7] + true_x[7];
out_2016113788005242335[8] = -nom_x[8] + true_x[8];
void inv_err_fun(double *nom_x, double *true_x, double *out_70336108065318295) {
out_70336108065318295[0] = -nom_x[0] + true_x[0];
out_70336108065318295[1] = -nom_x[1] + true_x[1];
out_70336108065318295[2] = -nom_x[2] + true_x[2];
out_70336108065318295[3] = -nom_x[3] + true_x[3];
out_70336108065318295[4] = -nom_x[4] + true_x[4];
out_70336108065318295[5] = -nom_x[5] + true_x[5];
out_70336108065318295[6] = -nom_x[6] + true_x[6];
out_70336108065318295[7] = -nom_x[7] + true_x[7];
out_70336108065318295[8] = -nom_x[8] + true_x[8];
}
void H_mod_fun(double *state, double *out_8997301641043644665) {
out_8997301641043644665[0] = 1.0;
out_8997301641043644665[1] = 0;
out_8997301641043644665[2] = 0;
out_8997301641043644665[3] = 0;
out_8997301641043644665[4] = 0;
out_8997301641043644665[5] = 0;
out_8997301641043644665[6] = 0;
out_8997301641043644665[7] = 0;
out_8997301641043644665[8] = 0;
out_8997301641043644665[9] = 0;
out_8997301641043644665[10] = 1.0;
out_8997301641043644665[11] = 0;
out_8997301641043644665[12] = 0;
out_8997301641043644665[13] = 0;
out_8997301641043644665[14] = 0;
out_8997301641043644665[15] = 0;
out_8997301641043644665[16] = 0;
out_8997301641043644665[17] = 0;
out_8997301641043644665[18] = 0;
out_8997301641043644665[19] = 0;
out_8997301641043644665[20] = 1.0;
out_8997301641043644665[21] = 0;
out_8997301641043644665[22] = 0;
out_8997301641043644665[23] = 0;
out_8997301641043644665[24] = 0;
out_8997301641043644665[25] = 0;
out_8997301641043644665[26] = 0;
out_8997301641043644665[27] = 0;
out_8997301641043644665[28] = 0;
out_8997301641043644665[29] = 0;
out_8997301641043644665[30] = 1.0;
out_8997301641043644665[31] = 0;
out_8997301641043644665[32] = 0;
out_8997301641043644665[33] = 0;
out_8997301641043644665[34] = 0;
out_8997301641043644665[35] = 0;
out_8997301641043644665[36] = 0;
out_8997301641043644665[37] = 0;
out_8997301641043644665[38] = 0;
out_8997301641043644665[39] = 0;
out_8997301641043644665[40] = 1.0;
out_8997301641043644665[41] = 0;
out_8997301641043644665[42] = 0;
out_8997301641043644665[43] = 0;
out_8997301641043644665[44] = 0;
out_8997301641043644665[45] = 0;
out_8997301641043644665[46] = 0;
out_8997301641043644665[47] = 0;
out_8997301641043644665[48] = 0;
out_8997301641043644665[49] = 0;
out_8997301641043644665[50] = 1.0;
out_8997301641043644665[51] = 0;
out_8997301641043644665[52] = 0;
out_8997301641043644665[53] = 0;
out_8997301641043644665[54] = 0;
out_8997301641043644665[55] = 0;
out_8997301641043644665[56] = 0;
out_8997301641043644665[57] = 0;
out_8997301641043644665[58] = 0;
out_8997301641043644665[59] = 0;
out_8997301641043644665[60] = 1.0;
out_8997301641043644665[61] = 0;
out_8997301641043644665[62] = 0;
out_8997301641043644665[63] = 0;
out_8997301641043644665[64] = 0;
out_8997301641043644665[65] = 0;
out_8997301641043644665[66] = 0;
out_8997301641043644665[67] = 0;
out_8997301641043644665[68] = 0;
out_8997301641043644665[69] = 0;
out_8997301641043644665[70] = 1.0;
out_8997301641043644665[71] = 0;
out_8997301641043644665[72] = 0;
out_8997301641043644665[73] = 0;
out_8997301641043644665[74] = 0;
out_8997301641043644665[75] = 0;
out_8997301641043644665[76] = 0;
out_8997301641043644665[77] = 0;
out_8997301641043644665[78] = 0;
out_8997301641043644665[79] = 0;
out_8997301641043644665[80] = 1.0;
void H_mod_fun(double *state, double *out_281700328218384173) {
out_281700328218384173[0] = 1.0;
out_281700328218384173[1] = 0;
out_281700328218384173[2] = 0;
out_281700328218384173[3] = 0;
out_281700328218384173[4] = 0;
out_281700328218384173[5] = 0;
out_281700328218384173[6] = 0;
out_281700328218384173[7] = 0;
out_281700328218384173[8] = 0;
out_281700328218384173[9] = 0;
out_281700328218384173[10] = 1.0;
out_281700328218384173[11] = 0;
out_281700328218384173[12] = 0;
out_281700328218384173[13] = 0;
out_281700328218384173[14] = 0;
out_281700328218384173[15] = 0;
out_281700328218384173[16] = 0;
out_281700328218384173[17] = 0;
out_281700328218384173[18] = 0;
out_281700328218384173[19] = 0;
out_281700328218384173[20] = 1.0;
out_281700328218384173[21] = 0;
out_281700328218384173[22] = 0;
out_281700328218384173[23] = 0;
out_281700328218384173[24] = 0;
out_281700328218384173[25] = 0;
out_281700328218384173[26] = 0;
out_281700328218384173[27] = 0;
out_281700328218384173[28] = 0;
out_281700328218384173[29] = 0;
out_281700328218384173[30] = 1.0;
out_281700328218384173[31] = 0;
out_281700328218384173[32] = 0;
out_281700328218384173[33] = 0;
out_281700328218384173[34] = 0;
out_281700328218384173[35] = 0;
out_281700328218384173[36] = 0;
out_281700328218384173[37] = 0;
out_281700328218384173[38] = 0;
out_281700328218384173[39] = 0;
out_281700328218384173[40] = 1.0;
out_281700328218384173[41] = 0;
out_281700328218384173[42] = 0;
out_281700328218384173[43] = 0;
out_281700328218384173[44] = 0;
out_281700328218384173[45] = 0;
out_281700328218384173[46] = 0;
out_281700328218384173[47] = 0;
out_281700328218384173[48] = 0;
out_281700328218384173[49] = 0;
out_281700328218384173[50] = 1.0;
out_281700328218384173[51] = 0;
out_281700328218384173[52] = 0;
out_281700328218384173[53] = 0;
out_281700328218384173[54] = 0;
out_281700328218384173[55] = 0;
out_281700328218384173[56] = 0;
out_281700328218384173[57] = 0;
out_281700328218384173[58] = 0;
out_281700328218384173[59] = 0;
out_281700328218384173[60] = 1.0;
out_281700328218384173[61] = 0;
out_281700328218384173[62] = 0;
out_281700328218384173[63] = 0;
out_281700328218384173[64] = 0;
out_281700328218384173[65] = 0;
out_281700328218384173[66] = 0;
out_281700328218384173[67] = 0;
out_281700328218384173[68] = 0;
out_281700328218384173[69] = 0;
out_281700328218384173[70] = 1.0;
out_281700328218384173[71] = 0;
out_281700328218384173[72] = 0;
out_281700328218384173[73] = 0;
out_281700328218384173[74] = 0;
out_281700328218384173[75] = 0;
out_281700328218384173[76] = 0;
out_281700328218384173[77] = 0;
out_281700328218384173[78] = 0;
out_281700328218384173[79] = 0;
out_281700328218384173[80] = 1.0;
}
void f_fun(double *state, double dt, double *out_2973469614408186678) {
out_2973469614408186678[0] = state[0];
out_2973469614408186678[1] = state[1];
out_2973469614408186678[2] = state[2];
out_2973469614408186678[3] = state[3];
out_2973469614408186678[4] = state[4];
out_2973469614408186678[5] = dt*((-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]))*state[6] - 9.8000000000000007*state[8] + stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*state[1]) + (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*state[4])) + state[5];
out_2973469614408186678[6] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*state[4])) + state[6];
out_2973469614408186678[7] = state[7];
out_2973469614408186678[8] = state[8];
void f_fun(double *state, double dt, double *out_3945758947465398650) {
out_3945758947465398650[0] = state[0];
out_3945758947465398650[1] = state[1];
out_3945758947465398650[2] = state[2];
out_3945758947465398650[3] = state[3];
out_3945758947465398650[4] = state[4];
out_3945758947465398650[5] = dt*((-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]))*state[6] - 9.8000000000000007*state[8] + stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*state[1]) + (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*state[4])) + state[5];
out_3945758947465398650[6] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*state[4])) + state[6];
out_3945758947465398650[7] = state[7];
out_3945758947465398650[8] = state[8];
}
void F_fun(double *state, double dt, double *out_4040592134712196686) {
out_4040592134712196686[0] = 1;
out_4040592134712196686[1] = 0;
out_4040592134712196686[2] = 0;
out_4040592134712196686[3] = 0;
out_4040592134712196686[4] = 0;
out_4040592134712196686[5] = 0;
out_4040592134712196686[6] = 0;
out_4040592134712196686[7] = 0;
out_4040592134712196686[8] = 0;
out_4040592134712196686[9] = 0;
out_4040592134712196686[10] = 1;
out_4040592134712196686[11] = 0;
out_4040592134712196686[12] = 0;
out_4040592134712196686[13] = 0;
out_4040592134712196686[14] = 0;
out_4040592134712196686[15] = 0;
out_4040592134712196686[16] = 0;
out_4040592134712196686[17] = 0;
out_4040592134712196686[18] = 0;
out_4040592134712196686[19] = 0;
out_4040592134712196686[20] = 1;
out_4040592134712196686[21] = 0;
out_4040592134712196686[22] = 0;
out_4040592134712196686[23] = 0;
out_4040592134712196686[24] = 0;
out_4040592134712196686[25] = 0;
out_4040592134712196686[26] = 0;
out_4040592134712196686[27] = 0;
out_4040592134712196686[28] = 0;
out_4040592134712196686[29] = 0;
out_4040592134712196686[30] = 1;
out_4040592134712196686[31] = 0;
out_4040592134712196686[32] = 0;
out_4040592134712196686[33] = 0;
out_4040592134712196686[34] = 0;
out_4040592134712196686[35] = 0;
out_4040592134712196686[36] = 0;
out_4040592134712196686[37] = 0;
out_4040592134712196686[38] = 0;
out_4040592134712196686[39] = 0;
out_4040592134712196686[40] = 1;
out_4040592134712196686[41] = 0;
out_4040592134712196686[42] = 0;
out_4040592134712196686[43] = 0;
out_4040592134712196686[44] = 0;
out_4040592134712196686[45] = dt*(stiffness_front*(-state[2] - state[3] + state[7])/(mass*state[1]) + (-stiffness_front - stiffness_rear)*state[5]/(mass*state[4]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[6]/(mass*state[4]));
out_4040592134712196686[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*pow(state[1], 2));
out_4040592134712196686[47] = -dt*stiffness_front*state[0]/(mass*state[1]);
out_4040592134712196686[48] = -dt*stiffness_front*state[0]/(mass*state[1]);
out_4040592134712196686[49] = dt*((-1 - (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*pow(state[4], 2)))*state[6] - (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*pow(state[4], 2)));
out_4040592134712196686[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/(mass*state[4]) + 1;
out_4040592134712196686[51] = dt*(-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]));
out_4040592134712196686[52] = dt*stiffness_front*state[0]/(mass*state[1]);
out_4040592134712196686[53] = -9.8000000000000007*dt;
out_4040592134712196686[54] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front - pow(center_to_rear, 2)*stiffness_rear)*state[6]/(rotational_inertia*state[4]));
out_4040592134712196686[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2));
out_4040592134712196686[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_4040592134712196686[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_4040592134712196686[58] = dt*(-(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*pow(state[4], 2)) - (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*pow(state[4], 2)));
out_4040592134712196686[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]);
out_4040592134712196686[60] = dt*(-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])/(rotational_inertia*state[4]) + 1;
out_4040592134712196686[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_4040592134712196686[62] = 0;
out_4040592134712196686[63] = 0;
out_4040592134712196686[64] = 0;
out_4040592134712196686[65] = 0;
out_4040592134712196686[66] = 0;
out_4040592134712196686[67] = 0;
out_4040592134712196686[68] = 0;
out_4040592134712196686[69] = 0;
out_4040592134712196686[70] = 1;
out_4040592134712196686[71] = 0;
out_4040592134712196686[72] = 0;
out_4040592134712196686[73] = 0;
out_4040592134712196686[74] = 0;
out_4040592134712196686[75] = 0;
out_4040592134712196686[76] = 0;
out_4040592134712196686[77] = 0;
out_4040592134712196686[78] = 0;
out_4040592134712196686[79] = 0;
out_4040592134712196686[80] = 1;
void F_fun(double *state, double dt, double *out_7239966002367196486) {
out_7239966002367196486[0] = 1;
out_7239966002367196486[1] = 0;
out_7239966002367196486[2] = 0;
out_7239966002367196486[3] = 0;
out_7239966002367196486[4] = 0;
out_7239966002367196486[5] = 0;
out_7239966002367196486[6] = 0;
out_7239966002367196486[7] = 0;
out_7239966002367196486[8] = 0;
out_7239966002367196486[9] = 0;
out_7239966002367196486[10] = 1;
out_7239966002367196486[11] = 0;
out_7239966002367196486[12] = 0;
out_7239966002367196486[13] = 0;
out_7239966002367196486[14] = 0;
out_7239966002367196486[15] = 0;
out_7239966002367196486[16] = 0;
out_7239966002367196486[17] = 0;
out_7239966002367196486[18] = 0;
out_7239966002367196486[19] = 0;
out_7239966002367196486[20] = 1;
out_7239966002367196486[21] = 0;
out_7239966002367196486[22] = 0;
out_7239966002367196486[23] = 0;
out_7239966002367196486[24] = 0;
out_7239966002367196486[25] = 0;
out_7239966002367196486[26] = 0;
out_7239966002367196486[27] = 0;
out_7239966002367196486[28] = 0;
out_7239966002367196486[29] = 0;
out_7239966002367196486[30] = 1;
out_7239966002367196486[31] = 0;
out_7239966002367196486[32] = 0;
out_7239966002367196486[33] = 0;
out_7239966002367196486[34] = 0;
out_7239966002367196486[35] = 0;
out_7239966002367196486[36] = 0;
out_7239966002367196486[37] = 0;
out_7239966002367196486[38] = 0;
out_7239966002367196486[39] = 0;
out_7239966002367196486[40] = 1;
out_7239966002367196486[41] = 0;
out_7239966002367196486[42] = 0;
out_7239966002367196486[43] = 0;
out_7239966002367196486[44] = 0;
out_7239966002367196486[45] = dt*(stiffness_front*(-state[2] - state[3] + state[7])/(mass*state[1]) + (-stiffness_front - stiffness_rear)*state[5]/(mass*state[4]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[6]/(mass*state[4]));
out_7239966002367196486[46] = -dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(mass*pow(state[1], 2));
out_7239966002367196486[47] = -dt*stiffness_front*state[0]/(mass*state[1]);
out_7239966002367196486[48] = -dt*stiffness_front*state[0]/(mass*state[1]);
out_7239966002367196486[49] = dt*((-1 - (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*pow(state[4], 2)))*state[6] - (-stiffness_front*state[0] - stiffness_rear*state[0])*state[5]/(mass*pow(state[4], 2)));
out_7239966002367196486[50] = dt*(-stiffness_front*state[0] - stiffness_rear*state[0])/(mass*state[4]) + 1;
out_7239966002367196486[51] = dt*(-state[4] + (-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(mass*state[4]));
out_7239966002367196486[52] = dt*stiffness_front*state[0]/(mass*state[1]);
out_7239966002367196486[53] = -9.8000000000000007*dt;
out_7239966002367196486[54] = dt*(center_to_front*stiffness_front*(-state[2] - state[3] + state[7])/(rotational_inertia*state[1]) + (-center_to_front*stiffness_front + center_to_rear*stiffness_rear)*state[5]/(rotational_inertia*state[4]) + (-pow(center_to_front, 2)*stiffness_front - pow(center_to_rear, 2)*stiffness_rear)*state[6]/(rotational_inertia*state[4]));
out_7239966002367196486[55] = -center_to_front*dt*stiffness_front*(-state[2] - state[3] + state[7])*state[0]/(rotational_inertia*pow(state[1], 2));
out_7239966002367196486[56] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_7239966002367196486[57] = -center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_7239966002367196486[58] = dt*(-(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])*state[5]/(rotational_inertia*pow(state[4], 2)) - (-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])*state[6]/(rotational_inertia*pow(state[4], 2)));
out_7239966002367196486[59] = dt*(-center_to_front*stiffness_front*state[0] + center_to_rear*stiffness_rear*state[0])/(rotational_inertia*state[4]);
out_7239966002367196486[60] = dt*(-pow(center_to_front, 2)*stiffness_front*state[0] - pow(center_to_rear, 2)*stiffness_rear*state[0])/(rotational_inertia*state[4]) + 1;
out_7239966002367196486[61] = center_to_front*dt*stiffness_front*state[0]/(rotational_inertia*state[1]);
out_7239966002367196486[62] = 0;
out_7239966002367196486[63] = 0;
out_7239966002367196486[64] = 0;
out_7239966002367196486[65] = 0;
out_7239966002367196486[66] = 0;
out_7239966002367196486[67] = 0;
out_7239966002367196486[68] = 0;
out_7239966002367196486[69] = 0;
out_7239966002367196486[70] = 1;
out_7239966002367196486[71] = 0;
out_7239966002367196486[72] = 0;
out_7239966002367196486[73] = 0;
out_7239966002367196486[74] = 0;
out_7239966002367196486[75] = 0;
out_7239966002367196486[76] = 0;
out_7239966002367196486[77] = 0;
out_7239966002367196486[78] = 0;
out_7239966002367196486[79] = 0;
out_7239966002367196486[80] = 1;
}
void h_25(double *state, double *unused, double *out_1319061140791389331) {
out_1319061140791389331[0] = state[6];
void h_25(double *state, double *unused, double *out_4414103654617947245) {
out_4414103654617947245[0] = state[6];
}
void H_25(double *state, double *unused, double *out_7793576592585487069) {
out_7793576592585487069[0] = 0;
out_7793576592585487069[1] = 0;
out_7793576592585487069[2] = 0;
out_7793576592585487069[3] = 0;
out_7793576592585487069[4] = 0;
out_7793576592585487069[5] = 0;
out_7793576592585487069[6] = 1;
out_7793576592585487069[7] = 0;
out_7793576592585487069[8] = 0;
void H_25(double *state, double *unused, double *out_1365985619853648806) {
out_1365985619853648806[0] = 0;
out_1365985619853648806[1] = 0;
out_1365985619853648806[2] = 0;
out_1365985619853648806[3] = 0;
out_1365985619853648806[4] = 0;
out_1365985619853648806[5] = 0;
out_1365985619853648806[6] = 1;
out_1365985619853648806[7] = 0;
out_1365985619853648806[8] = 0;
}
void h_24(double *state, double *unused, double *out_3718149663781647640) {
out_3718149663781647640[0] = state[4];
out_3718149663781647640[1] = state[5];
void h_24(double *state, double *unused, double *out_218399050948173848) {
out_218399050948173848[0] = state[4];
out_218399050948173848[1] = state[5];
}
void H_24(double *state, double *unused, double *out_7095241882321741411) {
out_7095241882321741411[0] = 0;
out_7095241882321741411[1] = 0;
out_7095241882321741411[2] = 0;
out_7095241882321741411[3] = 0;
out_7095241882321741411[4] = 1;
out_7095241882321741411[5] = 0;
out_7095241882321741411[6] = 0;
out_7095241882321741411[7] = 0;
out_7095241882321741411[8] = 0;
out_7095241882321741411[9] = 0;
out_7095241882321741411[10] = 0;
out_7095241882321741411[11] = 0;
out_7095241882321741411[12] = 0;
out_7095241882321741411[13] = 0;
out_7095241882321741411[14] = 1;
out_7095241882321741411[15] = 0;
out_7095241882321741411[16] = 0;
out_7095241882321741411[17] = 0;
void H_24(double *state, double *unused, double *out_8020191077961834563) {
out_8020191077961834563[0] = 0;
out_8020191077961834563[1] = 0;
out_8020191077961834563[2] = 0;
out_8020191077961834563[3] = 0;
out_8020191077961834563[4] = 1;
out_8020191077961834563[5] = 0;
out_8020191077961834563[6] = 0;
out_8020191077961834563[7] = 0;
out_8020191077961834563[8] = 0;
out_8020191077961834563[9] = 0;
out_8020191077961834563[10] = 0;
out_8020191077961834563[11] = 0;
out_8020191077961834563[12] = 0;
out_8020191077961834563[13] = 0;
out_8020191077961834563[14] = 1;
out_8020191077961834563[15] = 0;
out_8020191077961834563[16] = 0;
out_8020191077961834563[17] = 0;
}
void h_30(double *state, double *unused, double *out_1043867078506883442) {
out_1043867078506883442[0] = state[4];
void h_30(double *state, double *unused, double *out_7444812492615309208) {
out_7444812492615309208[0] = state[4];
}
void H_30(double *state, double *unused, double *out_3736477139632447792) {
out_3736477139632447792[0] = 0;
out_3736477139632447792[1] = 0;
out_3736477139632447792[2] = 0;
out_3736477139632447792[3] = 0;
out_3736477139632447792[4] = 1;
out_3736477139632447792[5] = 0;
out_3736477139632447792[6] = 0;
out_3736477139632447792[7] = 0;
out_3736477139632447792[8] = 0;
void H_30(double *state, double *unused, double *out_1236646672710408736) {
out_1236646672710408736[0] = 0;
out_1236646672710408736[1] = 0;
out_1236646672710408736[2] = 0;
out_1236646672710408736[3] = 0;
out_1236646672710408736[4] = 1;
out_1236646672710408736[5] = 0;
out_1236646672710408736[6] = 0;
out_1236646672710408736[7] = 0;
out_1236646672710408736[8] = 0;
}
void h_26(double *state, double *unused, double *out_6922152566065598530) {
out_6922152566065598530[0] = state[7];
void h_26(double *state, double *unused, double *out_442049788822243429) {
out_442049788822243429[0] = state[7];
}
void H_26(double *state, double *unused, double *out_4052073273711430845) {
out_4052073273711430845[0] = 0;
out_4052073273711430845[1] = 0;
out_4052073273711430845[2] = 0;
out_4052073273711430845[3] = 0;
out_4052073273711430845[4] = 0;
out_4052073273711430845[5] = 0;
out_4052073273711430845[6] = 0;
out_4052073273711430845[7] = 1;
out_4052073273711430845[8] = 0;
void H_26(double *state, double *unused, double *out_2375517699020407418) {
out_2375517699020407418[0] = 0;
out_2375517699020407418[1] = 0;
out_2375517699020407418[2] = 0;
out_2375517699020407418[3] = 0;
out_2375517699020407418[4] = 0;
out_2375517699020407418[5] = 0;
out_2375517699020407418[6] = 0;
out_2375517699020407418[7] = 1;
out_2375517699020407418[8] = 0;
}
void h_27(double *state, double *unused, double *out_7701482271649087111) {
out_7701482271649087111[0] = state[3];
void h_27(double *state, double *unused, double *out_3470593801716284810) {
out_3470593801716284810[0] = state[3];
}
void H_27(double *state, double *unused, double *out_5911240451432872703) {
out_5911240451432872703[0] = 0;
out_5911240451432872703[1] = 0;
out_5911240451432872703[2] = 0;
out_5911240451432872703[3] = 1;
out_5911240451432872703[4] = 0;
out_5911240451432872703[5] = 0;
out_5911240451432872703[6] = 0;
out_5911240451432872703[7] = 0;
out_5911240451432872703[8] = 0;
void H_27(double *state, double *unused, double *out_938116639090016175) {
out_938116639090016175[0] = 0;
out_938116639090016175[1] = 0;
out_938116639090016175[2] = 0;
out_938116639090016175[3] = 1;
out_938116639090016175[4] = 0;
out_938116639090016175[5] = 0;
out_938116639090016175[6] = 0;
out_938116639090016175[7] = 0;
out_938116639090016175[8] = 0;
}
void h_29(double *state, double *unused, double *out_7544295603297957966) {
out_7544295603297957966[0] = state[1];
void h_29(double *state, double *unused, double *out_7965145529649909723) {
out_7965145529649909723[0] = state[1];
}
void H_29(double *state, double *unused, double *out_3226245795318055608) {
out_3226245795318055608[0] = 0;
out_3226245795318055608[1] = 1;
out_3226245795318055608[2] = 0;
out_3226245795318055608[3] = 0;
out_3226245795318055608[4] = 0;
out_3226245795318055608[5] = 0;
out_3226245795318055608[6] = 0;
out_3226245795318055608[7] = 0;
out_3226245795318055608[8] = 0;
void H_29(double *state, double *unused, double *out_1746878017024800920) {
out_1746878017024800920[0] = 0;
out_1746878017024800920[1] = 1;
out_1746878017024800920[2] = 0;
out_1746878017024800920[3] = 0;
out_1746878017024800920[4] = 0;
out_1746878017024800920[5] = 0;
out_1746878017024800920[6] = 0;
out_1746878017024800920[7] = 0;
out_1746878017024800920[8] = 0;
}
void h_28(double *state, double *unused, double *out_3095916628749130163) {
out_3095916628749130163[0] = state[0];
void h_28(double *state, double *unused, double *out_5501663824664413576) {
out_5501663824664413576[0] = state[0];
}
void H_28(double *state, double *unused, double *out_8308644812387586182) {
out_8308644812387586182[0] = 1;
out_8308644812387586182[1] = 0;
out_8308644812387586182[2] = 0;
out_8308644812387586182[3] = 0;
out_8308644812387586182[4] = 0;
out_8308644812387586182[5] = 0;
out_8308644812387586182[6] = 0;
out_8308644812387586182[7] = 0;
out_8308644812387586182[8] = 0;
void H_28(double *state, double *unused, double *out_3335521000044729654) {
out_3335521000044729654[0] = 1;
out_3335521000044729654[1] = 0;
out_3335521000044729654[2] = 0;
out_3335521000044729654[3] = 0;
out_3335521000044729654[4] = 0;
out_3335521000044729654[5] = 0;
out_3335521000044729654[6] = 0;
out_3335521000044729654[7] = 0;
out_3335521000044729654[8] = 0;
}
void h_31(double *state, double *unused, double *out_4956510669045411681) {
out_4956510669045411681[0] = state[8];
void h_31(double *state, double *unused, double *out_5392762942373062487) {
out_5392762942373062487[0] = state[8];
}
void H_31(double *state, double *unused, double *out_7824222554462447497) {
out_7824222554462447497[0] = 0;
out_7824222554462447497[1] = 0;
out_7824222554462447497[2] = 0;
out_7824222554462447497[3] = 0;
out_7824222554462447497[4] = 0;
out_7824222554462447497[5] = 0;
out_7824222554462447497[6] = 0;
out_7824222554462447497[7] = 0;
out_7824222554462447497[8] = 1;
void H_31(double *state, double *unused, double *out_1396631581730609234) {
out_1396631581730609234[0] = 0;
out_1396631581730609234[1] = 0;
out_1396631581730609234[2] = 0;
out_1396631581730609234[3] = 0;
out_1396631581730609234[4] = 0;
out_1396631581730609234[5] = 0;
out_1396631581730609234[6] = 0;
out_1396631581730609234[7] = 0;
out_1396631581730609234[8] = 1;
}
#include <eigen3/Eigen/Dense>
#include <iostream>
@@ -518,68 +518,68 @@ void car_update_28(double *in_x, double *in_P, double *in_z, double *in_R, doubl
void car_update_31(double *in_x, double *in_P, double *in_z, double *in_R, double *in_ea) {
update<1, 3, 0>(in_x, in_P, h_31, H_31, NULL, in_z, in_R, in_ea, MAHA_THRESH_31);
}
void car_err_fun(double *nom_x, double *delta_x, double *out_5662147043452870344) {
err_fun(nom_x, delta_x, out_5662147043452870344);
void car_err_fun(double *nom_x, double *delta_x, double *out_2366717911037962719) {
err_fun(nom_x, delta_x, out_2366717911037962719);
}
void car_inv_err_fun(double *nom_x, double *true_x, double *out_2016113788005242335) {
inv_err_fun(nom_x, true_x, out_2016113788005242335);
void car_inv_err_fun(double *nom_x, double *true_x, double *out_70336108065318295) {
inv_err_fun(nom_x, true_x, out_70336108065318295);
}
void car_H_mod_fun(double *state, double *out_8997301641043644665) {
H_mod_fun(state, out_8997301641043644665);
void car_H_mod_fun(double *state, double *out_281700328218384173) {
H_mod_fun(state, out_281700328218384173);
}
void car_f_fun(double *state, double dt, double *out_2973469614408186678) {
f_fun(state, dt, out_2973469614408186678);
void car_f_fun(double *state, double dt, double *out_3945758947465398650) {
f_fun(state, dt, out_3945758947465398650);
}
void car_F_fun(double *state, double dt, double *out_4040592134712196686) {
F_fun(state, dt, out_4040592134712196686);
void car_F_fun(double *state, double dt, double *out_7239966002367196486) {
F_fun(state, dt, out_7239966002367196486);
}
void car_h_25(double *state, double *unused, double *out_1319061140791389331) {
h_25(state, unused, out_1319061140791389331);
void car_h_25(double *state, double *unused, double *out_4414103654617947245) {
h_25(state, unused, out_4414103654617947245);
}
void car_H_25(double *state, double *unused, double *out_7793576592585487069) {
H_25(state, unused, out_7793576592585487069);
void car_H_25(double *state, double *unused, double *out_1365985619853648806) {
H_25(state, unused, out_1365985619853648806);
}
void car_h_24(double *state, double *unused, double *out_3718149663781647640) {
h_24(state, unused, out_3718149663781647640);
void car_h_24(double *state, double *unused, double *out_218399050948173848) {
h_24(state, unused, out_218399050948173848);
}
void car_H_24(double *state, double *unused, double *out_7095241882321741411) {
H_24(state, unused, out_7095241882321741411);
void car_H_24(double *state, double *unused, double *out_8020191077961834563) {
H_24(state, unused, out_8020191077961834563);
}
void car_h_30(double *state, double *unused, double *out_1043867078506883442) {
h_30(state, unused, out_1043867078506883442);
void car_h_30(double *state, double *unused, double *out_7444812492615309208) {
h_30(state, unused, out_7444812492615309208);
}
void car_H_30(double *state, double *unused, double *out_3736477139632447792) {
H_30(state, unused, out_3736477139632447792);
void car_H_30(double *state, double *unused, double *out_1236646672710408736) {
H_30(state, unused, out_1236646672710408736);
}
void car_h_26(double *state, double *unused, double *out_6922152566065598530) {
h_26(state, unused, out_6922152566065598530);
void car_h_26(double *state, double *unused, double *out_442049788822243429) {
h_26(state, unused, out_442049788822243429);
}
void car_H_26(double *state, double *unused, double *out_4052073273711430845) {
H_26(state, unused, out_4052073273711430845);
void car_H_26(double *state, double *unused, double *out_2375517699020407418) {
H_26(state, unused, out_2375517699020407418);
}
void car_h_27(double *state, double *unused, double *out_7701482271649087111) {
h_27(state, unused, out_7701482271649087111);
void car_h_27(double *state, double *unused, double *out_3470593801716284810) {
h_27(state, unused, out_3470593801716284810);
}
void car_H_27(double *state, double *unused, double *out_5911240451432872703) {
H_27(state, unused, out_5911240451432872703);
void car_H_27(double *state, double *unused, double *out_938116639090016175) {
H_27(state, unused, out_938116639090016175);
}
void car_h_29(double *state, double *unused, double *out_7544295603297957966) {
h_29(state, unused, out_7544295603297957966);
void car_h_29(double *state, double *unused, double *out_7965145529649909723) {
h_29(state, unused, out_7965145529649909723);
}
void car_H_29(double *state, double *unused, double *out_3226245795318055608) {
H_29(state, unused, out_3226245795318055608);
void car_H_29(double *state, double *unused, double *out_1746878017024800920) {
H_29(state, unused, out_1746878017024800920);
}
void car_h_28(double *state, double *unused, double *out_3095916628749130163) {
h_28(state, unused, out_3095916628749130163);
void car_h_28(double *state, double *unused, double *out_5501663824664413576) {
h_28(state, unused, out_5501663824664413576);
}
void car_H_28(double *state, double *unused, double *out_8308644812387586182) {
H_28(state, unused, out_8308644812387586182);
void car_H_28(double *state, double *unused, double *out_3335521000044729654) {
H_28(state, unused, out_3335521000044729654);
}
void car_h_31(double *state, double *unused, double *out_4956510669045411681) {
h_31(state, unused, out_4956510669045411681);
void car_h_31(double *state, double *unused, double *out_5392762942373062487) {
h_31(state, unused, out_5392762942373062487);
}
void car_H_31(double *state, double *unused, double *out_7824222554462447497) {
H_31(state, unused, out_7824222554462447497);
void car_H_31(double *state, double *unused, double *out_1396631581730609234) {
H_31(state, unused, out_1396631581730609234);
}
void car_predict(double *in_x, double *in_P, double *in_Q, double dt) {
predict(in_x, in_P, in_Q, dt);
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large Load Diff
Binary file not shown.
Binary file not shown.
+3 -12
View File
@@ -179,7 +179,6 @@ class Soundd:
self.update_alert(AudibleAlert.fart)
else:
self.update_alert(AudibleAlert.prompt)
self.openpilot_crashed_played = True
elif sm.updated['controlsState']:
new_alert = sm['controlsState'].alertSound.raw
@@ -216,28 +215,22 @@ class Soundd:
sm.update(0)
if sm.updated['microphone'] and self.current_alert == AudibleAlert.none: # only update volume filter when not playing alert
self.spl_filter_weighted.update(sm["microphone"].soundPressureWeightedDb)
if self.frogpilot_toggles.alert_volume_control:
self.spl_filter_weighted.update(sm["microphone"].soundPressureWeightedDb)
self.auto_volume = self.calculate_volume(float(self.spl_filter_weighted.x))
self.current_volume = 0.0
else:
self.spl_filter_weighted.update(sm["microphone"].soundPressureWeightedDb)
self.current_volume = self.calculate_volume(float(self.spl_filter_weighted.x))
elif self.frogpilot_toggles.alert_volume_control and self.current_alert in self.volume_map:
self.current_volume = self.volume_map[self.current_alert] / 100.0
if self.current_volume == 1.01:
if self.current_alert == AudibleAlert.startup:
self.current_volume = MAX_VOLUME
else:
self.current_volume = self.auto_volume
self.current_volume = self.auto_volume
elif self.current_alert in self.random_events_map:
self.current_volume = self.random_events_map[self.current_alert]
elif self.current_alert == AudibleAlert.startup:
self.current_volume = MAX_VOLUME
self.get_audible_alert(sm)
rk.keep_time()
@@ -247,7 +240,6 @@ class Soundd:
# Update FrogPilot parameters
if sm['frogpilotPlan'].togglesUpdated:
self.frogpilot_toggles = get_frogpilot_toggles()
self.update_frogpilot_sounds()
if self.restart_stream:
@@ -271,7 +263,6 @@ class Soundd:
AudibleAlert.warningImmediate: self.frogpilot_toggles.warningImmediate_volume,
AudibleAlert.goat: self.frogpilot_toggles.prompt_volume,
AudibleAlert.startup: self.frogpilot_toggles.engage_volume,
}
if self.frogpilot_toggles.sound_pack != "stock":
+1 -1
View File
@@ -93,7 +93,7 @@ def register(show_spinner=False, register_konik=False) -> str | None:
if show_spinner:
spinner.close()
if not register_konik and dongle_id != params.get("KonikDongleId", encoding="utf8"):
if dongle_id and not register_konik:
params.put("DongleId", dongle_id)
params.put("StockDongleId", dongle_id)
set_offroad_alert("Offroad_UnofficialHardware", (dongle_id == UNREGISTERED_DONGLE_ID) and not PC)
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 402 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -7,6 +7,7 @@ from pathlib import Path
from sentry_sdk.integrations.threading import ThreadingIntegration
from openpilot.common.params import Params, ParamKeyType
from openpilot.system.athena.registration import is_registered_device
from openpilot.system.hardware import HARDWARE, PC
from openpilot.common.swaglog import cloudlog
from openpilot.system.version import get_build_metadata, get_version