-
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
Apply IK solution only when the solver succeeded #1266
Conversation
Applying the solution during a failure was intentional, because iterative solvers will often do a decent job of getting the end effector close to the target even if it failed to find a solution, and that's often desirable. My personal view is that if the user wants the solution to be applied conditionally, they can set Maybe an alternative to make the behavior more clear would be to change the name of the input argument to |
Thanks for the clarification. I agree with you about iterative solver, but I'm a bit worried that the current IK implementation accepts any types of nonlinear optimizers. Non-iterative solver or analytic IK solver could return totally incorrect solution if the solution doesn't exist.
Yeah, this is possible, but I'd prefer the opposite. I mean the default behavior to be applying solution on success, and the user should apply solution by calling I'd like to propose three possible solutions: (a) No change but renaming bool solve(Eigen::VectorXd& position);
bool solveAndApply(Eigen::VectorXd& position, bool allowIncompleteResult = false);
bool solveAndApply(bool allowIncompleteResult = false); In any case, I think we should document more clear about the behavior. |
I definitely understand where you're coming from, and I agree that we could make it better with some changes. One concern I have is that I'm sure I've written code that depends on the current behavior of I guess we could deprecate the |
It sounds good to me! Let me update this PR accordingly. |
Done! |
Problem
IK solvers apply solution even when the solver failed to solve.
Solution
Apply solution only on success.
Testing
Added a simple unit test that checks if IK solver changes joint values when the solver failed.
Before creating a pull request
clang-format
Before merging a pull request
CHANGELOG.md