-
Notifications
You must be signed in to change notification settings - Fork 535
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
Inverse kinematics solution with additional custom joint constraints. #3114
Comments
The GroupStateValidityCallbackFn can be used to create custom validation for sampled IK solutions. In my case, I use it to validate solutions against additional joint constraints. For reference, the code is provided below. The current logic is that the solution is sampled and then validated. Code:
|
Unfortunately, the IK solver API doesn't allow the passing of constraints. Hence, constraints can only be considered via validation and rejection. |
Thank you for your reply @rhaschke! I appreciate the clarification! I have some additional questions for potential workarounds / enhancements.
|
I'd suggest to fork bio_ik and add whatever constraints you need there. That's exactly what I've been doing. In other words, build bio_ik from source. |
I know that bio_ik in principle can handle constraints. However, you need to call the service directly, don't you? moveit2/moveit_core/kinematics_base/include/moveit/kinematics_base/kinematics_base.h Lines 174 to 176 in 6487249
|
I modified |
Can you provide a source link for reference? |
My custom constraints were added here: https://github.com/PickNikRobotics/bio_ik/blob/ad75b2e8085338311a2f6e7224f43b9b1f35a79c/src/kinematics_plugin.cpp#L300 |
Thank you @AndyZe for your input! However, I am unsure how flexible is the solution to manually modify the source code of IK solvers to include additional joint constraints. I believe that an API enhancement could really benefit developers due to its convenience and ability to update constraints in a run time. It is possible that I am not fully understanding the impact of these changes on the rest of the system. In this case, I would really appreciate further clarification of current implementation and its specifics. |
Is your feature request related to a problem? Please describe.
When using setFromIK, I am receiving an inverse kinematics solution that respects joint limits and avoids collision with objects in the robot's workspace, which is good.
However, I cannot limit the solution space to additional custom-made joint constraints (
moveit_msgs::msg::JointConstraint
), at least I have not found the way to add them yet.Describe the solution you'd like
I would be happy if I could pass additional parameter (array of custom joint constraints) to
setFromIK
that would further limit joint solution space, in addition to joint limits.Describe alternatives you've considered
I considered looking for IK solution and then check whether it satisfies custom joint constraints manually. However, it is time costly.
When looking into setFromIK, I saw that there is a
const GroupStateValidityCallbackFn& constraint
parameter. Is it possible to use it to check the validity of the sampled state including additional joint constraints?Additional context
No response
The text was updated successfully, but these errors were encountered: