diff --git a/common/libcommon.a b/common/libcommon.a index 081f605d1..4cb3fed13 100644 Binary files a/common/libcommon.a and b/common/libcommon.a differ diff --git a/common/params_keys.h b/common/params_keys.h index 605fb09c0..7611aa329 100644 --- a/common/params_keys.h +++ b/common/params_keys.h @@ -263,6 +263,7 @@ inline static std::unordered_map keys = { {"EVTuning", {PERSISTENT, BOOL, "0", "0", 3}}, {"Fahrenheit", {PERSISTENT, BOOL, "0", "0", 3}}, {"FlashPanda", {CLEAR_ON_MANAGER_START, BOOL, "0", "0"}}, + {"GMDashSpoofOffsets", {PERSISTENT, BOOL, "0", "0", 2}}, {"GMPedalLongitudinal", {PERSISTENT, BOOL, "1", "1", 2}}, {"LongPitch", {PERSISTENT, BOOL, "1", "0", 2}}, {"RemoteStartBootsComma", {PERSISTENT, BOOL, "0", "0"}}, diff --git a/common/params_pyx.so b/common/params_pyx.so index 588d9535d..4653a4649 100755 Binary files a/common/params_pyx.so and b/common/params_pyx.so differ diff --git a/panda/board/obj/body_h7.bin.signed b/panda/board/obj/body_h7.bin.signed index 77bd8a697..cbd3fc680 100644 Binary files a/panda/board/obj/body_h7.bin.signed and b/panda/board/obj/body_h7.bin.signed differ diff --git a/panda/board/obj/body_h7/bootstub.elf b/panda/board/obj/body_h7/bootstub.elf index 51f7fda10..6f4c2eb42 100755 Binary files a/panda/board/obj/body_h7/bootstub.elf and b/panda/board/obj/body_h7/bootstub.elf differ diff --git a/panda/board/obj/body_h7/main.bin b/panda/board/obj/body_h7/main.bin index 6a179a61c..13ddf69bf 100755 Binary files a/panda/board/obj/body_h7/main.bin and b/panda/board/obj/body_h7/main.bin differ diff --git a/panda/board/obj/body_h7/main.elf b/panda/board/obj/body_h7/main.elf index 87febc049..e175db9cb 100755 Binary files a/panda/board/obj/body_h7/main.elf and b/panda/board/obj/body_h7/main.elf differ diff --git a/panda/board/obj/bootstub.body_h7.bin b/panda/board/obj/bootstub.body_h7.bin index 424f39ec9..e75c2b5b6 100755 Binary files a/panda/board/obj/bootstub.body_h7.bin and b/panda/board/obj/bootstub.body_h7.bin differ diff --git a/panda/board/obj/bootstub.panda.bin b/panda/board/obj/bootstub.panda.bin index ed45f1e4f..1339ed4dd 100755 Binary files a/panda/board/obj/bootstub.panda.bin and b/panda/board/obj/bootstub.panda.bin differ diff --git a/panda/board/obj/bootstub.panda_h7.bin b/panda/board/obj/bootstub.panda_h7.bin index 611e4c5d2..2e51fbc0f 100755 Binary files a/panda/board/obj/bootstub.panda_h7.bin and b/panda/board/obj/bootstub.panda_h7.bin differ diff --git a/panda/board/obj/bootstub.panda_h7_remote.bin b/panda/board/obj/bootstub.panda_h7_remote.bin index 611e4c5d2..2e51fbc0f 100755 Binary files a/panda/board/obj/bootstub.panda_h7_remote.bin and b/panda/board/obj/bootstub.panda_h7_remote.bin differ diff --git a/panda/board/obj/bootstub.panda_jungle_h7.bin b/panda/board/obj/bootstub.panda_jungle_h7.bin index b24890777..fec43a0cb 100755 Binary files a/panda/board/obj/bootstub.panda_jungle_h7.bin and b/panda/board/obj/bootstub.panda_jungle_h7.bin differ diff --git a/panda/board/obj/bootstub.panda_remote.bin b/panda/board/obj/bootstub.panda_remote.bin index ed45f1e4f..1339ed4dd 100755 Binary files a/panda/board/obj/bootstub.panda_remote.bin and b/panda/board/obj/bootstub.panda_remote.bin differ diff --git a/panda/board/obj/gitversion.h b/panda/board/obj/gitversion.h index 11fa919b8..325cbb3f9 100644 --- a/panda/board/obj/gitversion.h +++ b/panda/board/obj/gitversion.h @@ -1,2 +1,2 @@ extern const uint8_t gitversion[19]; -const uint8_t gitversion[19] = "DEV-8c00f0a3-DEBUG"; +const uint8_t gitversion[19] = "DEV-78c30377-DEBUG"; diff --git a/panda/board/obj/panda.bin.signed b/panda/board/obj/panda.bin.signed index 3440e0542..ae00387bf 100644 Binary files a/panda/board/obj/panda.bin.signed and b/panda/board/obj/panda.bin.signed differ diff --git a/panda/board/obj/panda/bootstub.elf b/panda/board/obj/panda/bootstub.elf index f965368aa..ff98cefc3 100755 Binary files a/panda/board/obj/panda/bootstub.elf and b/panda/board/obj/panda/bootstub.elf differ diff --git a/panda/board/obj/panda/main.bin b/panda/board/obj/panda/main.bin index 356866362..5000a8430 100755 Binary files a/panda/board/obj/panda/main.bin and b/panda/board/obj/panda/main.bin differ diff --git a/panda/board/obj/panda/main.elf b/panda/board/obj/panda/main.elf index 3de9a7e2c..200778ab6 100755 Binary files a/panda/board/obj/panda/main.elf and b/panda/board/obj/panda/main.elf differ diff --git a/panda/board/obj/panda_h7.bin.signed b/panda/board/obj/panda_h7.bin.signed index 278ec4b02..022549d6b 100644 Binary files a/panda/board/obj/panda_h7.bin.signed and b/panda/board/obj/panda_h7.bin.signed differ diff --git a/panda/board/obj/panda_h7/bootstub.elf b/panda/board/obj/panda_h7/bootstub.elf index 2c62ea7aa..757a10d59 100755 Binary files a/panda/board/obj/panda_h7/bootstub.elf and b/panda/board/obj/panda_h7/bootstub.elf differ diff --git a/panda/board/obj/panda_h7/main.bin b/panda/board/obj/panda_h7/main.bin index e99c59032..dd6b72739 100755 Binary files a/panda/board/obj/panda_h7/main.bin and b/panda/board/obj/panda_h7/main.bin differ diff --git a/panda/board/obj/panda_h7/main.elf b/panda/board/obj/panda_h7/main.elf index 78aa1cb02..a049db231 100755 Binary files a/panda/board/obj/panda_h7/main.elf and b/panda/board/obj/panda_h7/main.elf differ diff --git a/panda/board/obj/panda_h7_remote.bin.signed b/panda/board/obj/panda_h7_remote.bin.signed index d910eef26..5ea0d391a 100644 Binary files a/panda/board/obj/panda_h7_remote.bin.signed and b/panda/board/obj/panda_h7_remote.bin.signed differ diff --git a/panda/board/obj/panda_h7_remote/bootstub.elf b/panda/board/obj/panda_h7_remote/bootstub.elf index 5190266f0..663204948 100755 Binary files a/panda/board/obj/panda_h7_remote/bootstub.elf and b/panda/board/obj/panda_h7_remote/bootstub.elf differ diff --git a/panda/board/obj/panda_h7_remote/main.bin b/panda/board/obj/panda_h7_remote/main.bin index 24ca2e51c..4f0414adf 100755 Binary files a/panda/board/obj/panda_h7_remote/main.bin and b/panda/board/obj/panda_h7_remote/main.bin differ diff --git a/panda/board/obj/panda_h7_remote/main.elf b/panda/board/obj/panda_h7_remote/main.elf index a04a4d6bc..b1e7d7d4a 100755 Binary files a/panda/board/obj/panda_h7_remote/main.elf and b/panda/board/obj/panda_h7_remote/main.elf differ diff --git a/panda/board/obj/panda_jungle_h7.bin.signed b/panda/board/obj/panda_jungle_h7.bin.signed index a996713cb..279678600 100644 Binary files a/panda/board/obj/panda_jungle_h7.bin.signed and b/panda/board/obj/panda_jungle_h7.bin.signed differ diff --git a/panda/board/obj/panda_jungle_h7/bootstub.elf b/panda/board/obj/panda_jungle_h7/bootstub.elf index 8210831b1..7e0988881 100755 Binary files a/panda/board/obj/panda_jungle_h7/bootstub.elf and b/panda/board/obj/panda_jungle_h7/bootstub.elf differ diff --git a/panda/board/obj/panda_jungle_h7/main.bin b/panda/board/obj/panda_jungle_h7/main.bin index 6d82479fd..9bf2b2a2a 100755 Binary files a/panda/board/obj/panda_jungle_h7/main.bin and b/panda/board/obj/panda_jungle_h7/main.bin differ diff --git a/panda/board/obj/panda_jungle_h7/main.elf b/panda/board/obj/panda_jungle_h7/main.elf index 8d78ca843..d50d034ee 100755 Binary files a/panda/board/obj/panda_jungle_h7/main.elf and b/panda/board/obj/panda_jungle_h7/main.elf differ diff --git a/panda/board/obj/panda_remote.bin.signed b/panda/board/obj/panda_remote.bin.signed index f18ed0f19..f1b65ef64 100644 Binary files a/panda/board/obj/panda_remote.bin.signed and b/panda/board/obj/panda_remote.bin.signed differ diff --git a/panda/board/obj/panda_remote/bootstub.elf b/panda/board/obj/panda_remote/bootstub.elf index d345fca35..b00302500 100755 Binary files a/panda/board/obj/panda_remote/bootstub.elf and b/panda/board/obj/panda_remote/bootstub.elf differ diff --git a/panda/board/obj/panda_remote/main.bin b/panda/board/obj/panda_remote/main.bin index 53956581e..e801388df 100755 Binary files a/panda/board/obj/panda_remote/main.bin and b/panda/board/obj/panda_remote/main.bin differ diff --git a/panda/board/obj/panda_remote/main.elf b/panda/board/obj/panda_remote/main.elf index 0a6955974..0fe66fe55 100755 Binary files a/panda/board/obj/panda_remote/main.elf and b/panda/board/obj/panda_remote/main.elf differ diff --git a/panda/board/obj/version b/panda/board/obj/version index 1ba1a6dd7..4d73ed050 100644 --- a/panda/board/obj/version +++ b/panda/board/obj/version @@ -1 +1 @@ -DEV-8c00f0a3-DEBUG \ No newline at end of file +DEV-78c30377-DEBUG \ No newline at end of file diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 1a0d9b534..41d5def42 100644 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -35,6 +35,26 @@ LaneChangeDirection = log.LaneChangeDirection ACTUATOR_FIELDS = tuple(car.CarControl.Actuators.schema.fields.keys()) +def get_gm_hud_set_speed(set_speed_ms: float, controls_enabled: bool, starpilot_toggles, starpilot_plan) -> float: + spoofed_speed = set_speed_ms + + set_speed_offset = float(getattr(starpilot_toggles, "set_speed_offset", 0.0) or 0.0) + if spoofed_speed > 0 and set_speed_offset > 0: + spoofed_speed += set_speed_offset * CV.KPH_TO_MS + + if not controls_enabled or not getattr(starpilot_toggles, "speed_limit_controller", False): + return spoofed_speed + + slc_source = str(getattr(starpilot_plan, "slcSpeedLimitSource", "") or "") + slc_speed_limit = float(getattr(starpilot_plan, "slcSpeedLimit", 0.0) or 0.0) + slc_speed_limit_offset = float(getattr(starpilot_plan, "slcSpeedLimitOffset", 0.0) or 0.0) + + if slc_source != "None" and slc_speed_limit > 0: + return slc_speed_limit + slc_speed_limit_offset + + return spoofed_speed + + class Controls: def __init__(self) -> None: self.params = Params() @@ -192,7 +212,18 @@ class Controls: CC.cruiseControl.resume = CC.enabled and CS.cruiseState.standstill and not self.sm['longitudinalPlan'].shouldStop hudControl = CC.hudControl - hudControl.setSpeed = float(CS.vCruiseCluster * CV.KPH_TO_MS) + hud_set_speed = float(CS.vCruiseCluster * CV.KPH_TO_MS) + gm_dash_spoof_offsets_enabled = ( + self.CP.brand == "gm" and + self.CP.openpilotLongitudinalControl and + self.CP.enableGasInterceptorDEPRECATED and + getattr(self.starpilot_toggles, "gm_pedal_longitudinal", True) and + not getattr(self.starpilot_toggles, "disable_openpilot_long", False) and + getattr(self.starpilot_toggles, "gm_dash_spoof_offsets", False) + ) + if gm_dash_spoof_offsets_enabled: + hud_set_speed = get_gm_hud_set_speed(hud_set_speed, CC.enabled, self.starpilot_toggles, self.sm['starpilotPlan']) + hudControl.setSpeed = hud_set_speed hudControl.speedVisible = CC.enabled hudControl.lanesVisible = CC.enabled hudControl.leadVisible = self.sm['longitudinalPlan'].hasLead diff --git a/selfdrive/pandad/pandad b/selfdrive/pandad/pandad index fcc2e70e8..2ca491e43 100755 Binary files a/selfdrive/pandad/pandad and b/selfdrive/pandad/pandad differ diff --git a/selfdrive/ui/layouts/settings/starpilot/vehicle.py b/selfdrive/ui/layouts/settings/starpilot/vehicle.py index a6f61efec..3459cf08c 100644 --- a/selfdrive/ui/layouts/settings/starpilot/vehicle.py +++ b/selfdrive/ui/layouts/settings/starpilot/vehicle.py @@ -248,6 +248,14 @@ class StarPilotGMVehicleLayout(StarPilotPanel): "color": "#64748B", "key": "GMPedalLongitudinal", }, + { + "title": tr_noop("Offsets on Dash Spoof"), + "type": "toggle", + "get_state": lambda: self._params.get_bool("GMDashSpoofOffsets"), + "set_state": lambda s: self._params.put_bool("GMDashSpoofOffsets", s), + "color": "#64748B", + "key": "GMDashSpoofOffsets", + }, { "title": tr_noop("Smooth Pedal on Hills"), "type": "toggle", @@ -288,6 +296,8 @@ class StarPilotGMVehicleLayout(StarPilotPanel): if key == "GMPedalLongitudinal": visible = cs.hasPedal or cs.canUsePedal + elif key == "GMDashSpoofOffsets": + visible = cs.hasPedal or cs.canUsePedal elif key == "VoltSNG": visible = cs.isVolt and not cs.hasSNG diff --git a/selfdrive/ui/ui b/selfdrive/ui/ui index 28fd6323a..8700aaf55 100755 Binary files a/selfdrive/ui/ui and b/selfdrive/ui/ui differ diff --git a/starpilot/common/safe_mode.py b/starpilot/common/safe_mode.py index 0d6c1745b..2a770a470 100644 --- a/starpilot/common/safe_mode.py +++ b/starpilot/common/safe_mode.py @@ -170,6 +170,7 @@ SAFE_MODE_MANAGED_KEYS = ( "SubaruSNG", "VoltSNG", "GMPedalLongitudinal", + "GMDashSpoofOffsets", "LongPitch", "TacoTuneHacks", ) diff --git a/starpilot/common/starpilot_variables.py b/starpilot/common/starpilot_variables.py index c249e05c0..2e9898523 100644 --- a/starpilot/common/starpilot_variables.py +++ b/starpilot/common/starpilot_variables.py @@ -1074,6 +1074,10 @@ class StarPilotVariables: "GMPedalLongitudinal", condition=toggle.car_make == "gm" and toggle.has_pedal, ) + toggle.gm_dash_spoof_offsets = self.get_value( + "GMDashSpoofOffsets", + condition=toggle.car_make == "gm" and toggle.has_pedal, + ) toggle.long_pitch = self.get_value( "LongPitch", condition=toggle.openpilot_longitudinal and toggle.car_make == "gm", diff --git a/starpilot/system/the_pond/assets/components/tools/device_settings_layout.json b/starpilot/system/the_pond/assets/components/tools/device_settings_layout.json index 3c0772990..96ba2a006 100644 --- a/starpilot/system/the_pond/assets/components/tools/device_settings_layout.json +++ b/starpilot/system/the_pond/assets/components/tools/device_settings_layout.json @@ -2016,6 +2016,13 @@ "data_type": "bool", "ui_type": "toggle" }, + { + "key": "GMDashSpoofOffsets", + "label": "Apply Offsets To Dash Spoof", + "description": "On GM pedal-long cars, add the active global set-speed offset or SLC offset to the spoofed dash set speed.", + "data_type": "bool", + "ui_type": "toggle" + }, { "key": "LongPitch", "label": "Smooth Pedal Response on Hills", diff --git a/starpilot/ui/qt/offroad/vehicle_settings.cc b/starpilot/ui/qt/offroad/vehicle_settings.cc index 75cd2ffed..3f589b77a 100644 --- a/starpilot/ui/qt/offroad/vehicle_settings.cc +++ b/starpilot/ui/qt/offroad/vehicle_settings.cc @@ -175,6 +175,7 @@ StarPilotVehiclesPanel::StarPilotVehiclesPanel(StarPilotSettingsWindow *parent, std::vector> vehicleToggles { {"GMToggles", tr("General Motors Settings"), tr("StarPilot features for General Motors vehicles."), ""}, {"GMPedalLongitudinal", tr("Use Pedal For Longitudinal"), tr("Use the pedal interceptor for full longitudinal control on supported GM vehicles."), ""}, + {"GMDashSpoofOffsets", tr("Apply Offsets To Dash Spoof"), tr("On GM pedal-long cars, add the active global set-speed offset or SLC offset to the spoofed dash set speed."), ""}, {"LongPitch", tr("Smooth Pedal Response on Hills"), tr("Smoothen acceleration and braking when driving downhill/uphill."), ""}, {"RemoteStartBootsComma", tr("Remote Start Boots comma"), tr("Use the remote-start GM panda firmware at boot.

Required for GM remote-start startup signal behavior."), ""}, {"RemapCancelToDistance", tr("Remap Cancel To Distance"), tr("On pedal-interceptor Bolts, remap the steering-wheel CANCEL button to distance/personality input."), ""}, @@ -434,6 +435,10 @@ void StarPilotVehiclesPanel::updateToggles() { setVisible &= parent->hasPedal || (Hardware::PC() && parent->canUsePedal); } + else if (key == "GMDashSpoofOffsets") { + setVisible &= parent->hasPedal || (Hardware::PC() && parent->canUsePedal); + } + else if (key == "RemapCancelToDistance") { setVisible &= parent->isBolt && (parent->hasPedal || (Hardware::PC() && parent->canUsePedal)); } diff --git a/starpilot/ui/qt/offroad/vehicle_settings.h b/starpilot/ui/qt/offroad/vehicle_settings.h index 78bd0c495..a09a01a36 100644 --- a/starpilot/ui/qt/offroad/vehicle_settings.h +++ b/starpilot/ui/qt/offroad/vehicle_settings.h @@ -23,9 +23,9 @@ private: std::map toggles; - QSet gmKeys = {"GMPedalLongitudinal", "LongPitch", "RemoteStartBootsComma", "RemapCancelToDistance", "VoltSNG"}; + QSet gmKeys = {"GMPedalLongitudinal", "GMDashSpoofOffsets", "LongPitch", "RemoteStartBootsComma", "RemapCancelToDistance", "VoltSNG"}; QSet hkgKeys = {"TacoTuneHacks"}; - QSet longitudinalKeys = {"FrogsGoMoosTweak", "LongPitch", "RemapCancelToDistance", "SNGHack", "VoltSNG"}; + QSet longitudinalKeys = {"FrogsGoMoosTweak", "GMDashSpoofOffsets", "LongPitch", "RemapCancelToDistance", "SNGHack", "VoltSNG"}; QSet subaruKeys = {"SubaruSNG"}; QSet toyotaKeys = {"ClusterOffset", "FrogsGoMoosTweak", "LockDoorsTimer", "SNGHack", "ToyotaDoors"}; QSet vehicleInfoKeys = {"BlindSpotSupport", "HardwareDetected", "OpenpilotLongitudinal", "PedalSupport", "RadarSupport", "SDSUSupport", "SNGSupport"}; diff --git a/system/camerad/camerad b/system/camerad/camerad index 0bb4cd8a2..76ea77ba3 100755 Binary files a/system/camerad/camerad and b/system/camerad/camerad differ diff --git a/system/loggerd/bootlog b/system/loggerd/bootlog index efea266f2..14a3f52de 100755 Binary files a/system/loggerd/bootlog and b/system/loggerd/bootlog differ diff --git a/system/loggerd/encoderd b/system/loggerd/encoderd index 569016723..9a83a6a6b 100755 Binary files a/system/loggerd/encoderd and b/system/loggerd/encoderd differ diff --git a/system/loggerd/loggerd b/system/loggerd/loggerd index 980559510..e1beb4519 100755 Binary files a/system/loggerd/loggerd and b/system/loggerd/loggerd differ