Draw adjacent paths in onroad UI

Added toggle to draw the adjacent paths in the onroad UI to visualize what other lanes the model sees.
This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent 44fc5c1f30
commit 0a675d40aa
8 changed files with 64 additions and 2 deletions

View File

@@ -57,7 +57,7 @@ class FrogPilotPlanner:
self.cem.update(carState, enabled, sm['frogpilotNavigation'], modelData, sm['radarState'], self.road_curvature, self.stop_distance, mpc.t_follow, v_ego)
# Update the current lane widths
check_lane_width = self.blind_spot_path
check_lane_width = self.adjacent_lanes or self.blind_spot_path
if check_lane_width and v_ego >= LANE_CHANGE_SPEED_MIN:
self.lane_width_left = float(self.fpf.calculate_lane_width(modelData.laneLines[0], modelData.laneLines[1], modelData.roadEdges[0]))
self.lane_width_right = float(self.fpf.calculate_lane_width(modelData.laneLines[3], modelData.laneLines[2], modelData.roadEdges[1]))
@@ -121,6 +121,7 @@ class FrogPilotPlanner:
self.relaxed_jerk = params.get_float("RelaxedJerk")
custom_ui = params.get_bool("CustomUI")
self.adjacent_lanes = custom_ui and params.get_bool("AdjacentPath")
self.blind_spot_path = custom_ui and params.get_bool("BlindSpotPath")
longitudinal_tune = params.get_bool("LongitudinalTune")