From d64d85969b1ffb0aa1e14f421decc7904102d0d9 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 10 Sep 2024 16:00:38 +0200 Subject: [PATCH] Replaced deprecated is_intersection with is_junction --- no_rendering_mode.py | 4 ++-- srunner/scenariomanager/carla_data_provider.py | 2 +- .../scenariomanager/scenarioatomics/atomic_criteria.py | 4 ++-- .../scenarioatomics/atomic_trigger_conditions.py | 2 +- srunner/scenarios/maneuver_opposite_direction.py | 2 +- srunner/tools/scenario_helper.py | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/no_rendering_mode.py b/no_rendering_mode.py index ec24d1dab..565d19c3c 100755 --- a/no_rendering_mode.py +++ b/no_rendering_mode.py @@ -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, @@ -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: diff --git a/srunner/scenariomanager/carla_data_provider.py b/srunner/scenariomanager/carla_data_provider.py index 9e5e23d39..4e7999c48 100644 --- a/srunner/scenariomanager/carla_data_provider.py +++ b/srunner/scenariomanager/carla_data_provider.py @@ -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] diff --git a/srunner/scenariomanager/scenarioatomics/atomic_criteria.py b/srunner/scenariomanager/scenarioatomics/atomic_criteria.py index 45dc96115..6976af07d 100644 --- a/srunner/scenariomanager/scenarioatomics/atomic_criteria.py +++ b/srunner/scenariomanager/scenarioatomics/atomic_criteria.py @@ -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 diff --git a/srunner/scenariomanager/scenarioatomics/atomic_trigger_conditions.py b/srunner/scenariomanager/scenarioatomics/atomic_trigger_conditions.py index ffa9f0f37..51a3892ae 100644 --- a/srunner/scenariomanager/scenarioatomics/atomic_trigger_conditions.py +++ b/srunner/scenariomanager/scenarioatomics/atomic_trigger_conditions.py @@ -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 diff --git a/srunner/scenarios/maneuver_opposite_direction.py b/srunner/scenarios/maneuver_opposite_direction.py index 8e7575193..7b9059035 100644 --- a/srunner/scenarios/maneuver_opposite_direction.py +++ b/srunner/scenarios/maneuver_opposite_direction.py @@ -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 diff --git a/srunner/tools/scenario_helper.py b/srunner/tools/scenario_helper.py index 4aa03b641..1a9a8e42a 100644 --- a/srunner/tools/scenario_helper.py +++ b/srunner/tools/scenario_helper.py @@ -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, @@ -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 @@ -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] @@ -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] @@ -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]