ubuntu18.04安装calibration_toolkit,并进行相机和三维激光雷达的联合标定

由于之前没有详细记录一下如何安装calibration_toolkit,这里详细记录一下

在安装calibration_toolkit之前先安装opencv、nlopt.

1、opencv安装

不要安装opencv4,opencv4会出现很多问题,这里参考这篇博客安装opencv3:

Ubuntu18.04安装opencv3.4.3_Alex抱着爆米花的博客-CSDN博客1.去官网下载opencv3.4.3下载链接 http://opencv.org/releases.html ,选择sources版本2.解压下载下来的zip包(默认是下载到下载这文件夹的需要把它复制到桌面,再来执行下面的命令)unzip opencv-3.4.3.zip3.进入到解压后的文件包中,右键选择终端打开(划重点,否则会失败)4.输入sudo su //进入...https://blog.csdn.net/qq_41080854/article/details/886097952、nlopt安装

GitHub - stevengj/nlopt: library for nonlinear optimization, wrapping many algorithms for global and local, constrained or unconstrained, optimizationlibrary for nonlinear optimization, wrapping many algorithms for global and local, constrained or unconstrained, optimization - GitHub - stevengj/nlopt: library for nonlinear optimization, wrapping many algorithms for global and local, constrained or unconstrained, optimizationhttps://github.com/stevengj/nlopt去这个网址上下载nlopt源码,不建议安装最新版,本文安装2.6.0(点击右边的releases有历史版本)

下载源码并解压到home目录后,输入以下命令安装:
 

cd nlopt-2.6.0
mkdir build
cd build
cmake ..
make
sudo make install

3、安装calibration_toolkit

下载大佬提取出来的ros安装包:

https://github.com/XidianLemon/calibration_camera_lidar

并解压到自己的ros工作空间中

(不知道如何创建ros工作空间可以参考一下我的博客:ubuntu下如何创建ros工作空间、创建ros功能包、创建ros节点_ubuntu创建工作空间_╰︶ ̄ 莫等闲۩۩۩的博客-CSDN博客ubuntu下如何创建ros工作空间、创建ros功能包、创建ros节点https://blog.csdn.net/qq_49959714/article/details/127028396)

然后编译:
 

catkin_make

这里编译可能会遇到一些问题,可以先看一下我的博客有没有跟你类似的问题:
Could not find a package configuration file provided by “pcl_conversions“ ...问题解决_╰︶ ̄ 莫等闲۩۩۩的博客-CSDN博客CMake Error at /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "pcl_conversions" with any of the following names: pcl_conversionsConfig.cmake pcl_conversions-conhttps://blog.csdn.net/qq_49959714/article/details/129097332?spm=1001.2014.3001.5501ubuntu18.04安装calibration_toolkit标定工具箱可能遇到的编译错误_calibration tool安装_╰︶ ̄ 莫等闲۩۩۩的博客-CSDN博客Ubuntu18.04安装calibration_toolkit标定工具箱时,编译报错,CMakeFiles/calibration_publisher.dir/nodes/calibration_publisher/calibration_publisher.cpp.o: In function `main':/usr/local/include/opencv2/core/cvstd.inl.hpp:150: undefined reference to `cv::read(cv::FileNode chttps://blog.csdn.net/qq_49959714/article/details/126266954make[2]: *** [/home/nnnn/calibration/devel/lib/libcalibrationtoolkit.so] Error 1_╰︶ ̄ 莫等闲۩۩۩的博客-CSDN博客calibration_camera_lidar/ls_calibration/calibration_camera_lidar/CMakeFiles/calibrationtoolkit.dir/build.make:396: recipe for target '/home/nnnn/calibration/devel/lib/libcalibrationtoolkit.so' failedmake[2]: *** [/home/nnnn/calibration/devel/lib/libcalibrhttps://blog.csdn.net/qq_49959714/article/details/126256367【无标题】error:‘CV_RGB’ was not declared in this scope_╰︶ ̄ 莫等闲۩۩۩的博客-CSDN博客在安装编译calibration_toolkit联合标定工具箱时报错:error:'CV_RGB’ was not declared in this scopehttps://blog.csdn.net/qq_49959714/article/details/126234827编译成功后,执行以下命名运行:

roscore
source devel/setup.bash
rosrun calibration_camera_lidar calibration_toolkit

这里可能会遇到一些问题:

问题1:找不到可执行文件 calibration_camera_lidar的问题

[rosrun] Couldn't find executable named calibration_toolkit below /home/robosense/catkin_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/robosense/catkin_ws/src/calibration_camera_lidar/ls_calibration/calibration_camera_lidar/nodes/calibration_toolkit

解决办法:修改CMakeLists.txt文件
报找不到可执行文件 calibration_camera_lidar的问题。原因是因为我的系统是ubuntu18.04对应支持的ROS是melodic,因此需要对calibration_camera_lidar功能包下的CMakeLists.txt进行修改,添加ROS的melodic版本的支持,如下图所示,修改CMakeLists.txt中所有 (" R O S V E R S I O N " M A T C H E S " ( i n d i g o ∣ j a d e ∣ k i n e t i c ) " )改为("{ROS_VERSION}" MATCHES “(indigo|jade|kinetic|melodic)”)

然后再执行catkin_make编译

这时可能还会出现另一个问题:
问题2:

/home/robosense/catkin_ws/devel/lib/calibration_camera_lidar/calibration_toolkit: error while loading shared libraries: libnlopt.so.0: cannot open shared object file: No such file or directory

解决办法:
修改libnlopt.conf文件

cd /etc/ld.so.conf.d
sudo touch libnlopt.conf
sudo gedit libnlopt.conf 

在libnlopt.conf文件中添加内容为:/usr/local/lib

sudo ldconfig

 此时执行以下命令就可以运行calibration_toolkit工具了

rosrun calibration_camera_lidar calibration_toolkit

相机和激光雷达标定可以参考我这篇博客:
ubuntu18.04使用calibration_toolkit进行相机和三维激光雷达的联合标定_╰︶ ̄ 莫等闲۩۩۩的博客-CSDN博客超详细的标定教程,ubuntu18.04使用calibration_toolkit进行相机和三维激光雷达的联合标定,以及使用autoware进行相机内参标定,以及使用如何查看标定后效果教程。https://blog.csdn.net/qq_49959714/article/details/126281312

猜你喜欢

转载自blog.csdn.net/qq_49959714/article/details/129144320
今日推荐