Registered Member
|
Eigen 3.2.2, Mac OSX El Capitan.
Hi. As part of a large robotics project, I wrote this function:
which pretends to use Eigen's ability to convert from different rotation representations to write the logarithm of a quaternion via AngleAxis. When using a Quaternion<ceres::Jet> type, we have Derived::Scalar = ceres::Jet<double, 7> and the following error occurs at compile time:
which refers to line 181 in AngleAxis.h, with the operator=,
In this line 181, we see:
which is comparing a ceres::Jet q.w() against an 'int' scalar (not even a double!). Usually, we would rather cast the plain scalar for Jet compatibility (ceres::Jet is very picky with these otherwise obvious binary operators)
being Scalar precisely the ceres::Jet type, through the template definition (or at least I assume so). I tried to alter this line as suggested above, and other errors then followed, like this:
This second error is now cryptic to me. So I stopped my investigation and reverted to a custom implementation of my log_q function (which is not very complicated anyway). Am I doing anything wrong? Could I expect Eigen's AngleAxis to accept a Quaternion<Jet> and work at all? Is this a minor Eigen bug, or would this fix require major redesign efforts? Thank you. |
Moderator
|
Please check with a recent version of Eigen first.
|
Registered Member
|
Sorry for the old version. Just tried with Eigen 3.3.4. The issue remains exactly the same as explained in the original post.
|
Registered Member
|
In order to narrow the issue, I have edited the 'AngleAxis::operator=' function to:
that is, I casted the lonely '0' value, and commented out the 'stableNorm()' call, which was giving problems. My 'log_q' function now compiles and executes correctly. |
Moderator
|
I checked and both problems have been fixed a while ago. For "highest" you need to update ceres. For Scalar(0), you need the head of the 3.3 branch (will be 3.3.5).
|
Registered Member
|
Thanks for this answer. Success required both HEAD versions of eigen and ceres-solver. In this order:
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]