From a8f5a9834ab45618d8df1bb414ace205dcefcd3b Mon Sep 17 00:00:00 2001 From: Harald Schafer Date: Thu, 12 Nov 2020 10:21:27 -0800 Subject: [PATCH] update comments old-commit-hash: 69077145100242a72d9725e04b3d7808300f8abb --- selfdrive/controls/lib/lane_planner.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/selfdrive/controls/lib/lane_planner.py b/selfdrive/controls/lib/lane_planner.py index 8526073ea4..789ef8571f 100644 --- a/selfdrive/controls/lib/lane_planner.py +++ b/selfdrive/controls/lib/lane_planner.py @@ -67,9 +67,8 @@ class LanePlanner: self.l_poly[3] += CAMERA_OFFSET self.r_poly[3] += CAMERA_OFFSET - # Find current lanewidth - # This will improve behaviour when lanes suddenly widen - # these numbers were tested on 2000 segments and found to work well + # Reduce reliance on lanelines that are too far apart or + # will be in a few seconds l_prob, r_prob = self.l_prob, self.r_prob width_poly = self.l_poly - self.r_poly prob_mods = [] @@ -80,13 +79,13 @@ class LanePlanner: l_prob *= mod r_prob *= mod - # Remove reliance on uncertain lanelines - # these numbers were tested on 2000 segments and found to work well + # Reduce reliance on uncertain lanelines l_std_mod = interp(self.l_std, [.15, .3], [1.0, 0.0]) r_std_mod = interp(self.r_std, [.15, .3], [1.0, 0.0]) l_prob *= l_std_mod r_prob *= r_std_mod + # Find current lanewidth self.lane_width_certainty += 0.05 * (l_prob * r_prob - self.lane_width_certainty) current_lane_width = abs(self.l_poly[3] - self.r_poly[3]) self.lane_width_estimate += 0.005 * (current_lane_width - self.lane_width_estimate)