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

error when catkin_make for OA-LICalib: YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES with regard to eigen-3.3.7 #11

Open
newerbot opened this issue Feb 23, 2023 · 6 comments

Comments

@newerbot
Copy link

newerbot commented Feb 23, 2023

On Ubuntu 20.04 with ROS-Noetic, libeigen-dev-3.3.7-2, Sophus-1.22.10 (y2022-feb)

$ catkin_make -j1 (trying to build OA-LICalib ROS-package)

[ 11%] Building CXX Object OA-LICalib/CMakeFiles/lib_calib.dir/src/trajectory/trajectory_estimator.cpp.o
In file included from /usr/include/eigen3/Eigen/Core:366,
from /usr/include/ceres/jet.h: 145
from /usr/include/ceres/internal/autodiff.h:145,
from /usr/include/ceres/autodiff_cost_function.h:132,
from /usr/include/ceres/ceres.h:37,
from OA-LICalib-git/include/trajectory/trajectory_estimator.h:26,
from OA-LICalib-git/include/trajectory/trajectory_estimator.cpp:23:
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h: In instantiation of 'void Eigen::internal::call_assignment(Dst&, const Src&, const Func&) [with Dst = Eigen::Map<Eigen::Matrix<double, 4, 3, 1, 4, 3>, 0, Eigen::Stride<0, 0> >; Src = Eigen::Transpose<Eigen::Matrix<double, 4, 3, 0, 4, 3> >; Func = Eigen::internal::assign_op<double, double>]':
...
/usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:804:27 required from 'void Eigen::internal::call_assignment(Dst&, const Src&) [with Dst = Eigen::Map<Eigen::Matrix<double, 4, 3, 1, 4, 3>, 0, Eigen::Stride<0, 0> >; Src = Eigen::Transpose<Eigen::Matrix<double, 4, 3, 0, 4, 3> >]'
...
OA-LICalib-git/include/basalt/spline/ceres_local_param.hpp:104:14: required from 'bool bsalt::LieLocalParameterization::ComputeJacobian(const double*, double*) const [with Groupd = Sophus::SO3]'
OA-LICalib-git/include/basalt/spline/ceres_local_param.hpp:98:16: required from here /usr/include/eigen3/Eigen/src/Core/AssignEvaluator.h:833:3 error: static assertion failed: YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES
833 | EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(ActualDstTypeCleaned,Src)

make[2]: *** [OA-LICalib/CMakeFiles/lib_calib.dir/build.make:76: OA-LICalib/CMakeFiles/lib_calib.dir/src/trajectory/trajectory_estimator.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1059: OA-LICalib/CMakeFiles/lib_calib.dir/all] Error 2
make: *** [Makefile: all] Error 2

@haoxinnihao
Copy link

I also have this problem. Did you have solve it?

@yeyanan93
Copy link

@haoxinnihao 你好,你解决这个问题了吗?

@haoxinnihao
Copy link

haoxinnihao commented May 31, 2023 via email

@Louis-Horns-XIAO
Copy link

Louis-Horns-XIAO commented Jun 1, 2023

2023.6.4
using Ceres 2.1.0 Sophus 1.22.10 Pangolin 0.5 Eigen 3.3.9
Passed run test, seems ok.


Found a solution(Perhaps it will work), at lest I have passed the error check.
Later I will run totally to check if it really works.

error location:

/OA-LICalib-git/include/basalt/spline/ceres_local_param.hpp , line 104
jacobian = T.Dx_this_mul_exp_x_at_0().transpose();

Casue:

the definition of Eigen::Matrix:

Matrix<typename Scalar,
       int RowsAtCompileTime,
       int ColsAtCompileTime,
       int Options = 0,
       int MaxRowsAtCompileTime = RowsAtCompileTime,
       int MaxColsAtCompileTime = ColsAtCompileTime>

Options = 0 means the matrix is stored in Column Major Order (default).
Thus:
jacobian -> Eigen::RowMajor, manually defined.
While T.Dx_this_mul_exp_x_at_0().transpose() -> ColMajor

Wield, I didn't find a Function to transform these two... so the operator "=" (perhaps) is capable to handle that.
Code above are common if using LocalParameterizationSE3 (ceres), so I have no idea why it doesn't work now...

My Solution:

To pass the error check, I use a Dynamic Matrix ’ tmp’ to replace the assignment operation.

 Eigen::MatrixXd tmp = T.Dx_this_mul_exp_x_at_0().transpose();
    jacobian = tmp;

So jacobian keeps in Row Major Order.

@CoderGenJ
Copy link

2023.6.4 using Ceres 2.1.0 Sophus 1.22.10 Pangolin 0.5 Eigen 3.3.9 Passed run test, seems ok.

Found a solution(Perhaps it will work), at lest I have passed the error check. Later I will run totally to check if it really works.

error location:

/OA-LICalib-git/include/basalt/spline/ceres_local_param.hpp , line 104 jacobian = T.Dx_this_mul_exp_x_at_0().transpose();

Casue:

the definition of Eigen::Matrix:

Matrix<typename Scalar,
       int RowsAtCompileTime,
       int ColsAtCompileTime,
       int Options = 0,
       int MaxRowsAtCompileTime = RowsAtCompileTime,
       int MaxColsAtCompileTime = ColsAtCompileTime>

Options = 0 means the matrix is stored in Column Major Order (default). Thus: jacobian -> Eigen::RowMajor, manually defined. While T.Dx_this_mul_exp_x_at_0().transpose() -> ColMajor

Wield, I didn't find a Function to transform these two... so the operator "=" (perhaps) is capable to handle that. Code above are common if using LocalParameterizationSE3 (ceres), so I have no idea why it doesn't work now...

My Solution:

To pass the error check, I use a Dynamic Matrix ’ tmp’ to replace the assignment operation.

 Eigen::MatrixXd tmp = T.Dx_this_mul_exp_x_at_0().transpose();
    jacobian = tmp;

So jacobian keeps in Row Major Order.

我试了之后发现只是编译通过,但是,跑的结果点云是乱的.为此,我直接把 transpose()删除,结果是正常的.
jacobian = T.Dx_this_mul_exp_x_at_0();

@CoderGenJ
Copy link

2023.6.4 using Ceres 2.1.0 Sophus 1.22.10 Pangolin 0.5 Eigen 3.3.9 Passed run test, seems ok.
Found a solution(Perhaps it will work), at lest I have passed the error check. Later I will run totally to check if it really works.

error location:

/OA-LICalib-git/include/basalt/spline/ceres_local_param.hpp , line 104 jacobian = T.Dx_this_mul_exp_x_at_0().transpose();

Casue:

the definition of Eigen::Matrix:

Matrix<typename Scalar,
       int RowsAtCompileTime,
       int ColsAtCompileTime,
       int Options = 0,
       int MaxRowsAtCompileTime = RowsAtCompileTime,
       int MaxColsAtCompileTime = ColsAtCompileTime>

Options = 0 means the matrix is stored in Column Major Order (default). Thus: jacobian -> Eigen::RowMajor, manually defined. While T.Dx_this_mul_exp_x_at_0().transpose() -> ColMajor
Wield, I didn't find a Function to transform these two... so the operator "=" (perhaps) is capable to handle that. Code above are common if using LocalParameterizationSE3 (ceres), so I have no idea why it doesn't work now...

My Solution:

To pass the error check, I use a Dynamic Matrix ’ tmp’ to replace the assignment operation.

 Eigen::MatrixXd tmp = T.Dx_this_mul_exp_x_at_0().transpose();
    jacobian = tmp;

So jacobian keeps in Row Major Order.

我试了之后发现只是编译通过,但是,跑的结果点云是乱的.为此,我直接把 transpose()删除,结果是正常的. jacobian = T.Dx_this_mul_exp_x_at_0();
这个地方报错的本质原因是row major不同,参考strasdat/Sophus#151

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

5 participants