carla
carla copied to clipboard
Make `carla.libcarla.Map` pickable for usage of deepcopy?
CARLA version: 0.9.13 Platform/OS: Windows x64 Problem you have experienced: can't pickle the Map object of carla What you expected to happen: make it pickable Steps to reproduce: create a class that contains a carla.Map and try to deepcopy it.
i currently have a list ob objects that contain each a carla.Map object reference. Now when i apply changes to a object in the list i need to deepcopy it, as i dont want to change the object inside the list but a copy of it. The deepcopy sadly fails with the error message that carla.libcarla.Map
is not pickable
Error:
RuntimeError: Pickling of "carla.libcarla.Map" instances is not enabled (http://www.boost.org/libs/python/doc/v2/pickle.html)
What would be a workaround for this or fix? Can we make the Map object pickable? I sadly can't really change the structure of my code as i need the Map in each object of the list.
Did a workaround by overwriting the deepcopy() function of my object to create a copy of the object with deepcopy and adding the references also to the new object without deepcopy