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

Humanoids pr #1165

Merged
merged 18 commits into from
Mar 1, 2023
Merged

Humanoids pr #1165

merged 18 commits into from
Mar 1, 2023

Conversation

xavierpuigf
Copy link
Contributor

@xavierpuigf xavierpuigf commented Feb 27, 2023

Motivation and Context

Adds humanoid control into Habitat. At the moment it adds a kinematically controlled humanoid, and a new action to control their joints and transform. This change is required to support more kinds of agents into Habitat.

How Has This Been Tested

Passes Pytests

Types of changes

  • Docs change / refactoring / dependency upgrade
  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 27, 2023
return MobileManipulatorParams(
arm_joints=[], # For now we do not add arm_joints
gripper_joints=[],
wheel_joints=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for working on this! Do we expect that humans have wheels?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, but I found I could not ignore this parameter, even if it was optional. I think that in order to be able to ignore it, we need to set a default argument to wheels, here of None. I can do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm mobile_manipulator.py was probably designed with Fetch in mind, so I wouldn't change the default to None. Why not set it as False here instead of None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have here a check of wheel_joints existing as a param or being None, this is why I was proposing to set the default to None. If we set it as False, or [], we would need to change all these checks as well. I can do that if you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the type of this variable? This should indicate what the no wheel option should be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Optional[List[int]]

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, I faced the same issue before, my solution at that time was to use inheritance, which is not the best way to do this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you elaborate on how you used inheritance? I think the best would be to make it List[int] (no optional) with a default argument [] and whenever we are checking this param, we replace the None/False checks fro empty list.

Copy link
Contributor

@akshararai akshararai left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just needs some additional comments. Should we also add a humanoid URDF and some examples on how to do some random control with the humanoid?

habitat-lab/habitat/articulated_agents/README.md Outdated Show resolved Hide resolved
return MobileManipulatorParams(
arm_joints=[], # For now we do not add arm_joints
gripper_joints=[],
wheel_joints=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm mobile_manipulator.py was probably designed with Fetch in mind, so I wouldn't change the default to None. Why not set it as False here instead of None?

@xavierpuigf
Copy link
Contributor Author

Looks good to me. Just needs some additional comments. Should we also add a humanoid URDF and some examples on how to do some random control with the humanoid?

Good point on the random control, I can add a functions in interactive_play that does that. Regarding the URDF, I made this PR to download the humanoid URDF in habitat-sim, @aclegg3, is that good to merge?

@xavierpuigf
Copy link
Contributor Author

Looks good to me. Just needs some additional comments. Should we also add a humanoid URDF and some examples on how to do some random control with the humanoid?

Good point on the random control, I can add a functions in interactive_play that does that. Regarding the URDF, I made this PR to download the humanoid URDF in habitat-sim, @aclegg3, is that good to merge?

Alright, I added a random control demo in latest commit

@xavierpuigf xavierpuigf reopened this Feb 28, 2023
examples/interactive_play.py Outdated Show resolved Hide resolved
examples/interactive_play.py Outdated Show resolved Hide resolved
examples/interactive_play.py Outdated Show resolved Hide resolved
examples/interactive_play.py Show resolved Hide resolved
return MobileManipulatorParams(
arm_joints=[], # For now we do not add arm_joints
gripper_joints=[],
wheel_joints=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the type of this variable? This should indicate what the no wheel option should be.

habitat-lab/habitat/tasks/rearrange/actions/actions.py Outdated Show resolved Hide resolved
self.cur_articulated_agent.set_joint_transform(
new_joints, new_transform
)
return self._sim.step(HabitatSimActions.changejoint_action)
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not understand what this does. Why is this needed? What does self._sim need to update for the changejoint_action ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I probably misunderstood the code, but don't we need to call sim.step on every step() function, since functions calling step expect observations from the environment? I think this makes sense when we call this function via the high level policy.

Copy link
Contributor

Choose a reason for hiding this comment

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

This could cause the simulator to step twice per high-level step. The action should only step the simulator if the action is the last action to execute. See how it's done in the other actions.

Copy link
Contributor

@akshararai akshararai left a comment

Choose a reason for hiding this comment

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

Looks good to me. Once all comments are addressed, we can merge this soon I think. Thank you for working on this, and addressing all the comments!

examples/interactive_play.py Outdated Show resolved Hide resolved
examples/interactive_play.py Outdated Show resolved Hide resolved
examples/interactive_play.py Outdated Show resolved Hide resolved
examples/interactive_play.py Outdated Show resolved Hide resolved
examples/interactive_play.py Outdated Show resolved Hide resolved
examples/interactive_play.py Outdated Show resolved Hide resolved
examples/interactive_play.py Outdated Show resolved Hide resolved
examples/interactive_play.py Outdated Show resolved Hide resolved
examples/interactive_play.py Outdated Show resolved Hide resolved
Copy link
Contributor

@akshararai akshararai left a comment

Choose a reason for hiding this comment

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

looks good to me.

@rpartsey rpartsey self-requested a review March 1, 2023 07:55
@xavierpuigf xavierpuigf merged commit 0f811a4 into main Mar 1, 2023
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
* first commit general kinematic human model

* correcting offset

* update readme

* linting

* small fix and clarification updateds

* fix import

* linting

* add download instructions for humanoid

* pose getter

* updated interactive play with humanoid

* update readme

* updated docstring

* updated docstring

* more docs and fix

* improving interactive play

* Update examples/interactive_play.py

Co-authored-by: akshararai <akshara.rai@gmail.com>

* improve name;

* corrected typo

---------

Co-authored-by: akshararai <akshara.rai@gmail.com>
HHYHRHY pushed a commit to SgtVincent/EMOS that referenced this pull request Aug 31, 2024
* first commit general kinematic human model

* correcting offset

* update readme

* linting

* small fix and clarification updateds

* fix import

* linting

* add download instructions for humanoid

* pose getter

* updated interactive play with humanoid

* update readme

* updated docstring

* updated docstring

* more docs and fix

* improving interactive play

* Update examples/interactive_play.py

Co-authored-by: akshararai <akshara.rai@gmail.com>

* improve name;

* corrected typo

---------

Co-authored-by: akshararai <akshara.rai@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants