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 register a new env to robosuite? #113

Closed HeegerGao closed 3 years ago

HeegerGao commented 3 years ago

Hi there, I want to build a new env and register it into robosuite so I can start my env like env = suite.make(env_name='mynewenv', ……). But I don't find where you register all your initial tasks and environments. I just find a dictionary called REGISTERED_ENVS in /robosuite/environments/base.py. It's a little strange to me that I don't find where do you change the value of this dictionary's value. REGISTERED_ENVS equals to {} at the beginning of the code, but it seems full of envs automatically. Could you tell me how do you do that?

yukezhu commented 3 years ago

The environment registration is done through the meta class: https://github.com/ARISE-Initiative/robosuite/blob/master/robosuite/environments/base.py#L40

cremebrule commented 3 years ago

Specifically, when you create a new environment class and want to register it so you can call it with its string name with suite.make(), simply import your custom environment class in the __init__.py HERE.

Closing this issue for now; feel free to re-open it if you continue to have issues!