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

Wrap IKFast solutions for cyclic joint positions #1452

Merged
merged 3 commits into from
Apr 27, 2020
Merged

Conversation

jslee02
Copy link
Member

@jslee02 jslee02 commented Apr 26, 2020

IKFast sometimes returns solutions that are not wrapped within the range of the joint limits, which is regarded as an invalid solution in DART.

This PR fixes the issue by adding logic that tries to wrap IKFast solutions for rotational joints. The idea is to wrap the solution within joint limits. If there is more than one solution (when the joint limit range is wider than 2pi), it returns the closest solution to the current joint position to minimize joint motion.

The logic should be applied to any DegreeOfFreedom whose configuration space is SO(2), but this PR only applies it to RevoluteJoint. This is because the current API doesn't provide for it. DegreeOfFreedom::isCyclic() is the closest function to what we want, but it only returns true when the rotational joint has no limits.

This PR partially fix #1449 because it only works for RevoluteJoint.


Before creating a pull request

  • Document new methods and classes
  • Format new code files using clang-format

Before merging a pull request

  • Set version target by selecting a milestone on the right side
  • Summarize this change in CHANGELOG.md
  • Add unit test(s) for this change

@codecov
Copy link

codecov bot commented Apr 26, 2020

Codecov Report

Merging #1452 into master will increase coverage by 0.06%.
The diff coverage is 88.67%.

@@            Coverage Diff             @@
##           master    #1452      +/-   ##
==========================================
+ Coverage   58.17%   58.24%   +0.06%     
==========================================
  Files         412      412              
  Lines       29875    29923      +48     
==========================================
+ Hits        17381    17428      +47     
- Misses      12494    12495       +1     
Impacted Files Coverage Δ
dart/dynamics/IkFast.hpp 100.00% <ø> (ø)
dart/dynamics/IkFast.cpp 64.25% <88.67%> (+5.14%) ⬆️
dart/dynamics/Skeleton.cpp 66.33% <0.00%> (+0.16%) ⬆️
dart/dynamics/DegreeOfFreedom.cpp 46.34% <0.00%> (+1.21%) ⬆️
dart/math/Constants.hpp 75.00% <0.00%> (+8.33%) ⬆️

mxgrey
mxgrey previously approved these changes Apr 27, 2020
@jslee02 jslee02 marked this pull request as ready for review April 27, 2020 04:22
@jslee02
Copy link
Member Author

jslee02 commented Apr 27, 2020

Merging as it seems the build failure on Windows is due to the ODE vcpkg (incorrect SHA value).

@jslee02 jslee02 merged commit c79cf9b into master Apr 27, 2020
@jslee02 jslee02 deleted the ikfast_joint_limits branch April 27, 2020 05:22
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.

ikFast class checks joint limits incorrectly
2 participants