parent
358cdaaefd
commit
737a79e556
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue