diff --git a/CHANGELOG.md b/CHANGELOG.md index 35994951e..4b307d469 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Added functions to get actor' bones and components names * Added functions to get actor' sockets transforms * make PythonAPI Windows: Fixed incompatibility issue with Anaconda due `py` command. + * Fixed bug in python agents when vehicle list was empty causing a check on all vehicles (BasicAgent.py) and detected pedestrians as vehicles if no pedestrains are present (BehaviourAgent.py) ## CARLA 0.9.15 diff --git a/PythonAPI/carla/agents/navigation/basic_agent.py b/PythonAPI/carla/agents/navigation/basic_agent.py index 093749d5a..44e6d0351 100644 --- a/PythonAPI/carla/agents/navigation/basic_agent.py +++ b/PythonAPI/carla/agents/navigation/basic_agent.py @@ -345,12 +345,14 @@ class BasicAgent(object): return None return Polygon(route_bb) - + if self._ignore_vehicles: return (False, None, -1) - if not vehicle_list: + if vehicle_list is None: vehicle_list = self._world.get_actors().filter("*vehicle*") + if len(vehicle_list) == 0: + return (False, None, -1) if not max_distance: max_distance = self._base_vehicle_threshold