diff --git a/selfdrive/controls/lib/planner.py b/selfdrive/controls/lib/planner.py index 57ef6e56e612e6..dd9343bda9da2f 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: - LongitudinalMpc().get_relative_velocity(self.lead_1.vRel) + longitudinal_mpc.get_relative_velocity(self.lead_1.vRel) except: #if no lead car try: - LongitudinalMpc().get_relative_velocity(0.0) + longitudinal_mpc.get_relative_velocity(0.0) except TypeError: None