I am currently engaged in reinforcement learning research using MuJoCo. To develop robust strategies, it is crucial for the robot to train across multiple environment models. For this purpose, I have created several XML models. During the environment reset in my reinforcement learning code, I use self.model = mujoco.MjModel.from_xml_path to load a new environment model. I also utilize self.viewer = mujoco.viewer.launch_passive(self.model, self.data) for visualization, which I update upon reset by calling self.viewer._sim().load(self.model, self.data) to visualize the new environment model.
However, I am encountering a challenge with acquiring RGB-D data from the camera. Initially, I declare self.renderer = mujoco.Renderer(self.model, height=720, width=1280)and fetch RGB-D data using the following code:
Each time I execute a reset, I re-declare self.renderer = mujoco.Renderer(self.model, height=720, width=1280) to attempt to capture RGB-D information from the new environment. However, after resetting, I find that the saved RGB-D data does not reflect the new environment model correctly. It is showed in below.
Depth image:
RGB image:
Could you please advise on how to properly update or reinitialize the renderer so that it correctly reflects changes in the environment model after each reset? Any guidance or additional steps I should consider would be greatly appreciated.
Dear MuJoCo Support Team,
I am currently engaged in reinforcement learning research using MuJoCo. To develop robust strategies, it is crucial for the robot to train across multiple environment models. For this purpose, I have created several XML models. During the environment reset in my reinforcement learning code, I use
self.model = mujoco.MjModel.from_xml_path
to load a new environment model. I also utilizeself.viewer = mujoco.viewer.launch_passive(self.model, self.data)
for visualization, which I update upon reset by callingself.viewer._sim().load(self.model, self.data)
to visualize the new environment model.However, I am encountering a challenge with acquiring RGB-D data from the camera. Initially, I declare
self.renderer = mujoco.Renderer(self.model, height=720, width=1280)
and fetch RGB-D data using the following code:Each time I execute a reset, I re-declare
RGB image:
![rgb_1 png_mask](https://github.com/google-deepmind/mujoco/assets/60174245/79dd5a5f-ad00-4665-8673-ab0b1f6de6f6)
self.renderer = mujoco.Renderer(self.model, height=720, width=1280)
to attempt to capture RGB-D information from the new environment. However, after resetting, I find that the saved RGB-D data does not reflect the new environment model correctly. It is showed in below. Depth image:Could you please advise on how to properly update or reinitialize the renderer so that it correctly reflects changes in the environment model after each reset? Any guidance or additional steps I should consider would be greatly appreciated.
Thank you for your assistance.