File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -137,18 +137,24 @@ def on_carla_tick():
137
137
Callback from CARLA
138
138
"""
139
139
with CarlaDataProvider ._lock :
140
- for actor in CarlaDataProvider ._actor_velocity_map :
140
+ for actor in CarlaDataProvider ._actor_velocity_map . copy () :
141
141
if actor is not None and actor .is_alive :
142
142
CarlaDataProvider ._actor_velocity_map [actor ] = calculate_velocity (actor )
143
+ else :
144
+ del CarlaDataProvider ._actor_velocity_map [actor ]
143
145
144
- for actor in CarlaDataProvider ._actor_location_map :
146
+ for actor in CarlaDataProvider ._actor_location_map . copy () :
145
147
if actor is not None and actor .is_alive :
146
148
CarlaDataProvider ._actor_location_map [actor ] = actor .get_location ()
149
+ else :
150
+ del CarlaDataProvider ._actor_location_map [actor ]
147
151
148
- for actor in CarlaDataProvider ._actor_transform_map :
152
+ for actor in CarlaDataProvider ._actor_transform_map . copy () :
149
153
if actor is not None and actor .is_alive :
150
154
CarlaDataProvider ._actor_transform_map [actor ] = actor .get_transform ()
151
-
155
+ else :
156
+ del CarlaDataProvider ._actor_transform_map [actor ]
157
+
152
158
world = CarlaDataProvider ._world
153
159
if world is None :
154
160
print ("WARNING: CarlaDataProvider couldn't find the world" )
You can’t perform that action at this time.
0 commit comments