-
Notifications
You must be signed in to change notification settings - Fork 797
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
Pose3::Adjoint(xi)
Jacobians
#885
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.
Some comments.
I merged the latest |
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.
Fixed various stuff so LGTM.
I am wondering why you made the tolerances tighter. I made them looser because the CI wasn't passing, and this is because the scale of the values in the matrix were quite different, so it's more of a numerical stability issue than anything else. |
This reverts commit 761987a.
Ya idk why I made the tolerances higher - that was stupid - late night fogginess |
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.
If cross does not have derivatives, it probably should have, and they should be used below, and wherever we jump through hoops to compute them in place.
I’d like to sit down for 30 minutes after you have taken into account my comments. See how far you get with the PDF rewrite I’m asking.
@dellaert In general I think a lot of these comments are directed at my (maybe misguided) attempts at reducing copy operations, since so there's so many matrices that are the same (e.g. derivatives for all the rotate operations w.r.t. point being rotated are all the same). Also, I tried to keep the chain-rule stuff for readability, which explains why I have so many aliases ( Would you like to:
? |
Try to avoid calculating R.matrix many times, and don't use chain rule if it threatens do re-compute R.matrix(). But I would use cross derivatives (I checked and they exist). And then make the math.pdf match the code exactly. It really is just
If you will pass a matrix in a derivative slot, make sure it has right size and is not a reference. |
Hey Gerry, before I review, can we figure out the CI failures? The issue seems to be in the way you're passing in the matrices for OptionalJacobians. Please be sure to run tests locally since the CI does take a hot minute to complete. |
Varun hold off on a review. I'd like to see another iteration from gerry before you review, as well. The CI is failing which I think might be because of an uninitialized memory of Rw? I commented on that in my review. |
It's because of a const and the fact that we're not passing in a reference to the matrix. |
@dellaert It took a lot of reading but figured out that the derivative
Note: |
ping @dellaert , can you review this? |
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.
Incredible!
if (H_pose) { | ||
const auto &w_T_hat = skewSymmetric(AdTx.head<3>()), | ||
&v_T_hat = skewSymmetric(AdTx.tail<3>()); | ||
*H_pose = (Matrix6() << w_T_hat, v_T_hat, // |
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.
seems very similar to AdT
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.
Yes, similar but not quite exactly the same
[what, vhat
vhat, 0 ];
vs adT:
[what, vhat,
0, what];
vs AdT:
[R', -R*that,
0, R' ];
I tried for a while to figure out a cleaner representation and to figure out why it was so close to but not quite adT or AdT, but finally I gave up. Although maybe there is some simplification, I couldn't find it nor could I figure out a way to derive this without just working through the algebra. I tried reading up on lie coalgebras but it was just way too dense for me to parse at my current knowledge level.
Closes #433
This PR implements the Jacobians for
Pose3::Adjoint(x)
:=Pose3::AdjointMap() * x
.It uses
Rot3.rotate
andcross(Point3, Point3)
to calculate intermediate derivatives.This should help in GTDynamics to eliminate the
AdjointMapJacobianQ
function and allow it to be generalized to other joint types.