Minor fixes

This commit is contained in:
Guillermo 2021-07-02 11:37:20 +02:00 committed by bernat
parent e930958297
commit 1408f6de53
2 changed files with 6 additions and 4 deletions

View File

@ -33,7 +33,9 @@ class GlobalRoutePlanner(object):
This method traces a route between a starting and ending point. This method traces a route between a starting and ending point.
IF 'with_options' is True (deafult behavior), returns a list of [carla.Waypoint, RoadOption], IF 'with_options' is True (deafult behavior), returns a list of [carla.Waypoint, RoadOption],
being RoadOption a high level represnetation of what the direction of the route. being RoadOption a high level represnetation of what the direction of the route.
If 'with_options' is False, the road options are computed, returning a list of carla.Waypoint If 'with_options' is False, the road options are computed, returning a list of carla.Waypoint.
This might be interseting, for example, when computing a route in chunks, getting all the waypoint
first and then adding the options
:param origin (carla.Waypoint): starting point of the route :param origin (carla.Waypoint): starting point of the route
:param destination (carla.Waypoint): ending point of the route :param destination (carla.Waypoint): ending point of the route
@ -120,7 +122,7 @@ class GlobalRoutePlanner(object):
else: else:
dot = 1 dot = 1
if 0 < dot < math.cos(math.radians(45)): if dot < math.cos(math.radians(45)):
if lane_change_type: if lane_change_type:
# Last lane change waypoint # Last lane change waypoint
new_option = lane_change_type new_option = lane_change_type

View File

@ -308,13 +308,13 @@ def _retrieve_options(list_waypoints, current_waypoint):
# the beggining of an intersection, therefore the # the beggining of an intersection, therefore the
# variation in angle is small # variation in angle is small
next_next_waypoint = next_waypoint.next(3.0)[0] next_next_waypoint = next_waypoint.next(3.0)[0]
link = compute_connection(current_waypoint, next_next_waypoint) link = _compute_connection(current_waypoint, next_next_waypoint)
options.append(link) options.append(link)
return options return options
def compute_connection(current_waypoint, next_waypoint, threshold=35): def _compute_connection(current_waypoint, next_waypoint, threshold=35):
""" """
Compute the type of topological connection between an active waypoint (current_waypoint) and a target waypoint Compute the type of topological connection between an active waypoint (current_waypoint) and a target waypoint
(next_waypoint). (next_waypoint).