fix joint stuck at limit bug
Fix https://github.com/dartsim/dart/issues/1683 and https://github.com/gazebosim/gz-sim/issues/1684
result:
https://github.com/dartsim/dart/assets/110574820/2f5d5444-a5ea-47f3-84a2-f94ab83ca3f8
Before creating a pull request
- [ ] Document new methods and classes
- [ ] Format new code files using ClangFormat by running
make format - [ ] Build with
-DDART_TREAT_WARNINGS_AS_ERRORS=ONand resolve all the compile warnings
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
- [ ] Add Python bindings for new methods and classes
Could you please take a look at the test failures?
I don't believe that the changes I've done are the correct thing to do. It just was what got the system out of the velocity limit loop (when position is equal to limit).
Deleting the velocity limit section also fixed the issue, but I don't know what effects it will have on other joint types.
Would this change be acceptable?
@jslee02 what needs to be done now?
Apologies for the delayed response. I am currently on vacation and will be sporadic in my availability to provide a thorough analysis of this issue and the patch for this PR.
Regarding this PR, as you mentioned, I am also uncertain about the potential side effects of disabling the velocity limit correction for servo motor types. I wonder if there is a better way to address the issue without completely disabling it.
@jslee02, are there any updates on this PR? We have a downstream issue https://github.com/gazebosim/gz-sim/issues/1684 that is affected by this.
Hey folks -- sorry this took me a bit! I cherry-picked Haidar’s three commits onto a fresh branch off release-6.16 so the original authorship is intact. I also added a focused regression (Issue1683.ServoJointRecoversFromPositionLimits plus a small SDF fixture) that reproduces the stuck-at-limit behaviour from #1683 and #1684: it fails before the patches and passes after they’re applied, while the existing Issue1583 test still passes.
I'll open a new PR with that branch now so it’s easy to review -- happy to adjust anything else you’d like to see.
https://github.com/dartsim/dart/pull/2086