mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-25 07:52:03 +08:00
controls: only send cruise cancel while cruise is enabled (#22359)
* controls: only send cruise cancel while cruise is enabled * cleanup * might actually do something * update refs * update refs again * update refs
This commit is contained in:
@@ -122,15 +122,6 @@ class CarController():
|
||||
# *** apply brake hysteresis ***
|
||||
pre_limit_brake, self.braking, self.brake_steady = actuator_hystereses(brake, self.braking, self.brake_steady, CS.out.vEgo, CS.CP.carFingerprint)
|
||||
|
||||
# *** no output if not enabled ***
|
||||
if not enabled and CS.out.cruiseState.enabled:
|
||||
# send pcm acc cancel cmd if drive is disabled but pcm is still on, or if the system can't be activated
|
||||
pcm_cancel_cmd = True
|
||||
|
||||
# Never send cancel command if we never enter cruise state (no cruise if pedal)
|
||||
# Cancel cmd causes brakes to release at a standstill causing grinding
|
||||
pcm_cancel_cmd = pcm_cancel_cmd and CS.CP.pcmCruise
|
||||
|
||||
# *** rate limit after the enable check ***
|
||||
self.brake_last = rate_limit(pre_limit_brake, self.brake_last, -2., DT_CTRL)
|
||||
|
||||
|
||||
@@ -75,8 +75,9 @@ class CarController():
|
||||
else:
|
||||
apply_steer_req = 1
|
||||
|
||||
# TODO: probably can delete this. CS.pcm_acc_status uses a different signal
|
||||
# than CS.cruiseState.enabled. confirm they're not meaningfully different
|
||||
if not enabled and CS.pcm_acc_status:
|
||||
# send pcm acc cancel cmd if drive is disabled but pcm is still on, or if the system can't be activated
|
||||
pcm_cancel_cmd = 1
|
||||
|
||||
# on entering standstill, send standstill request
|
||||
|
||||
@@ -525,7 +525,7 @@ class Controls:
|
||||
CC.enabled = self.enabled
|
||||
CC.actuators = actuators
|
||||
|
||||
CC.cruiseControl.cancel = not self.CP.pcmCruise or (not self.enabled and CS.cruiseState.enabled)
|
||||
CC.cruiseControl.cancel = CS.cruiseState.enabled and (not self.enabled or not self.CP.pcmCruise)
|
||||
if self.joystick_mode and self.sm.rcv_frame['testJoystick'] > 0 and self.sm['testJoystick'].buttons[0]:
|
||||
CC.cruiseControl.cancel = True
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
2282e3f208438237fe61d7bf636d6ad6b507c571
|
||||
859486fc7698fc2c0de0b52854a38e6c08954204
|
||||
Reference in New Issue
Block a user