Fix not using result of solution callback #48
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a small bug introduced in #42 due to which the result of the solution callback was ignored. Therefore, the
GroupStateValidityCallbackFn
(which is often used for collision checking) in thesetFromIK()
call was ignored.Independent from this error, I was also wondering if the current way to call this function makes sense. Currently, it is only called at the very end of
searchPositionIK()
. This means, during the process of searching for an IK solution, pick_ik constantly checks thesolution_fn
(which does not contain the callback). When this finally returnstrue
, it will check the callback. If the callback then returnsfalse
, pick_ik will say that it did not find a valid solution, although neither time nor iteration limits have been reached. Instead it would also be possible to continue searching for a solution until either a limit has reached or thesolution_fn
and the callback are valid at the same time.I saw that bio_ik was doing it also like pick_ik is doing it currently. Maybe it is how MoveIt expects the kinematics_plugins to behave. However, I think that there might be benefit in changing this behavior, so that a valid solution is found more often.