Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated deprecated Waypoint.is_intersection to is_junction #1114

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions no_rendering_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ def draw_topology(carla_topology, index):
True)

# Draw Lane Markings and Arrows
if not waypoint.is_intersection:
if not waypoint.is_junction:
draw_lane_marking(
map_surface,
waypoints,
Expand All @@ -725,7 +725,7 @@ def draw_topology(carla_topology, index):
dist = 1.5
to_pixel = lambda wp: world_to_pixel(wp.transform.location)
for wp in carla_map.generate_waypoints(dist):
col = (0, 255, 255) if wp.is_intersection else (0, 255, 0)
col = (0, 255, 255) if wp.is_junction else (0, 255, 0)
for nxt in wp.next(dist):
pygame.draw.line(map_surface, col, to_pixel(wp), to_pixel(nxt), 2)
if wp.lane_change & carla.LaneChange.Right:
Expand Down
2 changes: 1 addition & 1 deletion srunner/scenariomanager/carla_data_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def get_next_traffic_light(actor, use_cached_location=True):
waypoint = CarlaDataProvider.get_map().get_waypoint(location)
# Create list of all waypoints until next intersection
list_of_waypoints = []
while waypoint and not waypoint.is_intersection:
while waypoint and not waypoint.is_junction:
list_of_waypoints.append(waypoint)
waypoint = waypoint.next(2.0)[0]

Expand Down
4 changes: 2 additions & 2 deletions srunner/scenariomanager/scenarioatomics/atomic_criteria.py
Original file line number Diff line number Diff line change
Expand Up @@ -1785,9 +1785,9 @@ def get_traffic_light_waypoints(self, traffic_light):
# Advance them until the intersection
wps = []
for wpx in ini_wps:
while not wpx.is_intersection:
while not wpx.is_junction:
next_wp = wpx.next(0.5)[0]
if next_wp and not next_wp.is_intersection:
if next_wp and not next_wp.is_junction:
wpx = next_wp
else:
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ def __init__(self, actor, distance, name="InTriggerDistanceToNextIntersection"):
self._map = CarlaDataProvider.get_map()

waypoint = self._map.get_waypoint(self._actor.get_location())
while waypoint and not waypoint.is_intersection:
while waypoint and not waypoint.is_junction:
waypoint = waypoint.next(1)[-1]

self._final_location = waypoint.transform.location
Expand Down
2 changes: 1 addition & 1 deletion srunner/scenarios/maneuver_opposite_direction.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _initialize_actors(self, config):

self._source_transform = second_actor_waypoint.transform
sink_waypoint = second_actor_waypoint.next(1)[0]
while not sink_waypoint.is_intersection:
while not sink_waypoint.is_junction:
sink_waypoint = sink_waypoint.next(1)[0]
self._sink_location = sink_waypoint.transform.location

Expand Down
10 changes: 5 additions & 5 deletions srunner/tools/scenario_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def get_crossing_point(actor):
"""
wp_cross = CarlaDataProvider.get_map().get_waypoint(actor.get_location())

while not wp_cross.is_intersection:
while not wp_cross.is_junction:
wp_cross = wp_cross.next(2)[0]

crossing = carla.Location(x=wp_cross.transform.location.x,
Expand Down Expand Up @@ -197,7 +197,7 @@ def get_location_in_distance(actor, distance):
"""
waypoint = CarlaDataProvider.get_map().get_waypoint(actor.get_location())
traveled_distance = 0
while not waypoint.is_intersection and traveled_distance < distance:
while not waypoint.is_junction and traveled_distance < distance:
waypoint_new = waypoint.next(1.0)[-1]
traveled_distance += waypoint_new.transform.location.distance(waypoint.transform.location)
waypoint = waypoint_new
Expand All @@ -213,7 +213,7 @@ def get_location_in_distance_from_wp(waypoint, distance, stop_at_junction=True):
@return obtained location and the traveled distance
"""
traveled_distance = 0
while not (waypoint.is_intersection and stop_at_junction) and traveled_distance < distance:
while not (waypoint.is_junction and stop_at_junction) and traveled_distance < distance:
wp_next = waypoint.next(1.0)
if wp_next:
waypoint_new = wp_next[-1]
Expand All @@ -232,7 +232,7 @@ def get_waypoint_in_distance(waypoint, distance, stop_at_junction=True):
@return obtained waypoint and the traveled distance
"""
traveled_distance = 0
while not (waypoint.is_intersection and stop_at_junction) and traveled_distance < distance:
while not (waypoint.is_junction and stop_at_junction) and traveled_distance < distance:
wp_next = waypoint.next(1.0)
if wp_next:
waypoint_new = wp_next[-1]
Expand Down Expand Up @@ -273,7 +273,7 @@ def generate_target_waypoint_list(waypoint, turn=0):
np.dot(v_1, v_2) / abs((np.linalg.norm(v_1) * np.linalg.norm(v_2))))
if angle_wp < threshold:
break
elif reached_junction and not plan[-1][0].is_intersection:
elif reached_junction and not plan[-1][0].is_junction:
break

return plan, plan[-1][0]
Expand Down
Loading