ARISE-Initiative / robosuite

robosuite: A Modular Simulation Framework and Benchmark for Robot Learning
https://robosuite.ai
Other
1.24k stars 397 forks source link

How to add more cameras in environment or modified current camears? #195

Closed YunchuZhang closed 3 years ago

YunchuZhang commented 3 years ago

As title, I found there is camera_names called frontview and agentview where are those defiened? And How can I add more cameras? Also, If I want to add multi-camera rgb-d in observation space, is that possible?

Thanks

YunchuZhang commented 3 years ago

Btw, could we use the onscreen and offscreen renderers together like rendering while collecting rgbd data

cremebrule commented 3 years ago

Hi @YunchuZhang ,

Cameras are natively defined in the mujoco XML file that procedurally generated before the simulation begins. You can access the camera names via env.sim.model.camera_names, and can add a new camera using robosuite's Arena object API as well (note that any new cameras you add must be added before the environment model is actually loaded into sim!)

You unfortunately cannot use the onscreen and offscreen renderers simultaneously (we have a warning in place as well to prevent attempts at this); a common workaround is the copy the RGB frame(s) that you receive from the obs dict and use those for onscreen rendering (e.g., using pygame or some other renderer).

Closing the issue for now, feel free to re-open if you have further problems.