This bugzilla service is closed. All entries have been migrated to
Bug 1540 - Transform API not completely compatible with ceres::Jet scalar types
Summary: Transform API not completely compatible with ceres::Jet scalar types
Alias: None
Product: Eigen
Classification: Unclassified
Component: Geometry (show other bugs)
Version: 3.5 (future version)
Hardware: All All
: Normal Wrong Result
Assignee: Nobody
Keywords: wrong-result
Depends on:
Reported: 2018-04-09 08:21 UTC by Joan Solà
Modified: 2019-12-04 17:37 UTC (History)
5 users (show)


Description Joan Solà 2018-04-09 08:21:30 UTC
When constructing Transform objects with scalar of type ceres::Jet, some of the accessors fail and return nan.

An example from our code:

typedef ceres::Jet<double, 28> T;  
typedef Eigen::Transform<T, 3, Eigen::Affine> TransformType;
Eigen::Matrix<T,3,1>  _wtr1, _wtr2, _rtc;
Eigen::Quaternion<T> _wqr1, _wqr2, _rqc;

TransformType wHr1 = Eigen::Translation<T, 3>(_wtr1) * _wqr1;
TransformType wHr2 = Eigen::Translation<T, 3>(_wtr2) * _wqr2;
TransformType rHc  = Eigen::Translation<T, 3>(_rtc)  * _rqc ;

TransformType c1Hc2 = rHc.inverse() * wHr1.inverse() * wHr2 * rHc;

// These accesses are OK
std::cout << c1Hc2.matrix() << std::endl;               // OK
std::cout << c1Hc2.inverse().matrix() << std::endl;     // OK
std::cout << c1Hc2.rotation().transpose() << std::endl; // OK

// These accesses are not OK and produce all nans type `[nan ; nan nan ...]`
std::cout << c1Hc2.inverse().rotation() << std::endl;             // nan's
std::cout << c1Hc2.inverse().rotation().transpose() << std::endl; // nan's
Comment 1 Gael Guennebaud 2018-04-11 09:45:26 UTC
Works for me (I just copy/pasted your code within an empty main() {}) using eitehr clang or gcc.

I'm using ceres 1.13.0.
Comment 2 Joan Solà 2018-04-18 08:20:02 UTC
Thanks Gael. I´ll double-check my installed versions. I think I am at Ceres 1.12...
Comment 3 Nobody 2019-12-04 17:37:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance:

Note You need to log in before you can comment on or make changes to this bug.