Skip to content

[AO migration] JointMotor API#1326

Merged
aclegg3 merged 21 commits intomasterfrom
ao-migration-joint-motor-api
Jun 17, 2021
Merged

[AO migration] JointMotor API#1326
aclegg3 merged 21 commits intomasterfrom
ao-migration-joint-motor-api

Conversation

@aclegg3
Copy link
Copy Markdown
Contributor

@aclegg3 aclegg3 commented Jun 17, 2021

Motivation and Context

Add JointMotor API for articulated object PD control via Bullet physics. Supports single dof joint types (Revolute and Prismatic) and Spherical joints.

Note: also added getters for joint and link names to improve user experience.

TODO: Spherical joint motor velocity targets are not behaving as expected. This may be misunderstanding of parameters or error within Bullet. May need to log an issue and circle back on this in a later PR. Position targets are working as expected.

How Has This Been Tested

New pytests for the changes.

Example of spherical JointMotor position control for humanoid holding a T-pose position:

test_articulated_object_joint_motors__amass_male.urdf.mp4

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

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 Jun 17, 2021
Copy link
Copy Markdown
Contributor

@jturner65 jturner65 left a comment

Choose a reason for hiding this comment

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

LGTM : Left a few comments, mostly about comments :).

Comment thread src/esp/bindings/PhysicsBindings.cpp Outdated
Comment thread src/esp/physics/ArticulatedObject.h
Comment thread tests/test_physics.py Outdated
Comment thread src/esp/physics/ArticulatedObject.h Outdated
Comment thread src/esp/physics/ArticulatedObject.h Outdated
Comment thread tests/test_physics.py Outdated
Comment thread tests/test_physics.py Outdated
Comment thread src/esp/physics/ArticulatedObject.h Outdated
Comment thread tests/test_physics.py
for ix, val in enumerate(upper_limits):
if val > 1:
upper_limits[ix] = 1
joint_limits = articulated_object.joint_position_limits
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
joint_limits = articulated_object.joint_position_limits
lower_limits, upper_limits = articulated_object.joint_position_limits

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this more efficient given the lines below with limiting?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It will just error if we ever increase or decrease the number of elements returned by the function and is useful for that purpose. Also means you don't have to worry about index out of bound accesses for the tuple.

Copy link
Copy Markdown
Contributor

@eundersander eundersander left a comment

Choose a reason for hiding this comment

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

I left some comments. I'm worried about the use of CHECK everywhere and honestly wondering if you mixed up CHECK and ESP_CHECK.

Comment thread src/esp/physics/ArticulatedObject.h Outdated
Comment thread src/esp/physics/ArticulatedObject.h Outdated
Comment thread src/esp/physics/ArticulatedObject.h Outdated
@aclegg3 aclegg3 requested a review from eundersander June 17, 2021 22:38
Copy link
Copy Markdown
Contributor

@eundersander eundersander left a comment

Choose a reason for hiding this comment

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

LGTM

@aclegg3 aclegg3 merged commit 60381e7 into master Jun 17, 2021
@aclegg3 aclegg3 deleted the ao-migration-joint-motor-api branch June 17, 2021 23:35
@aclegg3 aclegg3 mentioned this pull request Jun 18, 2021
11 tasks
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.

5 participants