From 4a84a52047a1c31fef968ab44b59df8e4c436655 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 12 Apr 2024 16:32:37 +0200 Subject: [PATCH] Disambiguated get_waypoint signature Syntax fix (squased) --- PythonAPI/carla/source/carla/libcarla.pyi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/PythonAPI/carla/source/carla/libcarla.pyi b/PythonAPI/carla/source/carla/libcarla.pyi index 590d8df08..0b5b5074c 100644 --- a/PythonAPI/carla/source/carla/libcarla.pyi +++ b/PythonAPI/carla/source/carla/libcarla.pyi @@ -2412,6 +2412,11 @@ class Map(): """ ... + @overload + def get_waypoint(self, location: Location, project_to_road=False, lane_type=LaneType.Driving) -> Waypoint | None: + ... + + @overload def get_waypoint(self, location: Location, project_to_road=True, lane_type=LaneType.Driving) -> Waypoint: """Returns a waypoint that can be located in an exact location or translated to the center of the nearest lane. Said lane type can be defined using flags such as `LaneType.Driving & LaneType.Shoulder`. @@ -2424,7 +2429,7 @@ class Map(): """ ... - def get_waypoint_xodr(self, road_id: int, lane_id: int, s: float) -> Waypoint: + def get_waypoint_xodr(self, road_id: int, lane_id: int, s: float) -> Waypoint | None: """Returns a waypoint if all the parameters passed are correct. Otherwise, returns `None`. Args: