From 737a79e5560816f1ef852eb42f761af86f57a55c Mon Sep 17 00:00:00 2001 From: sshane Date: Wed, 11 Aug 2021 01:33:59 -0700 Subject: [PATCH] longitudinal comments (#21898) * cmt * Update longcontrol.py --- selfdrive/controls/lib/longcontrol.py | 2 +- selfdrive/controls/lib/longitudinal_planner.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/controls/lib/longcontrol.py b/selfdrive/controls/lib/longcontrol.py index 695615e0e8..359f992667 100644 --- a/selfdrive/controls/lib/longcontrol.py +++ b/selfdrive/controls/lib/longcontrol.py @@ -72,7 +72,7 @@ class LongControl(): def update(self, active, CS, CP, long_plan): """Update longitudinal control. This updates the state machine and runs a PID loop""" # Interp control trajectory - # TODO estimate car specific lag, use .5s for now + # TODO estimate car specific lag, use .15s for now if len(long_plan.speeds) == CONTROL_N: v_target = interp(DEFAULT_LONG_LAG, T_IDXS[:CONTROL_N], long_plan.speeds) v_target_future = long_plan.speeds[-1] diff --git a/selfdrive/controls/lib/longitudinal_planner.py b/selfdrive/controls/lib/longitudinal_planner.py index 643cefd7a1..cab3e20aa3 100755 --- a/selfdrive/controls/lib/longitudinal_planner.py +++ b/selfdrive/controls/lib/longitudinal_planner.py @@ -105,7 +105,7 @@ class Planner(): for key in self.mpcs: self.mpcs[key].set_cur_state(self.v_desired, self.a_desired) self.mpcs[key].update(sm['carState'], sm['radarState'], v_cruise) - if self.mpcs[key].status and self.mpcs[key].a_solution[5] < next_a: + if self.mpcs[key].status and self.mpcs[key].a_solution[5] < next_a: # picks slowest solution from accel in ~0.2 seconds self.longitudinalPlanSource = key self.v_desired_trajectory = self.mpcs[key].v_solution[:CONTROL_N] self.a_desired_trajectory = self.mpcs[key].a_solution[:CONTROL_N]