Skip to content

KDL IK solver cleanup - #1294

Merged
rhaschke merged 19 commits into
moveit:melodic-develfrom
ubi-agni:kdl-cleanup
Jan 23, 2019
Merged

rhaschke merged 19 commits into
moveit:melodic-develfrom
ubi-agni:kdl-cleanup

Conversation

@rhaschke

@rhaschke rhaschke commented Jan 4, 2019 •

Copy link
Copy Markdown
Contributor

Tracking down #1255 and in preparation of #1208, I first cleaned up the KDL IK solver code

  • removing dead code
  • removing redundant joint handling
  • merging ChainIkSolverPos into main plugin source
  • use standard Eigen::SVD that yields higher accuracy

These changes should not affect functionality as verified by kinematics unit tests (#1272). The cleanup yields a strong performance boost (running 10.000 deterministic IK attempts):

  • original code: 410ms
  • after cleanup: 230ms
  • standard Eigen::SVD: 240ms

Please merge in conjuction with #1272 and #1288.

@mlautman

mlautman commented Jan 7, 2019

Copy link
Copy Markdown
Contributor

This contribution was clearly a ton of work and makes a ton of improvements. That said, it is really hard to review this for correctness. Can you please add tests to demonstrate the correctness of these changes?

@rhaschke

rhaschke commented Jan 8, 2019

Copy link
Copy Markdown
Contributor Author

Can you please add tests to demonstrate the correctness of these changes?

As already written in the main comment: These changes are verified by kinematics unit tests (#1272).

- using IO functions of kdl to (efficiently) print joint arrays as row vectors
- print time spent
- rename "iterations" -> "attempts"
- fixed type of max_solver_iterations_
- directly read parameters into class members
This function is doing exactly the same as CartToJnt().
The extra argument lock_redundant_joints is not used at all.
rhaschke added a commit to ubi-agni/moveit that referenced this pull request Jan 10, 2019
- perform similar cleanup as in moveit#1294
- actually use KDL's LMA solver (was instantiated but not used)
- remove notion of mimic joints, as the LMA solver doesn't support this

@mlautman mlautman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 from me. @v4hn's or @davetcoleman's, can you also take a look? I would like for another reviewer to look at this before it gets merged.

* @param solution the solution vector
* @param error_code an error code that encodes the reason for failure or success
* @param lock_redundant_joints if setRedundantJoints() was previously called, keep the values of the joints marked as
* redundant the same as in the seed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* redundant the same as in the seed
* @param options An option struct which contains the type of redundancy discretization used. This default
* implementation only supports the KinematicSearches::NO_DISCRETIZATION method; requesting any
* other will result in failure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like to advertize the redundancy parameters anymore. They are not used by MoveIt.
Rather, they are parameters of IKfast only.
However, I added a generic comment as follows:
@param options container for other IK options. See definition of KinematicsQueryOptions for details.

... setting the timeout to zero and ensuring at least one solution attempt
remove weird initialization IKCallbackFn solution_callback = 0
but pass default-constructed IKCallbackFn()
- merge CartToJntRedundant() and CartToJnt() handling all variants
  - locked/unlocked redundant joints
  - mimic joints
  - full / position-only IK
- use svd_eigen_HH in all cases
- reuse matrices for all variants
Special handling of "redundant joints" doesn't make sense for KDL solver.
... to reduce data copying and memory allocations
- passing mimic_joints_ to constructor, storing reference, and avoiding copy
- fix naming of members
rhaschke added a commit to ubi-agni/moveit that referenced this pull request Jan 14, 2019
- perform similar cleanup as in moveit#1294
- actually use KDL's LMA solver (was instantiated but not used)
- remove notion of mimic joints, as the LMA solver doesn't support this
rhaschke added a commit to ubi-agni/moveit that referenced this pull request Jan 14, 2019
- perform similar cleanup as in moveit#1294
- actually use KDL's LMA solver (was instantiated but not used)
- remove notion of mimic joints, as the LMA solver doesn't support this
@rhaschke
rhaschke merged commit 50e71ef into moveit:melodic-devel Jan 23, 2019
@rhaschke
rhaschke deleted the kdl-cleanup branch January 23, 2019 17:17
rhaschke added a commit to ubi-agni/moveit that referenced this pull request Jan 23, 2019
- perform similar cleanup as in moveit#1294
- actually use KDL's LMA solver (was instantiated but not used)
- remove notion of mimic joints, as the LMA solver doesn't support this
rhaschke added a commit to ubi-agni/moveit that referenced this pull request Jan 23, 2019
- perform similar cleanup as in moveit#1294
- actually use KDL's LMA solver (was instantiated but not used)
- remove notion of mimic joints, as the LMA solver doesn't support this
@rhaschke

Copy link
Copy Markdown
Contributor Author

Merged after having Mike's approval and having Dave's comments addressed.

rhaschke added a commit to ubi-agni/moveit that referenced this pull request Jan 30, 2019
- perform similar cleanup as in moveit#1294
- actually use KDL's LMA solver (was instantiated but not used)
- remove notion of mimic joints, as the LMA solver doesn't support this
rhaschke added a commit to ubi-agni/moveit that referenced this pull request Feb 4, 2019
- perform similar cleanup as in moveit#1294
- actually use KDL's LMA solver (was instantiated but not used)
- remove notion of mimic joints, as the LMA solver doesn't support this
rhaschke added a commit to ubi-agni/moveit that referenced this pull request Feb 4, 2019
- perform similar cleanup as in moveit#1294
- actually use KDL's LMA solver (was instantiated but not used)
- remove notion of mimic joints, as the LMA solver doesn't support this
rhaschke added a commit to ubi-agni/moveit that referenced this pull request Feb 4, 2019
- perform similar cleanup as in moveit#1294
- actually use KDL's LMA solver (was instantiated but not used)
- remove notion of mimic joints, as the LMA solver doesn't support this
rhaschke added a commit to ubi-agni/moveit that referenced this pull request Feb 4, 2019
- perform similar cleanup as in moveit#1294
- actually use KDL's LMA solver (was instantiated but not used)
- remove notion of mimic joints, as the LMA solver doesn't support this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants