g2o编译错误

/ORBSLAM2_with_pointcloud_map/g2o_with_orbslam2/g2o/types/slam2d/edge_se2_pointxy_bearing.cpp:51:39: error: cannot convert ‘Eigen::Rotation2D::Scalar’ {aka ‘double’} to ‘const Rotation2Dd&’ {aka ‘const Eigen::Rotation2D&’}
51 | t.setRotation(t.rotation().angle()+_measurement);
| ~~~~~~~~^
| |
| Eigen::Rotation2D::Scalar {aka double}

解决办法 相应文件中51行

 t.setRotation(t.rotation().angle()+_measurement);

改为

t.setRotation((Eigen::Rotation2Dd)(t.rotation().angle()+_measurement));

/usr/local/include/eigen3/Eigen/src/Core/util/XprHelper.h:833:96: error: static assertion failed: YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY
833 | gen::internal::has_ReturnType<ScalarBinaryOpTraits<LHS, RHS,BINOP> >::value),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~

/usr/local/include/eigen3/Eigen/src/Core/util/StaticAssert.h:33:54: note: in definition of macro ‘EIGEN_STATIC_ASSERT’
33 | #define EIGEN_STATIC_ASSERT(X,MSG) static_assert(X,#MSG);
| ^
/usr/local/include/eigen3/Eigen/src/Core/AssignEvaluator.h:834:3: note: in expansion of macro ‘EIGEN_CHECK_BINARY_COMPATIBILIY’

将/ORBSLAM2_with_pointcloud_map/g2o_with_orbslam2/g2o/solvers/eigen/linear_solver_eigen.h
54行

typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, SparseMatrix::Index> PermutationMatrix;

改为

typedef Eigen::PermutationMatrix<Eigen::Dynamic, Eigen::Dynamic, int> PermutationMatrix;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值