Skip to content

Commit

Permalink
[WorldSync] pause and resume world sync is not used anymore as the sy…
Browse files Browse the repository at this point in the history
…nc function is called directly from with UseProspectionWorld.
  • Loading branch information
AbdelrhmanBassiouny committed Oct 25, 2024
1 parent 736c89b commit f30d116
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/pycram/datastructures/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ def _sync_prospection_world(self):
self.world_sync = None
else:
self.world_sync: WorldSync = WorldSync(self, self.prospection_world)
self.pause_world_sync()
self.world_sync.start()

def preprocess_object_file_and_get_its_cache_path(self, path: str, ignore_cached_files: bool,
Expand Down Expand Up @@ -987,7 +986,6 @@ def terminate_world_sync(self) -> None:
Terminate the world sync thread.
"""
self.world_sync.terminate = True
self.resume_world_sync()
self.world_sync.join()

def save_state(self, state_id: Optional[int] = None, use_same_id: bool = False) -> int:
Expand Down Expand Up @@ -1525,7 +1523,8 @@ def resume_world_sync(self) -> None:
"""
Resume the world synchronization.
"""
self.world_sync.sync_lock.release()
if self.world_sync.sync_lock.locked():
self.world_sync.sync_lock.release()

def add_vis_axis(self, pose: Pose) -> int:
"""
Expand Down Expand Up @@ -1670,10 +1669,8 @@ def run(self):
"""
while not self.terminate:
self.sync_lock.acquire()
if not self.terminate:
self.sync_worlds()
self.sync_lock.release()
time.sleep(WorldSync.WAIT_TIME_AS_N_SIMULATION_STEPS * self.world.simulation_time_step)
self.sync_lock.release()

def get_world_object(self, prospection_object: Object) -> Object:
"""
Expand Down

0 comments on commit f30d116

Please sign in to comment.