Skip to content

Commit ff0597e

Browse files
committed
Always run planner if not opLong
1 parent 13997c5 commit ff0597e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

selfdrive/controls/lib/longitudinal_planner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ def update(self, sm):
6969
long_control_state = sm['controlsState'].longControlState
7070
force_slow_decel = sm['controlsState'].forceDecel
7171

72-
# Reset current state when not engaged, or user is controlling the speed
73-
reset_state = long_control_state == LongCtrlState.off
72+
# Reset current state when not engaged or user is controlling the speed
73+
# No reset if car is not using openpilot longitudinal (for accurate planner predictions)
74+
reset_state = long_control_state == LongCtrlState.off and self.CP.openpilotLongitudinalControl
7475

7576
# No change cost when user is controlling the speed, or when standstill
7677
prev_accel_constraint = not (reset_state or sm['carState'].standstill)

0 commit comments

Comments
 (0)