From fed4ce6ee0dfa547c897aeaaf688f510d07fcfc4 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Thu, 3 Sep 2026 15:22:26 -0500 Subject: [PATCH] cleanup Original PRs: #115, #116, #117, and #118 by @1454 --- opendbc_repo/opendbc/car/gm/carcontroller.py | 2 -- opendbc_repo/opendbc/car/gm/interface.py | 1 - selfdrive/controls/lib/longitudinal_planner.py | 6 ------ selfdrive/controls/tests/test_longitudinal_planner.py | 1 - selfdrive/ui/soundd.py | 1 - starpilot/controls/lib/starpilot_following.py | 1 - 6 files changed, 12 deletions(-) diff --git a/opendbc_repo/opendbc/car/gm/carcontroller.py b/opendbc_repo/opendbc/car/gm/carcontroller.py index 05d233b98..ca7da73bd 100644 --- a/opendbc_repo/opendbc/car/gm/carcontroller.py +++ b/opendbc_repo/opendbc/car/gm/carcontroller.py @@ -260,8 +260,6 @@ MAX_UPHILL_GRADE_FF = 0.20 def limit_grade_feedforward(planner_accel: float, pitch_accel: float) -> float: - # Planner already closed-loops hill sag. Stacking full g*sin(pitch) on a - # positive command is what kick-downs 10-speed trucks. if pitch_accel > 0.0 and planner_accel > 0.0: return 0.0 if pitch_accel > MAX_UPHILL_GRADE_FF: diff --git a/opendbc_repo/opendbc/car/gm/interface.py b/opendbc_repo/opendbc/car/gm/interface.py index a4f7391a2..17023e47a 100755 --- a/opendbc_repo/opendbc/car/gm/interface.py +++ b/opendbc_repo/opendbc/car/gm/interface.py @@ -500,7 +500,6 @@ class CarInterface(CarInterfaceBase): ret.flags |= GMFlags.PEDAL_LONG.value elif candidate in (CAR.CHEVROLET_SILVERADO, CAR.CHEVROLET_SILVERADO_CC): - # Let stock Silverado ACC decide whether standstill engagement is valid. ret.minEnableSpeed = 0. CarInterfaceBase.configure_torque_tune(candidate, ret.lateralTuning) diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py index b615199f2..01ed01f4b 100755 --- a/selfdrive/controls/lib/longitudinal_planner.py +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -291,8 +291,6 @@ EXPERIMENTAL_RELEASE_ACCEL_MAX_LATERAL_OFFSET = 1.5 EXPERIMENTAL_RELEASE_ACCEL_MIN_HEADWAY_MARGIN = 0.0 EXPERIMENTAL_RELEASE_ACCEL_MIN_DELTA_A = 0.12 EXPERIMENTAL_RELEASE_ACCEL_STEP = 0.06 -# Last few mph below CESpeed/CESpeedLead: mix MPC back in so experimental -# cannot crawl into the breakpoint and then snap to ACC. EXPERIMENTAL_SPEED_HANDOFF_BAND = 5.0 * CV.MPH_TO_MS EXPERIMENTAL_HANDOFF_KEEP_E2E_BRAKE = -0.15 MATCHED_FOLLOW_TRANSITION_MIN_SPEED = 20.0 @@ -1798,16 +1796,12 @@ class LongitudinalPlanner: @staticmethod def is_cem_following_lead(tracking_lead, d_rel, t_follow, v_ego): - # Same inputs as StarPilotFollowing.following_lead / CEM: published - # trackingLead and tFollow, plus leadOne.dRel inside 2*t_follow*v_ego. return bool(tracking_lead and float(d_rel) < (float(t_follow) * 2.0) * float(v_ego)) @staticmethod def apply_experimental_speed_handoff(output_a_target, output_a_target_mpc, output_a_target_e2e, speed_handoff): if speed_handoff <= 0.0: return output_a_target - # Keep a real E2E brake. Only mix MPC back in when experimental is crawling - # or matching ACC, not when it is already asking for more deceleration. if output_a_target_e2e < min(output_a_target_mpc, EXPERIMENTAL_HANDOFF_KEEP_E2E_BRAKE): return output_a_target return (1.0 - speed_handoff) * output_a_target + speed_handoff * output_a_target_mpc diff --git a/selfdrive/controls/tests/test_longitudinal_planner.py b/selfdrive/controls/tests/test_longitudinal_planner.py index cb65d8997..7ee9b018a 100644 --- a/selfdrive/controls/tests/test_longitudinal_planner.py +++ b/selfdrive/controls/tests/test_longitudinal_planner.py @@ -3732,7 +3732,6 @@ def test_experimental_speed_handoff_keeps_stronger_e2e_brake(): def test_experimental_speed_handoff_following_lead_matches_cem_window(): - # Distant radar-active lead is not CEM following_lead. assert LongitudinalPlanner.is_cem_following_lead(True, 40.0, 1.5, 20.0) assert not LongitudinalPlanner.is_cem_following_lead(True, 80.0, 1.5, 20.0) assert not LongitudinalPlanner.is_cem_following_lead(False, 10.0, 1.5, 20.0) diff --git a/selfdrive/ui/soundd.py b/selfdrive/ui/soundd.py index 087710fc4..360c6f77d 100644 --- a/selfdrive/ui/soundd.py +++ b/selfdrive/ui/soundd.py @@ -205,7 +205,6 @@ class Soundd: def load_sounds(self): self.loaded_sounds: dict[int, np.ndarray] = {} - # Load all sounds. Prefer theme/random-event clips, then packaged stock. for sound in sound_list: filename, play_count, volume = sound_list[sound] loaded = False diff --git a/starpilot/controls/lib/starpilot_following.py b/starpilot/controls/lib/starpilot_following.py index ea96a5599..d7edc1d0a 100644 --- a/starpilot/controls/lib/starpilot_following.py +++ b/starpilot/controls/lib/starpilot_following.py @@ -108,7 +108,6 @@ class StarPilotFollowing: self.update_lane_change_gap(long_control_active, v_ego, sm, starpilot_toggles) - # After t_follow adjustments so CEM and the published tFollow use the same window. self.following_lead = self.starpilot_planner.tracking_lead and self.starpilot_planner.lead_one.dRel < (self.t_follow * 2) * v_ego self.disable_throttle = False