Skip to content

Commit

Permalink
[Multiverse] corrected multiple removal of same simulator state.
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelrhmanBassiouny committed Oct 23, 2024
1 parent 0f865e1 commit a6292c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pycram/datastructures/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -1227,8 +1227,9 @@ def remove_saved_states(self) -> None:
Remove all saved states of the World.
"""
if self.conf.use_physics_simulator_state:
for state in self.saved_states.values():
self.remove_physics_simulator_state(state.simulator_state_id)
simulator_state_ids = set([state.simulator_state_id for state in self.saved_states.values()])
for ssid in simulator_state_ids:
self.remove_physics_simulator_state(ssid)
else:
self.remove_objects_saved_states()
super().remove_saved_states()
Expand Down

0 comments on commit a6292c8

Please sign in to comment.