Added constant at local_planner

This commit is contained in:
Guillermo 2020-02-17 09:55:06 +01:00 committed by bernat
parent 6db23f2d4e
commit 88f82081fc
1 changed files with 2 additions and 2 deletions

View File

@ -267,7 +267,7 @@ def _retrieve_options(list_waypoints, current_waypoint):
return options
def _compute_connection(current_waypoint, next_waypoint):
def _compute_connection(current_waypoint, next_waypoint, threshold=20):
"""
Compute the type of topological connection between an active waypoint (current_waypoint) and a target waypoint
(next_waypoint).
@ -286,7 +286,7 @@ def _compute_connection(current_waypoint, next_waypoint):
c = c % 360.0
diff_angle = (n - c) % 180.0
if diff_angle < 20.0 or diff_angle > 160.0:
if diff_angle < threshold or diff_angle > (180 - threshold):
return RoadOption.STRAIGHT
elif diff_angle > 90.0:
return RoadOption.LEFT