-
Notifications
You must be signed in to change notification settings - Fork 626
Sophus and eigen version problem #187
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
Comments
the eigen version is 3.3.5 , and the newest version of sophus |
Are you absolutely sure it wasn't picking up some older Eigen from a different path? In my case, it was 3.2.92 (3.3-beta1) from Ubuntu 16.04. |
I am also trying to use the eigen, sophus and ceres libraries together. Eigen Library Version : 3.3.7 I am able to compile everything. But when I run my code, I get following error /usr/local/include/eigen3/Eigen/src/Core/functors/AssignmentFunctors.h:24:102: error: cannot convert ‘const ceres::Jet<double, 7>’ to ‘double’ in assignment |
@ParikaGoel Maybe you used 'AutoDiffCostFunction', right? |
Yes I am using 'AutoDiffCostFunction'. template |
@ParikaGoel Maybe you can delete this part of the code temporarily to see if the error disappear. I'm not sure you have the same error as me. If you confirm that and know the type of data(double or float or others) exactly, you can have a try to replace the 'AutoDiffCostFunction' with 'CostFunctionToFunctor' . I didn't solved the version problem yet but I used the 'CostFunctionToFunctor' to solve it. I hope it will help you. |
@ParikaGoel, your error has nothing to do with the eigen / sophus / ceres version. You need to use the template parameter
Looks like maybe for |
Thanks for the explanation...this worked for me :) |
Found this error in another repo using sophus as a dependency, is there a solution for this? |
To fix the error about missing |
Thanks! |
Hi @NikolausDemmel, my system is ubuntu16.04, the system's eigen default is installed in
But the config file seems like not find the my locally installed eigen, still found the system's eigen. How to set to use the >3.3.0 version eigen, not the system's old eigen(3.2.92). Thanks for your help and time!
|
Check the find module: https://github.com/strasdat/Sophus/blob/master/cmake_modules/FindEigen3.cmake It's rather limited, but I think you can either explicitly set Or you change the main cmake file to call Line 32 in 593db47
CMAKE_PREFIX_PATH , which should then first find your custom version if you set it accordingly: Line 35 in 593db47
|
Yes, @NikolausDemmel , thanks for your help!
It found my custom eigen 3.3.7, but it also found ceres, which is built with eigen 3.2.92 a long time before.
I have no idea why it will find ceres. If I ignore this mismatch, continue to |
Ceres is just used in one of the tests. You can uncomment the corresponding part in the cmakelists and not build that test. Or you rebuild ceres from scratch with the right eigen version. I had some success with passing |
I got the similar error "can not find eigen" with cmake 3.22.5, eigen 3.40, VS2019. Finally, cmake can find eigen now. I did not the reason but it worked. Maybe the "CMAKeLists.txt" should upadate. |
Are you using Sophus from another project with add_subdirectory? |
/usr/local/include/sophus/so2.hpp:98:40: error: ‘ScalarBinaryOpTraits’ in namespace ‘Eigen’ does not name a type
using ReturnScalar = typename Eigen::ScalarBinaryOpTraits<
^
/usr/local/include/sophus/so2.hpp:102:26: error: ‘ReturnScalar’ was not declared in this scope
using SO2Product = SO2<ReturnScalar>;
^
/usr/local/include/sophus/so2.hpp:102:39: error: template argument 1 is invalid
using SO2Product = SO2<ReturnScalar>;
^
/usr/local/include/sophus/so2.hpp:105:32: error: ‘ReturnScalar’ was not declared in this scope
using PointProduct = Vector2<ReturnScalar>;
^
/usr/local/include/sophus/so2.hpp:105:45: error: template argument 1 is invalid
using PointProduct = Vector2<ReturnScalar>;
^
/usr/local/include/sophus/so2.hpp:108:43: error: ‘ReturnScalar’ was not declared in this scope
using HomogeneousPointProduct = Vector3<ReturnScalar>;
^
/usr/local/include/sophus/so2.hpp:108:56: error: template argument 1 is invalid
using HomogeneousPointProduct = Vector3<ReturnScalar>;
^
/usr/local/include/sophus/so2.hpp:206:15: error: ‘SO2Product’ does not name a type
SOPHUS_FUNC SO2Product operator*(
^
/usr/local/include/sophus/so2.hpp:241:15: error: ‘PointProduct’ does not name a type
SOPHUS_FUNC PointProduct operator*(
^
/usr/local/include/sophus/so2.hpp:257:15: error: ‘HomogeneousPointProduct’ does not name a type
SOPHUS_FUNC HomogeneousPointProduct operator*(
^
/usr/local/include/sophus/so2.hpp:281:38: error: ‘ReturnScalar’ was not declared in this scope
std::is_same<Scalar, ReturnScalar>::value>::type>
^
/usr/local/include/sophus/so2.hpp:281:51: error: template argument 2 is invalid
std::is_same<Scalar, ReturnScalar>::value>::type>
^
/usr/local/include/sophus/so2.hpp:281:63: error: template argument 1 is invalid
std::is_same<Scalar, ReturnScalar>::value>::type>
^
/usr/local/include/sophus/so2.hpp:281:73: error: ‘type’ in namespace ‘::’ does not name a type
std::is_same<Scalar, ReturnScalar>::value>::type>
The text was updated successfully, but these errors were encountered: