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
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.
Thanks Gael. I´ll double-check my installed versions. I think I am at Ceres 1.12...
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com'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: https://gitlab.com/libeigen/eigen/issues/1540.