由于之前没有详细记录一下如何安装calibration_toolkit,这里详细记录一下
在安装calibration_toolkit之前先安装opencv、nlopt.
1、opencv安装
不要安装opencv4,opencv4会出现很多问题,这里参考这篇博客安装opencv3:
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 c
https://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/libcalibr
https://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 scope
https://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