Skip to content

Commit

Permalink
long_mpc: fix e2e source condition (commaai#26546)
Browse files Browse the repository at this point in the history
* fix long_mpc source param

* rm print

* add back space for formatting
  • Loading branch information
YassineYousfi authored Nov 21, 2022
1 parent 5b8f0db commit ded66e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion selfdrive/controls/lib/longitudinal_mpc_lib/long_mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def update(self, carstate, radarstate, v_cruise, x, v, a, j):
x_and_cruise = np.column_stack([x, cruise_target])
x = np.min(x_and_cruise, axis=1)

self.source = 'e2e' if x_and_cruise[0,0] < x_and_cruise[0,1] else 'cruise'
self.source = 'e2e' if x_and_cruise[1,0] < x_and_cruise[1,1] else 'cruise'

else:
raise NotImplementedError(f'Planner mode {self.mode} not recognized in planner update')
Expand Down

0 comments on commit ded66e6

Please sign in to comment.