I'm using MujocoServer without calling run or launch_server because I'm using it purely for visualization. I would expect instantiating an instance of MujocoServer to simply load in mjdata/mjmodel without spawning any threads/processes. However, it looks like MujocoServerSensorManagerThreaded launches a thread in the __init__ method. I think this should be moved to a run method, and MujocoServer should call MujocoServerSensorManagerThreaded's run method when its own run method is called.
|
self.sensors_thread = threading.Thread(target=self._sensor_loop, daemon=True) |
|
self.sensors_thread.start() |
Similarly, MujocoServerCameraManagerThreaded should wait to start the thread in its run method.
|
self.cameras_thread = threading.Thread(target=self._camera_loop, daemon=True) |
|
self.cameras_thread.start() |
I'm using
MujocoServerwithout callingrunorlaunch_serverbecause I'm using it purely for visualization. I would expect instantiating an instance ofMujocoServerto simply load in mjdata/mjmodel without spawning any threads/processes. However, it looks likeMujocoServerSensorManagerThreadedlaunches a thread in the__init__method. I think this should be moved to arunmethod, andMujocoServershould callMujocoServerSensorManagerThreaded's run method when its own run method is called.stretch_mujoco/stretch_mujoco/mujoco_server_sensor_manager.py
Lines 111 to 112 in 8759874
Similarly,
MujocoServerCameraManagerThreadedshould wait to start the thread in its run method.stretch_mujoco/stretch_mujoco/mujoco_server_camera_manager.py
Lines 268 to 269 in 8759874