Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New domain and task #53

Closed
michtesar opened this issue Oct 24, 2018 · 3 comments
Closed

New domain and task #53

michtesar opened this issue Oct 24, 2018 · 3 comments
Labels

Comments

@michtesar
Copy link

Suppose I would like to write my own domain and task.

I copied humanoid.xml and humanoid.py, renamed to the same name and also in all occurrence in those files. I included init.py from suite and added import for the new suit I just copied.

Since there is no proper documentation I assume making this as playground is the best, right? I know I can register Gym environments in init.py very easily. Is there any way how to develop my own domain and task? Thank you!

@alimuldal
Copy link
Collaborator

alimuldal commented Oct 26, 2018

You would need to create a containers.TaggedTasks() instance in your new module (called SUITE by convention), and then for each new task that you want to add, wrap the function that returns the environment using the @SUITE.add decorator (optional: provide some string tags).

For example:

from dm_control.utils import containers

SUITE = containers.TaggedTasks()

@SUITE.add('some_tag', 'some_other_tag')
def my_new_task(time_limit=_DEFAULT_TIME_LIMIT, random=None, environment_kwargs=None):
   ...
   return control.Environment(...)

Then in dm_control/suite/__init__.py you just need to import the module containing your new tasks. The tasks will then be loadable using suite.load(domain='my_module_name', task='my_new_task', ...).

@aaronsnoswell
Copy link

(For future readers): also see some of the comments on #46.

@lucasjinreal
Copy link

lucasjinreal commented Apr 28, 2022

How to specific xml file of my model here? @alimuldal I don't want change dm_contrl source code, is there a way to call it inside my own script? (the env I created.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants