diff --git a/starpilot/controls/lib/hybrid_experimental_mode.py b/starpilot/controls/lib/hybrid_experimental_mode.py index ca915ff4f..b99b3f1fe 100644 --- a/starpilot/controls/lib/hybrid_experimental_mode.py +++ b/starpilot/controls/lib/hybrid_experimental_mode.py @@ -27,7 +27,7 @@ class HybridExperimentalMode: self.prev_a_target = 0.0 self.last_exp_dominant = False self.diag = {} - self.record_diag = False + self.record_diag = True # Tunings self.HYBRID_EXP_BIAS = 0.0 @@ -107,8 +107,8 @@ class HybridExperimentalMode: a_brake_fused = min(a_chill, a_exp) a_throttle_fused = a_chill + max(0.0, a_exp - a_chill) * self.HYBRID_EXP_BIAS - # Output Arbitration - is_stopping_event = (self.w_vision > 0.3) or horizon_stopping + stop_requested = bool(should_stop_chill or should_stop_exp) + is_stopping_event = stop_requested or (self.w_vision > 0.2) or horizon_stopping self.last_exp_dominant = bool(is_stopping_event and not is_departing) if self.last_exp_dominant: diff --git a/starpilot/controls/tests/test_hybrid_experimental_mode.py b/starpilot/controls/tests/test_hybrid_experimental_mode.py index 8a90d6187..11cf5ebce 100644 --- a/starpilot/controls/tests/test_hybrid_experimental_mode.py +++ b/starpilot/controls/tests/test_hybrid_experimental_mode.py @@ -231,6 +231,15 @@ def test_should_stop_chill_handshake(): assert should_stop, "should_stop_chill must propagate into the fused stop flag" +def test_should_stop_chill_engages_braking_regime_without_vision(): + controller = make_controller(prev=0.0) + model = FakeModel(velocity=[20.0] * 33) + a, should_stop = controller.update(20.0, 25.0, FakeLead(), model, 0.0, -1.5, should_stop_chill=True) + assert controller.last_exp_dominant, "should_stop_chill must engage the braking regime" + assert a == pytest.approx(-1.5, abs=1e-3), f"Must command exp braking on planner stop, got {a}" + assert should_stop + + def test_should_stop_exp_handshake(): controller = make_controller(prev=0.0) model = FakeModel(velocity=[5.0] * 33)