Always run planner if not opLong

pull/24873/head
Shane Smiskol 3 years ago
parent 13997c5527
commit ff0597ec92
  1. 5
      selfdrive/controls/lib/longitudinal_planner.py

@ -69,8 +69,9 @@ class Planner:
long_control_state = sm['controlsState'].longControlState long_control_state = sm['controlsState'].longControlState
force_slow_decel = sm['controlsState'].forceDecel force_slow_decel = sm['controlsState'].forceDecel
# Reset current state when not engaged, or user is controlling the speed # Reset current state when not engaged or user is controlling the speed
reset_state = long_control_state == LongCtrlState.off # No reset if car is not using openpilot longitudinal (for accurate planner predictions)
reset_state = long_control_state == LongCtrlState.off and self.CP.openpilotLongitudinalControl
# No change cost when user is controlling the speed, or when standstill # No change cost when user is controlling the speed, or when standstill
prev_accel_constraint = not (reset_state or sm['carState'].standstill) prev_accel_constraint = not (reset_state or sm['carState'].standstill)

Loading…
Cancel
Save