一,如何复现fast-livo2
github链接:https://github.com/hku-mars/FAST-LIVO2?tab=readme-ov-file
gitee链接:Fast-livo2-native: 原生版fast-livo2
根据这下面的说明来即可,一般不会出现大的问题
二,问题
1,报错error: lvalue required as left operand of assignment 32 | unit_complex_.real() = 1.;
/home/cp/Sophus/sophus/so2.cpp:32:26: error: lvalue required as left operand of assignment 32 | unit_complex_.real() = 1.;
解决办法:
找到Sophus/sophus目录下的so2.cpp文件
将:
SO2::SO2()
{
unit_complex_.real() = 1.;
unit_complex_.img() = 0.;
}
改为:
SO2::SO2()
{
unit_complex_.real(1.);
unit_complex_.img(0.);
}
就解决了。
2,报错:ModuleNotFoundError: No module named 'netifaces'
如果的python很新,和我一样达到了3.9左右,建议你不要直接这样下载:
sudo apt-get install python3-netifaces
因为这个版本太低了,我写文章的这个时间,应该下载的是(0.10.4-1ubuntu4),不适配python3.9
解决办法:
你可以重新输入命令
pip install netifaces==0.11.0
也可去往netifaces · PyPI找到合适自己的版本。
3,报错
terminate called after throwing an instance of 'image_transport::TransportLoadException'
what(): Unable to load plugin for transport 'compressed', error string:
According to the loaded plugin descriptions the class image_transport/compressed_sub with base class type image_transport::SubscriberPlugin does not exist. Declared types are image_transport/raw_sub
[republish-4] process has died [pid 7640, exit code -6, cmd /opt/ros/noetic/lib/image_transport/republish compressed in:=/left_camera/image raw out:=/left_camera/image __name:=republish __log:=/home/cp/.ros/log/7b0e0cb0-f366-11ef-a5fb-0be71178afff/republish-4.log].
log file: /home/cp/.ros/log/7b0e0cb0-f366-11ef-a5fb-0be71178afff/republish-4*.log
[republish-4] restarting process
process[republish-4]: started with pid [7656]
从错误信息来看,image_transport
插件加载失败,特别是 compressed
传输类型的插件无法加载。错误指出加载插件描述时,image_transport/compressed_sub
插件类不存在,而系统只能找到 image_transport/raw_sub
插件类。
解决办法:
安装 image_transport_plugins
包
sudo apt-get install ros-noetic-image-transport-plugins