diff --git a/CHANGELOG.md b/CHANGELOG.md index 05c6fd5fe..d99c45257 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Added `id` property to waypoints, uniquely identifying waypoints up to half centimetre precision * Added OpenDrive's road offset `s` as property to waypoints * Fixed python client DLL error on Windows + * Fixed cleanup of local_planner when used by other modules ## CARLA 0.9.4 diff --git a/PythonAPI/agents/navigation/local_planner.py b/PythonAPI/agents/navigation/local_planner.py index ff2460f71..bf49650a9 100644 --- a/PythonAPI/agents/navigation/local_planner.py +++ b/PythonAPI/agents/navigation/local_planner.py @@ -79,9 +79,15 @@ class LocalPlanner(object): self.init_controller(opt_dict) def __del__(self): - self._vehicle.destroy() + if self._vehicle: + self._vehicle.destroy() print("Destroying ego-vehicle!") + + def reset_vehicle(self): + self._vehicle = None + print("Resetting ego-vehicle!") + def init_controller(self, opt_dict): """ Controller initialization.