0


【配置Omni-Swarm(omni swarm:开源的多机器人协同CSLAM算法)更新中】

配置Omni-Swarm(omni swarm:开源的多机器人协同SLAM算法)更新中

旨在记录配置Omni-Swarm过程

文章目录

1 简介

Omni-swarm: A Decentralized Omnidirectional Visual-Inertial-UWB State Estimation System for Aerial Swarms
Omni-swarm是一种用于空中群体的分布式全向视觉惯性超宽带(visual-inertial-UWB)状态估计系统。为了解决可观测性、复杂初始化、精度不足和缺乏全局一致性等问题,引入了全向感知系统作为Omni-swarm的前端,包括全向传感器,如立体鱼眼摄像头和超宽带(UWB)传感器,以及算法,包括鱼眼视觉惯性里程计(VIO)、多无人机基于地图的定位和视觉目标检测。该系统采用基于图优化和前向传递的方式作为Omni-swarm的后端,融合来自前端的测量数据。根据实验结果,所提出的分布式状态估计方法在群体系统上实现了厘米级的相对状态估计精度,并确保了全局一致性。此外,通过Omni-swarm的支持,无需任何外部设备就可以在完全分布式的方案中实现无人机之间的避障,展示了Omni-swarm在不同场景下成为自主空中群体飞行的基础的潜力。
论文地址
代码地址


2 配置过程

配置环境为Ubuntu18.04 amd64

2.1 ROS安装

最简便的ROS安装方法是采用鱼香ROS编写的fishROS一键安装脚本,使用过程如下
打开终端,运行以下代码:

sudo wget http://fishros.com/install -O fishros && sudo bash fishros

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Etd515dE-1688477757077)(vx_images/374811791548822.png =632x)]

输入“1”以安装ROS,进到以下选择界面
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-c4Hjqy8I-1688477757078)(vx_images/234343135577250.png =632x)]

如果自己换过源则选择“2”,未换过源的选择“1”自动换源(amd64为清华源)
按照指示换完源后到以下选择界面
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-CL6H9OyS-1688477757079)(vx_images/597113354927504.png =632x)]

选择“1”安装ROS1
图中为20.04示例,18.04对应的ros版本为melodic

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-PMARbFeu-1688477757080)(vx_images/259133898890349.png =632x)]

选择“1”桌面版,等待安装完成

安装完成后运行roscore测试如下
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-7p2zJSy7-1688477757080)(vx_images/291165710625513.png)]

ros安装完成

2.2 下载Omni-Swarm源码、CNN模型及数据集

1 源码下载
Omni-swarm可进入链接下载,也可使用git下载:

sudo apt install git
git clone https://github.com/HKUST-Aerial-Robotics/Omni-swarm.git

网络问题git不下来可以用以下命令git:

git clone https://mirror.ghproxy.com/https://github.com/HKUST-Aerial-Robotics/Omni-swarm.git

这种方式下载下来的是针孔相机版本,需要使用鱼眼相机版本于VINS-Fisheye网址下载源码
将git下来的包放入自己创建的工作空间,我的工作空间结构为:

/omni-swarm_ws/src/Omni-swarm-pinhole_compatiable

2 CNN模型下载
根据readme所述,须于此网址(科学上网)下载models文件夹
放于/Omni-swarm_ws/src/Omni-swarm/swarm_loop

3 数据集下载
此网址(科学上网)下载数据集
三个压缩包,共31.5g
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-fsMAO5oM-1688477757080)(vx_images/118585598899745.png)]

2.3 下载依赖

根据README.md文件所述,需要下载安装:

  • swarm_msgs
  • inf_uwb_ros

参考此博客为了编译通过还需要安装以下未提到的依赖:

  • libtorch
  • TensorRT
  • lcm
  • libSGM
  • yolo-tensorrt
  • camera_models
  • dw
  • backward-cpp
  • faiss
  • graphviz

1 swarm_msgs和inf_uwb_ros
swarm_msgs和inf_uwb_ros直接git到主目录

git clone https://mirror.ghproxy.com/https://github.com/HKUST-Swarm/swarm_msgs.git
git clone https://mirror.ghproxy.com/https://github.com/HKUST-Swarm/inf_uwb_ros.git

2 libtorch和tensorRT
参考此博客
首先,查看cuda版本

nvcc --version

在这里插入图片描述

查看torch版本

python
>>import torch
>>print(torch.__version__)

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-zo4ExPrg-1688477757082)(vx_images/458602689899669.png)]

根据以上版本在此博客选择对应的libtorch版本下载
在此博客选择对应的tensorRT版本下载,本机下载tensorRT7.1.3.4
将lib绝对路径添加到环境变量中:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/d/Library/TensorRT-7.1.3.4.Ubuntu-18.04.x86_64-gnu.cuda-11.0.cudnn8.0/TensorRT-7.1.3.4/lib

为了避免其它软件找不到 TensorRT 的库,建议把 TensorRT 的库和头文件添加到系统路径下:

sudo cp -r ./lib/* /usr/lib
sudo cp -r ./include/* /usr/include

其使用需要修改omni-swarm的cmakelist,参考此博客

3 lcm
下载

git clone https://mirror.ghproxy.com/https://github.com/lcm-proj/lcmb.git

编译:

mkdir build
cd build/
cmake ..
make -j4
sudo make install    

4 yolo-tensorrt
下载dev-yolov4版本:

git clone https://mirror.ghproxy.com/https://github.com/enazoe/yolo-tensorrt/tree/dev-yolov4.git

修改cmakelist:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wno-write-strings")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,$ORIGIN")
set(Torch_DIR "$ENV{HOME}/3rdParty/libtorch/share/cmake/Torch")
find_package(Torch REQUIRED)
set(TENSORRT_ROOT $ENV{HOME}/3rdParty/TensorRT-7.1.3.4)
include_directories("$ENV{HOME}/3rdParty/TensorRT-7.1.3.4/include")

编译:

sudo apt-get install libgflags-dev
cd yolo-tensorrt/
mkdir build
cd build/
cmake ..
make

报错1:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-1E1cp2k9-1688477757082)(vx_images/343081793836497.png)]

原因:cuda版本错误,重装tensorRT相应版本的cuda(tensorRT7目前仅有cuda10.2版本以及cuda11.0版本)
重装后编译通过

5 dw

sudo apt-get install libdw-dev

6 backward-cpp

网址或git下载:

git clone https://mirror.ghproxy.com/https://github.com/bombela/backward-cpp.git

常规编译:

mkdir build
cd build/
cmake ..
make -j4
sudo make install 

7 faiss
安装参考此博客
1 安装依赖库openblas:

sudo apt-get install gfortran
git clone https://mirror.ghproxy.com/https://github.com/xianyi/OpenBLAS.git
cd OpenBLAS
make FC=gfortran
sudo make install

sudo ln -s /opt/OpenBLAS/lib/libopenblas.so  /usr/lib/libopenblas.so
sudo cp libopenblas.so.0  /usr/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/OpenBLAS/lib

2 安装依赖库lapack

# 下载lapack源码
wget http://www.netlib.org/lapack/lapack-3.4.2.tgz
tar -zxf lapack-3.4.2.tgz
# 首先当然是进入lapack-3.4.2文件夹,然后根据平台的特点,将INSTALL目录下对应的make.inc.XXX复制一份到 lapack-3.4.2目录下,并命名为make.inc, 这里我复制的是INSTALL/make.inc.gfortran,因为我这里用的是gfortran编译器
cd lapack-3.4.2
cp ./INSTALL/make.inc.gfortran ./
mv make.inc.gfortran make.inc

修改lapack-3.4.2/Makefile,因为lapack以来于blas库,所以需要做如下修改(注释第一句话,去掉注释第二句话):

#lib: lapacklib tmglib
lib: blaslib variants lapacklig tmglib

编译:
在lapack-3.4.2下运行:

# 编译所有的lapack文件
make
# 进入lapacke 文件夹,这个文件夹包含lapack的C语言接口文件 
cd lapacke
# 编译lapacke
make  

由于lapack的makefile文件中没有make isntall 命令,需要手工进行安装

# 将lapacke的头文件复制到系统头文件目录
sudo cp include/*.h /usr/include  
# 返回到 lapack-3.4.2 目录 
cd .. 
# 将生成的所有库文件复制到系统库目录 
sudo cp *.a /usr/lib 

3 编译安装faiss

#下载源码 // 这里注意代码路径
git clone https://mirror.ghproxy.com/https://github.com/RobotWithCV/faiss  
# 进入FAISS源码目录.
cd faiss
# 根据系统配置编译环境. [Linux 为例]
cp example_makefiles/makefile.inc.Linux ./makefile.inc

# 首先先执行./configure,看看环境是否符合编译条件,其中有一些不是必选项,一般只管输出日志的最后一句话有无错误即可
./configure

# 之后进行编译用例测试,若无报错即代表数学库安装成功
make misc/test_blas
./misc/test_blas

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vj7MZ37h-1688477757083)(vx_images/175224234951341.png)]

# 执行最重要的make & make install
make
sudo make install

8 graphviz

sudo apt install graphviz graphviz-dev

2.2 编译Omni-Swarm源码

前往Omni-swarm_ws运行:

catkin build

我首次编译只成功了4/9个包
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-dAbf9HGs-1688477757084)(vx_images/174054227586387.png)]

一个一个找问题

问题1:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-t7LckW5G-1688477757086)(vx_images/409255026132865.png)]

原因:缺少camera_models
解决方法:参考此博客下载VINS-Fisheye:

git clone https://mirror.ghproxy.com/https://github.com/HKUST-Aerial-Robotics/VINS-Fisheye.git

将里面的camera_models和vins_estimator复制到Omni的src中
同时下载bspline放入src中

git clone https://ghproxy.com/https://github.com/HKUST-Swarm/bspline

最终我的工作空间为这样:
在这里插入图片描述
问题2:
在这里插入图片描述OpenCV版本小于3.4,我的OpenCV为3.3.1,现安装OpenCV,参考此博客
多版本OPENCV共存参考此博客

注意:需要安装OPENCV+Contrib+CUDA.编译过程会遇到很多问题,目前我CUDA版本11.0使用了很多方法都不成功,后续可能考虑降cuda版本


2024年1月16日更新
目前使用ubuntu20.04 Opencv4.8.0+cuda12.1 Swarm_loop包编译到最终的链接过程失败,opencv和ros链接不了,其他包编译通过。
报错如下:

/usr/bin/ld: CMakeFiles/swarm_loop_net_tester.dir/src/loop_network_tester.cpp.o: in function `void ros::Publisher::publish<swarmcomm_msgs::drone_network_status_<std::allocator<void> > >(swarmcomm_msgs::drone_network_status_<std::allocator<void> > const&) const':
/opt/ros/noetic/include/ros/publisher.h:107: undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/usr/bin/ld: /opt/ros/noetic/include/ros/publisher.h:107: undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/usr/bin/ld: /opt/ros/noetic/include/ros/publisher.h:107: undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/usr/bin/ld: /opt/ros/noetic/include/ros/publisher.h:113: undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/usr/bin/ld: /opt/ros/noetic/include/ros/publisher.h:113: undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/usr/bin/ld: CMakeFiles/swarm_loop_net_tester.dir/src/loop_network_tester.cpp.o:/opt/ros/noetic/include/ros/publisher.h:113: more undefined references to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)' follow
/usr/bin/ld: CMakeFiles/swarm_loop_net_tester.dir/src/loop_network_tester.cpp.o: in function `bool ros::NodeHandle::param<int>(std::string const&, int&, int const&) const':
/opt/ros/noetic/include/ros/node_handle.h:2122: undefined reference to `ros::NodeHandle::hasParam(std::string const&) const'
/usr/bin/ld: /opt/ros/noetic/include/ros/node_handle.h:2124: undefined reference to `ros::NodeHandle::getParam(std::string const&, int&) const'
/usr/bin/ld: CMakeFiles/swarm_loop_net_tester.dir/src/loop_network_tester.cpp.o: in function `main':
/home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/loop_network_tester.cpp:67: undefined reference to `ros::init(int&, char**, std::string const&, unsigned int)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/loop_network_tester.cpp:68: undefined reference to `ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/loop_network_tester.cpp:70: undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::putText(cv::_InputOutputArray const&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::NodeHandle::getParam(std::string const&, double&) const'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv_bridge::toCvCopy(sensor_msgs::Image_<std::allocator<void> > const&, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/libloop_cnn.so: undefined reference to `loadTRTEngine(std::string, Logger&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::NodeHandle::getParam(std::string const&, bool&) const'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv_bridge::toCvCopy(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::NodeHandle::getParam(std::string const&, std::string&) const'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::read(cv::FileNode const&, std::string&, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::FileStorage::open(std::string const&, int, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `camodocal::CameraFactory::generateCameraFromYamlFile(std::string const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/swarm_loop_net_tester.dir/build.make:293:/home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/swarm_loop/swarm_loop_net_tester] 错误 1
make[1]: *** [CMakeFiles/Makefile2:1288:CMakeFiles/swarm_loop_net_tester.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....
/usr/bin/ld: CMakeFiles/swarm_loop_spy.dir/src/swarm_loop_spy.cpp.o: in function `SwarmLoopSpy::SwarmLoopSpy(ros::NodeHandle&)::{lambda(LoopEdge_t const&)#2}::operator()(LoopEdge_t const&) const':
/home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_spy.cpp:40: undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/usr/bin/ld: CMakeFiles/swarm_loop_spy.dir/src/swarm_loop_spy.cpp.o: in function `bool ros::NodeHandle::param<std::string>(std::string const&, std::string&, std::string const&) const':
/opt/ros/noetic/include/ros/node_handle.h:2122: undefined reference to `ros::NodeHandle::hasParam(std::string const&) const'
/usr/bin/ld: /opt/ros/noetic/include/ros/node_handle.h:2124: undefined reference to `ros::NodeHandle::getParam(std::string const&, std::string&) const'
/usr/bin/ld: /opt/ros/noetic/include/ros/node_handle.h:2122: undefined reference to `ros::NodeHandle::hasParam(std::string const&) const'
/usr/bin/ld: /opt/ros/noetic/include/ros/node_handle.h:2124: undefined reference to `ros::NodeHandle::getParam(std::string const&, std::string&) const'
/usr/bin/ld: CMakeFiles/swarm_loop_spy.dir/src/swarm_loop_spy.cpp.o: in function `main':
/home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_spy.cpp:83: undefined reference to `ros::init(int&, char**, std::string const&, unsigned int)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_spy.cpp:84: undefined reference to `ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_spy.cpp:80: undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/usr/bin/ld: CMakeFiles/swarm_loop_spy.dir/src/swarm_loop_spy.cpp.o: in function `SwarmLoopSpy::timer_callback(ros::TimerEvent const&)':
/home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_spy.cpp:67: undefined reference to `cv::putText(cv::_InputOutputArray const&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_spy.cpp:70: undefined reference to `cv::putText(cv::_InputOutputArray const&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_spy.cpp:72: undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)'
/usr/bin/ld: CMakeFiles/swarm_loop_spy.dir/src/swarm_loop_spy.cpp.o: in function `SwarmLoopSpy::SwarmLoopSpy(ros::NodeHandle&)::{lambda(FisheyeFrameDescriptor_t const&)#1}::operator()(FisheyeFrameDescriptor_t const&) const':
/home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_spy.cpp:35: undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::NodeHandle::getParam(std::string const&, double&) const'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv_bridge::toCvCopy(sensor_msgs::Image_<std::allocator<void> > const&, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/libloop_cnn.so: undefined reference to `loadTRTEngine(std::string, Logger&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::NodeHandle::getParam(std::string const&, bool&) const'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv_bridge::toCvCopy(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::read(cv::FileNode const&, std::string&, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::NodeHandle::getParam(std::string const&, int&) const'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::FileStorage::open(std::string const&, int, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `camodocal::CameraFactory::generateCameraFromYamlFile(std::string const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/swarm_loop_spy.dir/build.make:286:/home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/swarm_loop/swarm_loop_spy] 错误 1
make[1]: *** [CMakeFiles/Makefile2:1545:CMakeFiles/swarm_loop_spy.dir/all] 错误 2
In file included from /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/include/swarm_loop/swarm_loop.h:5,
                 from /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_nodelet.cpp:1:
/home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/include/swarm_loop/loop_cam.h: In constructor ‘StereoFrame::StereoFrame(vins::FlattenImages, int)’:
/home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/include/swarm_loop/loop_cam.h:64:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<sensor_msgs::Image_<std::allocator<void> >, std::allocator<sensor_msgs::Image_<std::allocator<void> > > >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   64 |         for (int i = 1; i < vins_flatten.up_cams.size(); i++) {
      |                         ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/include/swarm_loop/swarm_loop.h:5,
                 from /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_node.cpp:1:
/home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/include/swarm_loop/loop_cam.h: In constructor ‘StereoFrame::StereoFrame(vins::FlattenImages, int)’:
/home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/include/swarm_loop/loop_cam.h:64:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::vector<sensor_msgs::Image_<std::allocator<void> >, std::allocator<sensor_msgs::Image_<std::allocator<void> > > >::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   64 |         for (int i = 1; i < vins_flatten.up_cams.size(); i++) {
      |                         ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: CMakeFiles/swarm_loop_node.dir/src/swarm_loop_node.cpp.o: in function `main':
/home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_node.cpp:16: undefined reference to `ros::init(int&, char**, std::string const&, unsigned int)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_node.cpp:17: undefined reference to `ros::NodeHandle::NodeHandle(std::string const&, std::map<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > > const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/src/Omni-swarm-pinhole_compatiable/Omni-swarm/swarm_loop/src/swarm_loop_node.cpp:18: undefined reference to `ros::console::set_logger_level(std::string const&, ros::console::levels::Level)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::putText(cv::_InputOutputArray const&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::console::initializeLogLocation(ros::console::LogLocation*, std::string const&, ros::console::levels::Level)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::NodeHandle::getParam(std::string const&, double&) const'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::NodeHandle::hasParam(std::string const&) const'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv_bridge::toCvCopy(sensor_msgs::Image_<std::allocator<void> > const&, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::error(int, std::string const&, char const*, char const*, int)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/libloop_cnn.so: undefined reference to `loadTRTEngine(std::string, Logger&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::imwrite(std::string const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::NodeHandle::getParam(std::string const&, bool&) const'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv_bridge::toCvCopy(boost::shared_ptr<sensor_msgs::Image_<std::allocator<void> > const> const&, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::NodeHandle::getParam(std::string const&, std::string&) const'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::read(cv::FileNode const&, std::string&, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `ros::NodeHandle::getParam(std::string const&, int&) const'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `cv::FileStorage::open(std::string const&, int, std::string const&)'
/usr/bin/ld: /home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/liblibswarm_loop.so: undefined reference to `camodocal::CameraFactory::generateCameraFromYamlFile(std::string const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/swarm_loop_node.dir/build.make:293:/home/d/Workspace/Omni-swarm_ws/devel/.private/swarm_loop/lib/swarm_loop/swarm_loop_node] 错误 1
make[1]: *** [CMakeFiles/Makefile2:652:CMakeFiles/swarm_loop_node.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2

CMakeLists检查修改都无法解决。初步判断为C++17和C++14的链接冲突问题(我的libtorch必须使用C++17编译),还有待继续研究。


2024年1月17日更新
的确为libtorch导致的C++17和C++14的链接冲突问题
更换为docker中的libtorch版本(1.7.0+cpu,并未使用gpu,且为C++14)后编译通过
请添加图片描述运行roslaunch

roslaunch swarm_loop nodelet-sfisheye.launch

请添加图片描述
存在问题:1.针孔相机roslaunch还有报错 2.后续运行数据,跑出结果 3.docker没有运行成功,容器中没有src源码

标签: 开源 机器人 算法

本文转载自: https://blog.csdn.net/Phycho_/article/details/131543724
版权归原作者 Phycho_ 所有, 如有侵权,请联系我们删除。

“【配置Omni-Swarm(omni swarm:开源的多机器人协同CSLAM算法)更新中】”的评论:

还没有评论