Fast-LIVO复现之环境搭建与驱动调试--Sophus库编译问题

硬件:windows上的ubuntu虚拟机

软件:Ubuntu18.04 ; ROS melodic

按照官方文档GitHub - hku-mars/FAST-LIVO: A Fast and Tightly-coupled Sparse-Direct LiDAR-Inertial-Visual Odometry (LIVO).复现的时候

编译时候遇到这个问题

/usr/bin/cmake -H/home/wyl/Sophus -B/home/wyl/Sophus/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/wyl/Sophus/build/CMakeFiles /home/wyl/Sophus/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/wyl/Sophus/build'
make -f CMakeFiles/Sophus.dir/build.make CMakeFiles/Sophus.dir/depend
make[2]: Entering directory '/home/wyl/Sophus/build'
cd /home/wyl/Sophus/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/wyl/Sophus /home/wyl/Sophus /home/wyl/Sophus/build /home/wyl/Sophus/build /home/wyl/Sophus/build/CMakeFiles/Sophus.dir/DependInfo.cmake --color=
Scanning dependencies of target Sophus
make[2]: Leaving directory '/home/wyl/Sophus/build'
make -f CMakeFiles/Sophus.dir/build.make CMakeFiles/Sophus.dir/build
make[2]: Entering directory '/home/wyl/Sophus/build'
[  5%] Building CXX object CMakeFiles/Sophus.dir/sophus/so2.cpp.o
/usr/bin/c++  -DSophus_EXPORTS -I/usr/include/eigen3  -O3 -DNDEBUG  -fPIC   -Wall -Werror -Wno-unused-variable                    -Wno-unused-but-set-variable -Wno-unknown-pragmas  -o CMakeFiles/Sophus.dir/sophus/so2.cpp.o -c /home/wyl/Sophus/sophus/so2.cpp
/home/wyl/Sophus/sophus/so2.cpp: In constructor ‘Sophus::SO2::SO2()’:
/home/wyl/Sophus/sophus/so2.cpp:32:28: error: lvalue required as left operand of assignment
   unit_complex_.real() =(1.);
                            ^
/home/wyl/Sophus/sophus/so2.cpp:33:28: error: lvalue required as left operand of assignment
   unit_complex_.imag() =(0.);
                            ^
CMakeFiles/Sophus.dir/build.make:65: recipe for target 'CMakeFiles/Sophus.dir/sophus/so2.cpp.o' failed
make[2]: *** [CMakeFiles/Sophus.dir/sophus/so2.cpp.o] Error 1
make[2]: Leaving directory '/home/wyl/Sophus/build'
CMakeFiles/Makefile2:144: recipe for target 'CMakeFiles/Sophus.dir/all' failed
make[1]: *** [CMakeFiles/Sophus.dir/all] Error 2
make[1]: Leaving directory '/home/wyl/Sophus/build'
Makefile:143: recipe for target 'all' failed
make: *** [all] Error 2

进入到报错的目录下

把so2.cpp里的32-36行的内容改为:

SO2::SO2()
{
  unit_complex_.real(1.);
  unit_complex_.imag(0.);
}

如果只是加个括号不对,还是直接复制这个过去才可以

然后再重新make即可编译成功

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值