【使用autoware中的标定工具包进行相机和激光雷达联合标定】

本文主要是介绍【使用autoware中的标定工具包进行相机和激光雷达联合标定】,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

使用autoware中的标定工具包进行相机和激光雷达联合标定

  • 一、工具安装
    • 1.catkin_make(Could not find the required component 'jsk_recognition_msgs'. )
    • 2. catkin_make(undefined reference to `cv::Mat::Mat()')
    • 3. rosrun calibration_camera_lidar(Couldn't find executable named calibration_toolkit below /home/chen/桌面/Project/CL_calibration_ws/src/calibration_camera_lidar/ls_calibration/calibration_camera_lidar)
    • 4、重新编译(没有那个文件或目录)
    • 5、重新编译,出现大片错误(PCL)
    • 6、重新编译(Opencv版本问题)
    • 7、重新编译(camera_lidar2d_offline_calib余下问题)
    • 8、安装opencv3
    • 9、重新编译(error: ‘CV_RGB’ was not declared in this scope; did you mean ‘CV_YUV2RGB’?)
    • 10、重新编译(undefined reference to `std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13'
  • 二、录制包
    • 1、流程
    • 2、注意事项
  • 三、回放、标定
    • 1、回放点云数据
    • 2、标定
      • (1)准备工作
      • (2)标定
  • 四、查看融合结果
    • 1、安装autoware
    • 2、查看融合结果

链接: 如何使用Autoware标定工具包进行相机和激光雷达的联合标定(无需完整安装Autoware)

一、工具安装

1.catkin_make(Could not find the required component ‘jsk_recognition_msgs’. )

-- Could NOT find jsk_recognition_msgs (missing: jsk_recognition_msgs_DIR)
-- Could not find the required component 'jsk_recognition_msgs'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):Could not find a package configuration file provided by"jsk_recognition_msgs" with any of the following names:jsk_recognition_msgsConfig.cmakejsk_recognition_msgs-config.cmakeAdd the installation prefix of "jsk_recognition_msgs" to CMAKE_PREFIX_PATHor set "jsk_recognition_msgs_DIR" to a directory containing one of theabove files.  If "jsk_recognition_msgs" provides a separate developmentpackage or SDK, be sure it has been installed.

解决办法,安装jsk_recognition_msgs

sudo apt-get install ros-noetic-jsk-recognition-msgs

2. catkin_make(undefined reference to `cv::Mat::Mat()')

/usr/bin/ld: CMakeFiles/calibration_publisher.dir/nodes/calibration_publisher/calibration_publisher.cpp.o: in function `void cv::operator>><cv::Mat>(cv::FileNode const&, cv::Mat&)':
/usr/local/opencv4/include/opencv4/opencv2/core/persistence.hpp:1281: undefined reference to `cv::Mat::Mat()'
/usr/bin/ld: CMakeFiles/calibration_publisher.dir/nodes/calibration_publisher/calibration_publisher.cpp.o: in function `_GLOBAL__sub_I_calibration_publisher.cpp':
/home/chen/桌面/Project/CL_calibration_ws/src/calibration_camera_lidar/ls_calibration/calibration_camera_lidar/nodes/calibration_publisher/calibration_publisher.cpp:10: undefined reference to `cv::Mat::Mat()'
/usr/bin/ld: CMakeFiles/calibration_publisher.dir/nodes/calibration_publisher/calibration_publisher.cpp.o: in function `__static_initialization_and_destruction_0':
/home/chen/桌面/Project/CL_calibration_ws/src/calibration_camera_lidar/ls_calibration/calibration_camera_lidar/nodes/calibration_publisher/calibration_publisher.cpp:11: undefined reference to `cv::Mat::Mat()'
/usr/bin/ld: /home/chen/桌面/Project/CL_calibration_ws/src/calibration_camera_lidar/ls_calibration/calibration_camera_lidar/nodes/calibration_publisher/calibration_publisher.cpp:12: undefined reference to `cv::Mat::Mat()'
collect2: error: ld returned 1 exit status
make[2]: *** [calibration_camera_lidar/ls_calibration/calibration_camera_lidar/CMakeFiles/calibration_publisher.dir/build.make:296:/home/chen/桌面/Project/CL_calibration_ws/devel/lib/calibration_camera_lidar/calibration_publisher] 错误 1
make[1]: *** [CMakeFiles/Makefile2:5174:calibration_camera_lidar/ls_calibration/calibration_camera_lidar/CMakeFiles/calibration_publisher.dir/all] 错误 2
make: *** [Makefile:161:all] 错误 2
Invoking "make -j16 -l16" failed

解决办法,ubuntu18.04安装calibration_toolkit标定工具箱可能遇到的编译错误

在 target_link_libraries(calibration_publisher	${catkin_LIBRARIES} 后面添加
${OpenCV_LIBS} #added 
# 注意opencv大小写

编译成功

3. rosrun calibration_camera_lidar(Couldn’t find executable named calibration_toolkit below /home/chen/桌面/Project/CL_calibration_ws/src/calibration_camera_lidar/ls_calibration/calibration_camera_lidar)

[rosrun] Couldn't find executable named calibration_toolkit below /home/chen/桌面/Project/CL_calibration_ws/src/calibration_camera_lidar/ls_calibration/calibration_camera_lidar
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun]   /home/chen/桌面/Project/CL_calibration_ws/src/calibration_camera_lidar/ls_calibration/calibration_camera_lidar/nodes/calibration_toolkit

参考链接:https://github.com/XidianLemon/calibration_camera_lidar/issues/7

4、重新编译(没有那个文件或目录)

参考:https://blog.csdn.net/yuteng12138/article/details/105204292

1、fatal error: opencv/cv.h: 没有那个文件或目录
将各文件中的 #include <opencv/cv.h>
替换为
#include <opencv2/imgproc.hpp>2、fatal error: opencv/highgui.h: 没有那个文件或目录
将 #include <opencv/highgui.h>
替换成
#include "opencv2/highgui.hpp"3、fatal error: opencv/cxcore.h: 没有那个文件或目录
将#include <opencv/cxcore.h>
替换成
#include <opencv2/core/core.hpp>
//在 OpenCV 4 中,cxcore.h 文件已被移除,可以使用opencv2/core.hpp或opencv2/core/types.hpp替代

5、重新编译,出现大片错误(PCL)

/usr/include/pcl-1.10/pcl/point_representation.h:308:7:   required from here
/usr/include/pcl-1.10/pcl/point_representation.h:252:48: error: the value of ‘NrDims’ is not usable in a constant expression
/usr/include/pcl-1.10/pcl/point_representation.h:251:19: note: ‘NrDims’ was not initialized with a constant expression251 |         const int NrDims = pcl::traits::datatype<PointDefault, Key>::size;|                   ^~~~~~
/usr/include/pcl-1.10/pcl/point_representation.h:252:48: note: in template argument for type ‘int’252 |         Helper<Key, FieldT, NrDims>::copyPoint (p1_, p2_, f_idx_);|         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~

参考:https://github.com/XidianLemon/calibration_camera_lidar/issues/28

# 原因分析
pcl1.10需要用更高级别的C++编译
# 解决过程
dpkg -l libpcl-dev    #查看pcl版本
在cmakelist.txt文件中添加
set(CMAKE_CXX_STANDARD 14)
# 具体文件:
CL_calibration_ws/src/calibration_camera_lidar/ls_calibration/calibration_camera_lidar
CL_calibration_ws/src/calibration_camera_lidar/ls_calibration/glviewer
CL_calibration_ws/src/calibration_camera_lidar/ls_calibration/rosinterface

6、重新编译(Opencv版本问题)

参考:
https://blog.csdn.net/Toky_min/article/details/107107708
https://blog.csdn.net/weixin_44235615/article/details/125803414
https://blog.csdn.net/libaineu2004/article/details/104454933

问题

‘IplImage’ was not declared in this scope
//在OpenCV 4及更高版本中,IplImage结构已被弃用,取而代之的是cv::Mat类作为主映像容器。
‘CvMat’ does not name a type
//在OpenCV 4及更高版本中,CvMat结构已被更通用的cv::Mat类取代
。。。

解决办法,在报错文件中添加

#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/imgproc/types_c.h>
#include <opencv2/imgproc/imgproc_c.h>
#include <opencv2/highgui/highgui_c.h>

7、重新编译(camera_lidar2d_offline_calib余下问题)

1. error: conversion from ‘cv::Mat’ to non-scalar type ‘IplImage’ {aka ‘_IplImage’} requested
//https://blog.csdn.net/weixin_44694952/article/details/109221487
//camera_lidar2d_offline_calib.cpp:132行
IplImage temp = cv_image->image;————》IplImage temp = cvIplImage(cv_image->image);2.error: ‘cvFindExtrinsicCameraParams2’ was not declared in this scope3. error: ‘cvRodrigues2’ was not declared in this scope
//In OpenCV 4 and later versions, the function cvRodrigues2 has been replaced with the cv::Rodrigues function for computing the Rodrigues rotation matrix.
//camera_lidar2d_offline_calib.cpp:161行
cvRodrigues2(v_rotation, m_rotation);————》cv::Rodrigues(v_rotation, m_rotation)4. error: could not convert ‘cv::Scalar_<double>((double)0, (double)0, (double)255, (double)0)from ‘cv::Scalar’ {aka ‘cv::Scalar_<double>} to ‘CvScalar’

需要修改的问题过多,重新安装opencv3

8、安装opencv3

链接: ubuntu20.04下多版本opencv共存和切换

安装完成后重新下载项目,将修改过的cmakelist文件复制过来
指定cmake时opencv版本,仍然报错

安装对应的cv_bridge

https://zhuanlan.zhihu.com/p/617289094sudo make installed 报错 error: option --install-layout not recognized
参考:https://blog.csdn.net/qq_17130909/article/details/97933582cmake ..  -DCMAKE_BUILD_TYPE=Release -DSETUPTOOLS_DEB_LAYOUT=OFF .
make
sudo make installed在工程cmakelist文件中添加
set(cv_bridge_DIR "/home/chen/下载/opencv3.4.5/vision_opencv-melodic/installed/usr/local/share/cv_bridge/cmake")
Set(OpenCV_DIR "/home/chen/下载/opencv3.4.5/opencv-3.4.5/installed/share/OpenCV") 
Set(OpenCV_INCLUDE_DIRS "/home/chen/下载/opencv3.4.5/opencv-3.4.5/installed/include")
Set(OpenCV_LIBRARIES "/home/chen/下载/opencv3.4.5/opencv-3.4.5/installed")

9、重新编译(error: ‘CV_RGB’ was not declared in this scope; did you mean ‘CV_YUV2RGB’?)

对应.h文件添加头文件:#include <opencv2/imgproc.hpp>

10、重新编译(undefined reference to `std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13’

/usr/bin/ld: /home/chen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13'
/usr/bin/ld: /home/chen/anaconda3/lib/libQt5Widgets.so.5.15.2: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
/usr/bin/ld: /home/chen/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `std::__exception_ptr::exception_ptr::_M_addref()@CXXABI_1.3.13'
collect2: error: ld returned 1 exit status
make[2]: *** [calibration_camera_lidar/ls_calibration/calibration_camera_lidar/CMakeFiles/calibration_toolkit.dir/build.make:451:/home/chen/桌面/Project/CL_calibration_ws/devel/lib/calibration_camera_lidar/calibration_toolkit] 错误 1
make[1]: *** [CMakeFiles/Makefile2:4362:calibration_camera_lidar/ls_calibration/calibration_camera_lidar/CMakeFiles/calibration_toolkit.dir/all] 错误 2
make: *** [Makefile:161:all] 错误 2

原因:anaconda中的qt5与系统中安装的qt5冲突。查找了很多办法,无法完全解决。
一个一次性办法:

在涉及到QT的CMakeLists文件中,在find QT包前添加
SET(CMAKE_PREFIX_PATH "/usr/lib/x86_64-linux-gnu/cmake")

重新编译,终于完成

二、录制包

1、流程

1.运行对应节点文件
roscore
//激光雷达
roslaunch innovusion_pointcloud innovusion_points.launch device_ip:=192.168.0.10 port:=8010 processed:=1
//相机
cd ~/桌面/Project/rtsp_ws
roslaunch rocon_rtsp_camera_relay rtsp_camera_relay.launch --screen2.录制包
在存放录制数据的文件夹下
rosbag record -O 自己命令.bag /rtsp_camera_relay/image/compressed  /iv_points

2、注意事项

  1. 标定板位置要求参考前文链接
  2. 录制时最好录制压缩后的图像数据
  • 开始使用 rosbag record -a 图像卡顿、花屏
  • 指定图像和点云节点 rosbag record -O 001.bag /rtsp_camera_relay/image /iv_points
    • 警告:rosbag record buffer exceeded. Dropping oldest queued message
  • 参考https://blog.csdn.net/lemonxiaoxiao/article/details/113357811,解决

三、回放、标定

1、回放点云数据

rosrun image_transport republish compressed in:=/rtsp_camera_relay/image raw out:=/rtsp_camera_relay/image
// 从压缩后的图像数据还原原始数据
rosbag play data.bag  /iv_points:=/points_raw --pause -l  //暂停播放留时间打开软件

2、标定

(1)准备工作

打开工具包

rosrun calibration_camera_lidar calibration_toolkit 

报错

[ERROR] [1684421099.331560215]: Client [/calibration_toolkit] wants topic /rtsp_camera_relay/image/compressed to have datatype/md5sum [sensor_msgs/Image/060021388200f6f0f447d0fcd9c64743], but our version has [sensor_msgs/CompressedImage/8f7a12909da2c9d3332d540a0977563f]. Dropping connection.

猜测原因:
工具需要接收image类型的数据,但是由于图像数据太大,之前录制的时候选择的是CompressedImage
参考链接解决:https://blog.csdn.net/lemonxiaoxiao/article/details/119637749

将下图四个参数改为自己标定板的数据,关闭软件保存配置
在这里插入图片描述

(2)标定

按照https://blog.csdn.net/zbr794866300/article/details/107144682进行
最终保存的文件
借鉴大佬结果:https://blog.csdn.net/nuo112/article/details/116404760

四、查看融合结果

1、安装autoware

基本参考:https://blog.csdn.net/qq_21692851/article/details/128909367

2、查看融合结果

  1. 将数据文件夹挂载在容器内
    将run.sh最后一段修改为下图所示
#docker run \
#    -it --rm \
docker run \-it -v /home/chen/桌面/Project:/home/autoware/data \$VOLUMES \--env="XAUTHORITY=${XAUTH}" \--env="DISPLAY=${DISPLAY}" \--env="USER_ID=$USER_ID" \--privileged \--net=host \$RUNTIME \$IMAGE
  1. 进入容器
// 1. 进入容器,并启动程序
cd autoware_ai_docker/generic
./run.sh
cd ~/Autoware
roslaunch runtime_manager runtime_manager.launch// 2.播放数据包
sudo docker ps -a  //查看容器id
sudo docker exec -it 005d30c2f918 /bin/bash  //在新终端进入容器
cd ~
source /opt/ros/melodic/setup.bash  //加载ROS
rosrun image_transport republish compressed in:=/rtsp_camera_relay/image raw out:=/rtsp_camera_relay/image  //将压缩节点转为原始节点//在另一终端进入容器,并播放数据包
cd /home/autoware/data/Result/data
rosbag play data.bag  /iv_points:=/points_raw --pause -l
  1. 可视化操作

參考如下链接进行:
https://blog.csdn.net/weixin_43687753/article/details/127227686
https://blog.csdn.net/nuo112/article/details/116404760

注意将image话题来源替换成自己录制的包中的图像话题,比如我的就是/rtsp_camera_relay/image。
在这里插入图片描述

这篇关于【使用autoware中的标定工具包进行相机和激光雷达联合标定】的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/725299

相关文章

中文分词jieba库的使用与实景应用(一)

知识星球:https://articles.zsxq.com/id_fxvgc803qmr2.html 目录 一.定义: 精确模式(默认模式): 全模式: 搜索引擎模式: paddle 模式(基于深度学习的分词模式): 二 自定义词典 三.文本解析   调整词出现的频率 四. 关键词提取 A. 基于TF-IDF算法的关键词提取 B. 基于TextRank算法的关键词提取

使用SecondaryNameNode恢复NameNode的数据

1)需求: NameNode进程挂了并且存储的数据也丢失了,如何恢复NameNode 此种方式恢复的数据可能存在小部分数据的丢失。 2)故障模拟 (1)kill -9 NameNode进程 [lytfly@hadoop102 current]$ kill -9 19886 (2)删除NameNode存储的数据(/opt/module/hadoop-3.1.4/data/tmp/dfs/na

Hadoop数据压缩使用介绍

一、压缩原则 (1)运算密集型的Job,少用压缩 (2)IO密集型的Job,多用压缩 二、压缩算法比较 三、压缩位置选择 四、压缩参数配置 1)为了支持多种压缩/解压缩算法,Hadoop引入了编码/解码器 2)要在Hadoop中启用压缩,可以配置如下参数

Makefile简明使用教程

文章目录 规则makefile文件的基本语法:加在命令前的特殊符号:.PHONY伪目标: Makefilev1 直观写法v2 加上中间过程v3 伪目标v4 变量 make 选项-f-n-C Make 是一种流行的构建工具,常用于将源代码转换成可执行文件或者其他形式的输出文件(如库文件、文档等)。Make 可以自动化地执行编译、链接等一系列操作。 规则 makefile文件

使用opencv优化图片(画面变清晰)

文章目录 需求影响照片清晰度的因素 实现降噪测试代码 锐化空间锐化Unsharp Masking频率域锐化对比测试 对比度增强常用算法对比测试 需求 对图像进行优化,使其看起来更清晰,同时保持尺寸不变,通常涉及到图像处理技术如锐化、降噪、对比度增强等 影响照片清晰度的因素 影响照片清晰度的因素有很多,主要可以从以下几个方面来分析 1. 拍摄设备 相机传感器:相机传

【Prometheus】PromQL向量匹配实现不同标签的向量数据进行运算

✨✨ 欢迎大家来到景天科技苑✨✨ 🎈🎈 养成好习惯,先赞后看哦~🎈🎈 🏆 作者简介:景天科技苑 🏆《头衔》:大厂架构师,华为云开发者社区专家博主,阿里云开发者社区专家博主,CSDN全栈领域优质创作者,掘金优秀博主,51CTO博客专家等。 🏆《博客》:Python全栈,前后端开发,小程序开发,人工智能,js逆向,App逆向,网络系统安全,数据分析,Django,fastapi

pdfmake生成pdf的使用

实际项目中有时会有根据填写的表单数据或者其他格式的数据,将数据自动填充到pdf文件中根据固定模板生成pdf文件的需求 文章目录 利用pdfmake生成pdf文件1.下载安装pdfmake第三方包2.封装生成pdf文件的共用配置3.生成pdf文件的文件模板内容4.调用方法生成pdf 利用pdfmake生成pdf文件 1.下载安装pdfmake第三方包 npm i pdfma

零基础学习Redis(10) -- zset类型命令使用

zset是有序集合,内部除了存储元素外,还会存储一个score,存储在zset中的元素会按照score的大小升序排列,不同元素的score可以重复,score相同的元素会按照元素的字典序排列。 1. zset常用命令 1.1 zadd  zadd key [NX | XX] [GT | LT]   [CH] [INCR] score member [score member ...]

业务中14个需要进行A/B测试的时刻[信息图]

在本指南中,我们将全面了解有关 A/B测试 的所有内容。 我们将介绍不同类型的A/B测试,如何有效地规划和启动测试,如何评估测试是否成功,您应该关注哪些指标,多年来我们发现的常见错误等等。 什么是A/B测试? A/B测试(有时称为“分割测试”)是一种实验类型,其中您创建两种或多种内容变体——如登录页面、电子邮件或广告——并将它们显示给不同的受众群体,以查看哪一种效果最好。 本质上,A/B测

git使用的说明总结

Git使用说明 下载安装(下载地址) macOS: Git - Downloading macOS Windows: Git - Downloading Windows Linux/Unix: Git (git-scm.com) 创建新仓库 本地创建新仓库:创建新文件夹,进入文件夹目录,执行指令 git init ,用以创建新的git 克隆仓库 执行指令用以创建一个本地仓库的