From ff0597ec92a0d2c52915316961ec123b0183c5cf Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 21 Jun 2022 11:34:00 -0700 Subject: [PATCH] Always run planner if not opLong --- selfdrive/controls/lib/longitudinal_planner.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py index d4a6aaef8f..0a105566b0 100755 --- a/selfdrive/controls/lib/longitudinal_planner.py +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -69,8 +69,9 @@ class Planner: long_control_state = sm['controlsState'].longControlState force_slow_decel = sm['controlsState'].forceDecel - # Reset current state when not engaged, or user is controlling the speed - reset_state = long_control_state == LongCtrlState.off + # Reset current state when not engaged or user is controlling the speed + # 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 prev_accel_constraint = not (reset_state or sm['carState'].standstill)