Skip to content
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

test_ceres_se3 test compiling error #73

Closed
yuzhangbit opened this issue Feb 24, 2017 · 4 comments
Closed

test_ceres_se3 test compiling error #73

yuzhangbit opened this issue Feb 24, 2017 · 4 comments

Comments

@yuzhangbit
Copy link

The test_ceres_se3 test example has a compiling error below when building the Sophus library.

Sophus/test/ceres/test_ceres_se3.cpp:119:1:   required from here
/usr/include/eigen3/Eigen/src/Core/IO.h:132:96: error: no matching function for call to ‘ceil(ceres::Jet<double, 7>)’
     return cast<RealScalar,int>(ceil(-log(NumTraits<RealScalar>::epsilon())/log(RealScalar(10))));
                                                                                                ^
/usr/include/eigen3/Eigen/src/Core/IO.h:132:96: note: candidates are:
In file included from /usr/include/features.h:374:0,
                 from /usr/include/x86_64-linux-gnu/c++/4.8/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/4.8/bits/c++config.h:426,
                 from /usr/include/c++/4.8/cmath:41,
                 from /usr/local/include/ceres/jet.h:159,
                 from /usr/local/include/ceres/internal/autodiff.h:145,
                 from /usr/local/include/ceres/autodiff_cost_function.h:132,
                 from /usr/local/include/ceres/ceres.h:37,
                 from /home/robot/workspace/lib_sources/Sophus/test/ceres/test_ceres_se3.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:178:1: note: double ceil(double)
 __MATHCALLX (ceil,, (_Mdouble_ __x), (__const__));
 ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:178:1: note:   no known conversion for argument 1 from ‘ceres::Jet<double, 7>’ to ‘double’

Environment

  • ubuntu 14.04.5 x64
@strasdat
Copy link
Owner

strasdat commented Feb 26, 2017

Yeah, currently Sophus+Ceres together only works with a specific version of Eigen.

The underlying issue is that Ceres::Jet types don't play very nicely together with Eigen::Matrix when it comes to insertion overloads std::ostream operator<<. In particular, Sophua relies on some internal API of Eigen to print Eigen::Matrix<Jet<...>>. Obviously, relying on Eigen's internal API is not ideal, since it changes quite significant between different Eigen versions.

I will look into this, but it'll take me a couple of weeks or so...

@strasdat
Copy link
Owner

Can you try it with Eigen 3.3.3 and the latest version of Ceres (from the master branch)? This should work.

I will add Ceres to Travis CI soon.

@yuzhangbit
Copy link
Author

@strasdat Thank you very much. Will do it and provide the feedback soon.

@yuzhangbit
Copy link
Author

+1 . It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants