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

Add support for mimic joints #1178

Merged
merged 15 commits into from
Oct 25, 2018
Merged

Conversation

costashatz
Copy link
Contributor

@costashatz costashatz commented Oct 22, 2018

This PR adds support for mimic joints (see #733). It does so by creating a new actuator type (MIMIC) and inserting one constraint for each mimic joint. In short:

  • Mimic joints are treated as velocity-controlled dynamic joints; similar to servo motors
  • A mimic joint will try to follow the (multiplied and offset-ed) position of a "master" joint
  • The JointProperties struct now holds three additional variables: mMimicJoint (pointer to "master" joint), mMultiplier and mOffset (these are only used in mimic joints and ignored for all other types of joints)
  • DartLoader (i.e., URDF loader) now correctly loads URDF files with mimic joints. Is there a similar functionality/tag in skel files (I know that in sdf there's no such thing)?
  • Cloning a skeleton, adjusts the mimic joint pointers

This is working for me nicely so far..

Let me know what you think and then I can proceed in cleaning the code (add a few more warnings and check it a bit more). Do you think it will be good to add a unit-test? I also added 2 unit tests (one for DartLoader and one for the mimic constraint)..

@costashatz costashatz changed the title Add support for mimic joint Add support for mimic joints Oct 22, 2018
ActuatorType _actuatorType = DefaultActuatorType,
Joint* _mimicJoint = nullptr,
double _multiplier = 1.0,
double _offset = 0.0);
Copy link
Member

@mxgrey mxgrey Oct 23, 2018

Choose a reason for hiding this comment

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

Suggested change
double _offset = 0.0);
double _mimicMultiplier = 1.0,
double _mimicOffset = 0.0);

nitpick: To make it clear that these are properties specifically related to the mimic joint actuator type, it would be good to decorate the variable names with mimic.

@codecov
Copy link

codecov bot commented Oct 23, 2018

Codecov Report

❗ No coverage uploaded for pull request base (release-6.7@3147c7b). Click here to learn what that means.
The diff coverage is 77.31%.

@@              Coverage Diff               @@
##             release-6.7    #1178   +/-   ##
==============================================
  Coverage               ?   56.51%           
==============================================
  Files                  ?      345           
  Lines                  ?    25654           
  Branches               ?        0           
==============================================
  Hits                   ?    14498           
  Misses                 ?    11156           
  Partials               ?        0
Impacted Files Coverage Δ
dart/utils/urdf/DartLoader.hpp 100% <ø> (ø)
dart/dynamics/detail/JointAspect.hpp 66.66% <ø> (ø)
dart/dynamics/Joint.hpp 66.66% <ø> (ø)
dart/dynamics/Joint.cpp 56.81% <100%> (ø)
dart/constraint/ConstraintSolver.cpp 66.23% <100%> (ø)
dart/dynamics/Skeleton.cpp 66.13% <30%> (ø)
dart/dynamics/detail/GenericJoint.hpp 73.71% <35.71%> (ø)
dart/constraint/MimicMotorConstraint.cpp 79.16% <79.16%> (ø)
dart/utils/urdf/DartLoader.cpp 76.7% <90.32%> (ø)

@jslee02
Copy link
Member

jslee02 commented Oct 23, 2018

Thanks for adding this feature to DART!

I have made some minor changes in my branch. Maybe this is not the best way of reviewing, but could you take a look at the following commits and merge my branch into your branch if they look good?:

Also, it'd be great to update the changelog for this PR.

@costashatz
Copy link
Contributor Author

@jslee02 your changes seem great! Integrated them and I updated the changelog..

Copy link
Member

@jslee02 jslee02 left a comment

Choose a reason for hiding this comment

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

Looks great to me! @mxgrey Please let me know if you plan to review this PR further. 😄

@costashatz
Copy link
Contributor Author

Is there any reason that you are not merging this one? Thanks!

@jslee02
Copy link
Member

jslee02 commented Oct 25, 2018

I was waiting for a second review. Let me merge this now.

@jslee02 jslee02 merged commit f31ccf5 into dartsim:release-6.7 Oct 25, 2018
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.

3 participants