Skip to content

Small matrix calc speedup in collision_distance_field_types#666

Merged
AndyZe merged 4 commits intomoveit:mainfrom
AndyZe:andyz/use_transpose_when_possible
Oct 2, 2021
Merged

Small matrix calc speedup in collision_distance_field_types#666
AndyZe merged 4 commits intomoveit:mainfrom
AndyZe:andyz/use_transpose_when_possible

Conversation

@AndyZe
Copy link
Copy Markdown
Member

@AndyZe AndyZe commented Sep 5, 2021

I thought it would be a good idea to scour the codebase for places where the fact that (rotation matrix transpose) == (rot. matrix inverse) could be used to speed up calculations. Since a transpose is cheaper than an inverse.

This is the only place I found where that applies.

Eigen has some internal optimizations for Isometry3d types, but I doubt it's smart enough to look ahead and realize it only needs to invert the 3x3 rotation matrix.

Reviewers will need a slightly advanced background in linear algebra, which is why I tagged @mamoll and @v4hn.

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 5, 2021

Codecov Report

Merging #666 (2f26a02) into main (11e7cf4) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #666      +/-   ##
==========================================
- Coverage   54.19%   54.18%   -0.01%     
==========================================
  Files         192      192              
  Lines       20187    20187              
==========================================
- Hits        10939    10936       -3     
- Misses       9248     9251       +3     
Impacted Files Coverage Δ
...on_distance_field/collision_distance_field_types.h 61.06% <0.00%> (ø)
...dl_kinematics_plugin/src/kdl_kinematics_plugin.cpp 74.72% <0.00%> (-1.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11e7cf4...2f26a02. Read the comment docs.

@AndyZe AndyZe requested review from mamoll and v4hn September 13, 2021 13:30
@AndyZe AndyZe merged commit bf39dca into moveit:main Oct 2, 2021
@simonschmeisser
Copy link
Copy Markdown
Contributor

I'm curious: did you measure a real speed-up here? I would expect Eigen to be smart enough here

@AndyZe
Copy link
Copy Markdown
Member Author

AndyZe commented Oct 11, 2021

I didn't actually benchmark it...

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