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

Musculoskeletal dog creation #402

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

vittorione94
Copy link
Contributor

As per title

Copy link
Collaborator

@yuvaltassa yuvaltassa left a comment

Choose a reason for hiding this comment

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

Looking good.

The Euler-angle free joint is a deal breaker though. We have to undo this and fix the underlying issue.

dm_control/locomotion/walkers/assets/dog_v2/add_markers.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/build_torso.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/dog.xml Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/dog_base.xml Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/muscles.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/utils.py Outdated Show resolved Hide resolved
dm_control/mjcf/schema.xml Outdated Show resolved Hide resolved
Copy link

@lqh20 lqh20 left a comment

Choose a reason for hiding this comment

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

Nice work! As far as I can tell the logic looks good but I added a bunch of small style comments. In general more comments and doc strings would be great as well.

dm_control/locomotion/walkers/assets/dog_v2/utils.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/add_markers.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/add_markers.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/add_muscles.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/add_muscles.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/create_skin.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/create_skin.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/muscles.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/utils.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/__init__.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/add_markers.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/add_markers.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/add_markers.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/utils.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/utils.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/utils.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/utils.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/utils.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@nimrod-gileadi nimrod-gileadi left a comment

Choose a reason for hiding this comment

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

There are two main things missing from this PR:

  1. Add dog_v2_test where the model is instantiated and stepped. Look at https://github.com/google-deepmind/dm_control/blob/main/dm_control/locomotion/walkers/cmu_humanoid_test.py
  2. The public API of the module needs to be clear. Are users expected to call add_markers.add_markers, etc.? The test will make it a bit clearer for me how to use the module, but also, you should choose the small number of functions that are to be used by the clients, and import them publically into __init__.py

dm_control/locomotion/walkers/assets/dog_v2/add_markers.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/dog.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/dog_base.xml Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/dog_base.xml Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/build_dog.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/build_dog.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/assets/dog_v2/build_dog.py Outdated Show resolved Hide resolved
dm_control/locomotion/walkers/dog_test.py Outdated Show resolved Hide resolved
@nimrod-gileadi
Copy link
Collaborator

The review is showing a bunch of unrelated changes from the main dm_control. I think you somehow folded them into your commit. Could you pull and rebase your fork so that only your changes are in your commit?

i.e. in https://github.com/vittorione94/dm_control/tree/musculoskeletal_dog_creation, I see:

This branch is 1 commit ahead of, 57 commits behind google-deepmind/dm_control:main.

Plus there's one unresolved conversation from me.

Copy link
Collaborator

@yuvaltassa yuvaltassa left a comment

Choose a reason for hiding this comment

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

@vittorione94

I tried to import this and encountered several issues:

  1. A bunch of files are missing the standard copyright header. Make sure to make the year 2024 for new files.
  2. The standard dm_control tests are failing because the existing dog doesn't load because you deleted/moved dog_assets/dog_skin.skn. Please make sure the existing tests pass.
  3. Please make sure all code is wrapped to 80 columns.
  4. Added some specific issues our linter found in specific lines.
  5. Please sync to HEAD.

arma = physics.bind(j).armature[0]
# Print torque actuators stuff
if not use_muscles:
joint_acts = [model.find("actuator", j.name) for j in actuated_joints]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Variable 'actuated_joints' is possibly uninitialized

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actuated_joints is definitely intialized if we're not using muscles. The build_dog script creates an actuated model (either with torque joints or tendons).

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not my opinion, this is what the static code checker is saying 🤷

I can try and import again and see if I get complaints...

dm_control/locomotion/walkers/assets/dog_v2/build_dog.py Outdated Show resolved Hide resolved
muscle.ctrllimited = True
muscle.ctrlrange = [0.0, 1.0]
if lengthrange_from_joints:
muscle.lengthrange = [vector_min[tend_idx], vector_max[tend_idx]]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Variable 'vector_min' and 'vector_max' are possibly uninitialized

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if lengthrange_from_joints is true then those are definitely intialized no?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not my opinion, this is what the static code checker is saying 🤷

I can try and import again and see if I get complaints...

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.

4 participants