[Question] How to register an environment from a custom extension? #1611
-
Hello, I'm looking for help registering an environment defined from a custom extension outside the main IsaacLab package. As a reminder, environments are registered when the tasks package is imported like this: This registers the default environments but not those defined inside extensions. I'm developing my environment configuration within it's own extension (as per the documentation recommendations). This is nice because it keeps all my code separate from the main IsaacLab installation. So far I haven't had to modify it at all which should make upgrading a breeze. But I hit a snag when it comes to registering my custom environment. To accomplish this I've had to pepper the IsaacLab code with an import statement like so: This works, but it's breaks the nice separation I had going. Is there a recommended way to register environments defined in an extension? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Developing based on the IsaacLabExtensionTemplate is an excellent approach for handling the registration of custom environments. Typically, there’s no need to import custom environments into the main IsaacLab package, as the entire process can be managed within your Extension. I’ve worked on a similar setup and found it effective to handle both official and custom environments directly in the Extension. If it helps, I’d be happy to share an example or further details from my implementation for your reference. I hope this answer is helpful to you! |
Beta Was this translation helpful? Give feedback.
-
Hi Andy. Thank you very much for sharing your research. It is quite helpful (and very cool results too!). I see you have your own scripts/rsl_rl/play.py and train.py and are not using the ones inside the main IsaacLab repo. In case anyone has this same confusion, we are supposed to create our own play.py and train.py and import our tasks into there to register the environments. That way you don't have to use or modify the play/train.py scripts inside the main IsaacLab directory. |
Beta Was this translation helpful? Give feedback.
Developing based on the IsaacLabExtensionTemplate is an excellent approach for handling the registration of custom environments. Typically, there’s no need to import custom environments into the main IsaacLab package, as the entire process can be managed within your Extension.
I’ve worked on a similar setup and found it effective to handle both official and custom environments directly in the Extension. If it helps, I’d be happy to share an example or further details from my implementation for your reference.
I hope this answer is helpful to you!