Display openpilot logics for following lead vehicles
Added toggle to show openpilot's logic in regards to following lead vehicles.
This commit is contained in:
@@ -373,6 +373,16 @@ class LongitudinalMpc:
|
||||
else:
|
||||
self.acceleration_offset = 1
|
||||
|
||||
# LongitudinalPlan variables for onroad driving insights
|
||||
if self.status:
|
||||
self.safe_obstacle_distance = int(np.mean(get_safe_obstacle_distance(v_ego, t_follow)))
|
||||
self.safe_obstacle_distance_stock = int(np.mean(get_safe_obstacle_distance(v_ego, self.t_follow)))
|
||||
self.stopped_equivalence_factor = int(np.mean(get_stopped_equivalence_factor(lead_xv_0[:,1])))
|
||||
else:
|
||||
self.safe_obstacle_distance = 0
|
||||
self.safe_obstacle_distance_stock = 0
|
||||
self.stopped_equivalence_factor = 0
|
||||
|
||||
# To estimate a safe distance from a moving lead, we calculate how much stopping
|
||||
# distance that lead needs as a minimum. We can add that to the current distance
|
||||
# and then treat that as a stopped car/obstacle at this new distance.
|
||||
|
||||
Reference in New Issue
Block a user