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

Fix controller #1202

Merged
merged 11 commits into from
Mar 17, 2023
Merged

Fix controller #1202

merged 11 commits into from
Mar 17, 2023

Conversation

xavierpuigf
Copy link
Contributor

@xavierpuigf xavierpuigf commented Mar 15, 2023

Motivation and Context

This change improves the humanoid controller to support relative transforms without changing the base pose.
This allows to run path planner smoothly even when there are relative transforms caused by the walking gait.
It also moves the controller code from baselines into habitat-lab.

How Has This Been Tested

Passes tests
Ran Interactive Play Demo

Types of changes

  • [Refactoring] Large changes to the code that improve its functionality or performance

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation if required.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes if required.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 15, 2023
@xavierpuigf xavierpuigf requested a review from aclegg3 March 15, 2023 22:13
@xavierpuigf xavierpuigf mentioned this pull request Mar 15, 2023
7 tasks
Comment on lines 312 to 318
pose,
root_trans_offset,
root_trans_base,
) = humanoid_controller.get_walk_pose(relative_pos)
base_action = humanoid_controller.vectorize_pose(
pose, root_trans_offset, root_trans_base
)
Copy link
Contributor

Choose a reason for hiding this comment

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

A tiny bit awkward that the 3 outputs of get_walk_pose are passed to vectorize_pose. Would it be simpler to have a humanoid_controller.action_from_relative_position that takes as input relative_pos and returns base_action (under the hood it would just call get_walk_pose then vectorize_pose.
If this is the only place this is used, maybe doing

full_pose = humanoid_controller.get_walk_pose(relative_pos)
base_action = humanoid_controller.vectorize_pose(* full_pose)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I like that. I would like to keep the original functions that return the different components, in case we want to use part of the transform lately (for instance, compute the joint changes but not the base transform), but I can have a function that calls + vectorize under the hood.

@xavierpuigf
Copy link
Contributor Author

Thanks for the comments! I think everything is addressed

@vincentpierre
Copy link
Contributor

Could you add some unit tests for the human controller and add end to end tests with the gym environments (create env, reset and do a few random actions on it)

Copy link
Contributor

@vincentpierre vincentpierre left a comment

Choose a reason for hiding this comment

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

Besides missing tests I think this looks very good.
Please add some tests before merging

@xavierpuigf xavierpuigf merged commit b96eba4 into main Mar 17, 2023
@xavierpuigf xavierpuigf deleted the fix_controller branch March 24, 2023 19:52
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
* fix path human armature

* update controller

* fix

* improving code for humanoid controller and moving to habitat-lab

* renaming docstring

* clean conversion degree_to_grads

* improved controller

* fix

* adding tests humanoid
HHYHRHY pushed a commit to SgtVincent/EMOS that referenced this pull request Aug 31, 2024
* fix path human armature

* update controller

* fix

* improving code for humanoid controller and moving to habitat-lab

* renaming docstring

* clean conversion degree_to_grads

* improved controller

* fix

* adding tests humanoid
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.

3 participants