-
Notifications
You must be signed in to change notification settings - Fork 285
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 human joint constraint example #1016
Conversation
# Conflicts: # CMakeLists.txt
This reverts commit 6c04669.
# Conflicts: # cmake/DARTFindDependencies.cmake
@jyf588 I've revised your PR to be able to merge it into DART 6.4 seamlessly. Feedback from you would be appreciated! |
Codecov Report
@@ Coverage Diff @@
## release-6.4 #1016 +/- ##
============================================
Coverage 56.58% 56.58%
============================================
Files 314 314
Lines 24312 24312
============================================
Hits 13758 13758
Misses 10554 10554 |
@jslee02 That sounds awesome! I just changed my code base link in this paper from my own github to this pull request. (2 hours before the Final Revision Deadline. You created this just at the time :) ) I am currently working very hard towards IROS. Will definitely take a look immediately after March 1st. Let me know if you need any information from me (e.g. documentations)! |
@jslee02 Have changed the citation previously :D |
I should have a chance to review this later today. Right off the bat, I like the idea of having it as an example. That way, we get the benefit of making it publicly available, easily accessible, and an effective starting point for people who are interested in the topic of human-like joint limits, but at the same time we don't need to worry about rigorously supporting the API + implementation or developing the feature to be comprehensive and generalized. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks really good to me. Just a few remarks:
-
It looks like some forward declarations accidentally sneaked into one of the publicly installed headers. I left an in-line comment for this. This is the only important change to make; the rest of my comments are just passing thoughts.
-
I wonder if
data/neuralnets/net-larm
andnet-lleg
should maybe go into adata/humanJointLimits/
directory instead? I don't mind keeping them where they are, but I suspect putting them in a directory that's named after the example might make it more clear what their purpose is. I don't imagine it's likely that we'll be storing enough general-purpose neural networks to justify a data directory dedicated to neural networks, but I could be wrong.
dart/constraint/SmartPointer.hpp
Outdated
@@ -51,6 +51,8 @@ DART_COMMON_MAKE_SHARED_WEAK(LCPSolver) | |||
|
|||
DART_COMMON_MAKE_SHARED_WEAK(BallJointConstraint) | |||
DART_COMMON_MAKE_SHARED_WEAK(WeldJointConstraint) | |||
DART_COMMON_MAKE_SHARED_WEAK(HumanArmJointLimitConstraint) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these types are only defined in example code, I think they should go in a header of that example code instead of a public DART header.
joint->setPositionLimitEnforced(true); | ||
} | ||
|
||
// world->getSkeleton("arm")->enableSelfCollisionCheck(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe put a comment on why these lines are commented out, and why someone might want to comment/uncomment these lines?
@jslee02 Yes, it looks good to me, and we can just delete the commented code. I just have not get the time to add some documentation to README.md, but I will do that before tonight. My apologies for the delay here. I seem to not having push access to the branch. Can I just put the new texts for README here, and ask you to copy and paste it to README? |
Sure, you could put the changes here, or you could create a branch from |
@jslee02 I think we are good to merge once you think the new texts added to README are okay: This example program sets realistic human joint limits to a simulated human agent, so that the agent’s movements under laws of physics will never exceed human range of motion. Specifically, naively setting upper and lower bounds for each DoF is far from accurate for simulating our four limbs. (For example, our elbow has a smaller range when the arm is behind the torso.) We thus represent the joint limit constraints for the limbs in more general, mutual-dependent forms C_{arm}(q_arm) > 0.5 and C_{leg}(q_leg) > 0.5, where q is the joint configuration for the whole limb. (For the arm excluding the hand, we consider q_arm as 3DoF in shoulder plus 1DoF in elbow; for the leg, q_leg is 3DoF in hip, 1DoF in knee and 2DoF in ankle.) Just like how upper/lower bounds are handled in DART, when C(q) is about to decrease below 0.5 at next time step, a constraint force in dC/dq direction is generated by LCP solver to push q back to valid region. The C(q) functions are trained neural nets from real human data. In this way, we do not need to use sophisticated biomechanics models, and both C(q) and dC/dq can be quickly evaluated through forward evaluation and back-propagation of the neural nets. The code for training neural nets is here: https://github.com/jyf588/Human-Joint-Constraints-Training ————————————————————————
Specifically, the axis order for all Euler joints are set to zxy. The rest pose is almost defined the same as the usual human rest pose, except for the shoulder rotation - for humans, if you start to bend your elbow from rest pose, your lower arm will start to move to the other side of torso besides lifting up. In our model, however, rest position for shoulder rotation in defined such that when bending elbow, the agent’s lower up will only lift up, while keeping perpendicular to the torso plane.
|
@jyf588 Thanks! I added the text to |
@jslee02 Great! Thanks! |
This PR is a revised version of #919.
Summary of changes from #919:
tiny-dnn
as a dependency ofhumanJointLimits
example. In absence oftiny-dnn
installed, the example target is not built. If you are on macOS, you can installtiny-dnn
asbrew install dartsim/dart/tiny-dnn
. Otherwise, you should build and install it from source.humanJointLimits
example requires it.Human[~]JointLimitConstraint
classes to the example directory since they are application specific at this moment.Depends on #1015 (diff from #1015)
Before creating a pull request
Before merging a pull request
CHANGELOG.md
tiny-dnn
on CI tests to test build of this example (only macOS for now)