Allow observed detours to join advisory route segments
This commit is contained in:
@@ -424,10 +424,13 @@ class RoutedMission(WaypointMission):
|
||||
return None
|
||||
adjacent = segments[self.segment_index : self.segment_index + 2]
|
||||
if adjacent[0].get("guidance_only"):
|
||||
along, lateral = projection(pose[:2], adjacent[0]["start_xy"], adjacent[0]["end_xy"])
|
||||
along, _ = projection(pose[:2], adjacent[0]["start_xy"], adjacent[0]["end_xy"])
|
||||
length = math.dist(adjacent[0]["start_xy"], adjacent[0]["end_xy"])
|
||||
# A soft line must not allow instant graph progress at a distance.
|
||||
if length - along > 1.5 or lateral > max(2., adjacent[0]["half_width_m"]):
|
||||
# Use the same local observation radius as the native support
|
||||
# query. An advisory line's width is not a travel boundary: a
|
||||
# positively observed detour may join the next segment off-centre.
|
||||
# Progress and proximity still prevent remote/skipped joints.
|
||||
if length - along > 1.5 or math.dist(pose[:2], adjacent[0]["end_xy"]) > 3.5:
|
||||
return None
|
||||
directions = [np.asarray(s["end_xy"]) - s["start_xy"] for s in adjacent]
|
||||
# A reversal is a visit and return, not a corner that can be cut.
|
||||
|
||||
Reference in New Issue
Block a user