diff --git a/selfdrive/controls/lib/planner.py b/selfdrive/controls/lib/planner.py index dd9343bda9da2f..0e47860da6dcee 100755 --- a/selfdrive/controls/lib/planner.py +++ b/selfdrive/controls/lib/planner.py @@ -427,12 +427,12 @@ def update(self, CS, CP, VM, PP, live20, live100, md, live_map_data): self.lead_1 = live20.live20.leadOne self.lead_2 = live20.live20.leadTwo - longitudinal_mpc = LongitudinalMpc() + try: - longitudinal_mpc.get_relative_velocity(self.lead_1.vRel) + LongitudinalMpc.get_relative_velocity(self.lead_1.vRel) except: #if no lead car try: - longitudinal_mpc.get_relative_velocity(0.0) + LongitudinalMpc.get_relative_velocity(0.0) except TypeError: None