Skip to content

Split task space control from sim control#86

Draft
jbruedigam-bdai wants to merge 3 commits intomainfrom
jbruedigam/generic_task_space
Draft

Split task space control from sim control#86
jbruedigam-bdai wants to merge 3 commits intomainfrom
jbruedigam/generic_task_space

Conversation

@jbruedigam-bdai
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Collaborator

@alberthli alberthli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a pretty reasonable set of changes, and I tried out the test "3d" cylinder push task on my end. Some additional minor comments before it's merged:

  • add yourself and this PR to the release notes for the version coming up
  • small writeup in the docs would be helpful
  • remove the test cylinder push task so it doesn't get merged to main - we could derive a child class of it in a test or something to verify that we can split the control/sim spaces

Comment thread judo/app/simulation.py Outdated
self.sim_controls = self.control(self.task.data.time)
self.task.pre_sim_step()
mj_step(self.task.sim_model, self.task.data)
self.sim_backend.sim(self.task.sim_model, self.task.data, self.sim_controls)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: i'd prefer to call this function step() to match our expectations from replacing mj_step()

Comment thread judo/tasks/cylinder_push_new.py Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

point taken on this file for testing, but we shouldn't merge this in main (and similarly, we should remove it from judo.tasks.__init__)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can update the docs with a short snippet on how to sample from a different space than is defined in the XML

Comment thread judo/app/simulation.py
self.task.post_sim_step()
except ValueError:
self.sim_controls = self.control(self.task.data.time)
if self.sim_controls.shape != (self.task.nu,):
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is necessary because for different backends (eg cpp) the try-catch does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants