mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-08 09:03:42 +08:00
bug fix hem to stop
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user