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
Make getJacobian simpler and faster #2389
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool!
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2389 +/- ##
==========================================
+ Coverage 50.74% 50.77% +0.03%
==========================================
Files 386 386
Lines 31971 31972 +1
==========================================
+ Hits 16221 16230 +9
+ Misses 15750 15742 -8
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind adding some comments in front of the main blocks to explain what is happening there? I think that will help maintaining this in the future
Thanks for the reviews. |
Co-authored-by: Sebastian Castro <4603398+sea-bass@users.noreply.github.com>
* Make getJacobian simpler and faster * readability and const-correctness * fix issue when joint group is not at URDF origin * Update moveit_core/robot_state/src/robot_state.cpp
Description
This change makes
getJacobian
a little bit more readable (hopefully!), while also making it 2x faster, by removing string comparisons where possible and other little optimizations.The jacobian benchmark shows a ~2x improvement with respect to HEAD (>500ns), and ~4x with respect to the KDL Jacobian, for the panda robot:
The recently added Jacobian tests for the different types of joints are also passing.
Also manually tested this with Servo, which I know uses the MoveIt! Jacobian.
Note:
a_pose_b
is a notation I have used in the past to denote a transformation matrix to convert points inb
to points ina
, e.g:point_a = a_pose_b * point_b
. Not sure if there's another established notation if MoveIt!. Happy to change to whatever makes more sense.Checklist