Ubuntu18.04 installs calibration_toolkit and performs joint calibration of cameras and three-dimensional lidar

Since I have not recorded in detail how to install calibration_toolkit before, I will record it in detail here.

Install opencv and nlopt before installing calibration_toolkit.

1. opencv installation

Do not install opencv4, opencv4 will cause many problems, here refer to this blog to install opencv3:

Ubuntu18.04 installs opencv3.4.3_Alex's blog with popcorn - CSDN blog 1. Go to the official website to download opencv3.4.3 download link http://opencv.org/releases.html, select the sources version 2. Unzip the downloaded zip package (The default is to download to the download folder, you need to copy it to the desktop, and then execute the following command) unzip opencv-3.4.3.zip3. Enter the decompressed file package, right-click and select Terminal to open (emphasis, otherwise will fail) 4. Enter sudo su //Enter... https://blog.csdn.net/qq_41080854/article/details/88609795 2. nlopt installation

GitHub - stevengj/nlopt: library for nonlinear optimization, wrapping many algorithms for global and local, constrained or unconstrained, optimization library 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, optimization https://github.com/stevengj/nlopt Go to this website to download the nlopt source code. It is not recommended to install the latest version. This article installs 2.6.0 (click on the right The releases have historical versions)

After downloading the source code and extracting it to the home directory, enter the following command to install:
 

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

3. Install calibration_toolkit

Download the ros installation package extracted by the boss:

https://github.com/XidianLemon/calibration_camera_lidar

And extract it to your own ros workspace

(If you don’t know how to create a ros workspace, you can refer to my blog: How to create a ros workspace, create a ros function package, and create a ros node under ubuntu_ubuntu creates a workspace_╰︶ ̄ Mo Dongxian۩۩۩’s blog-CSDN blog How to create a ros workspace, create a ros function package, and create a ros node under ubuntu https://blog.csdn.net/qq_49959714/article/details/127028396 )

Then compile:
 

catkin_make

You may encounter some problems when compiling here. You can check my blog first to see if there are any problems similar to yours:
Could not find a package configuration file provided by “pcl_conversions“ ...Problem Solved_╰︶ ̄ Mo Dianxian۩۩۩ Blog - CSDN Blog 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-con https://blog.csdn.net/qq_49959714/article/details/129097332?spm=1001.2014.3001.5501 Compilation errors that may be encountered when installing the calibration_toolkit calibration toolbox in ubuntu18.04_calibration tool installation_╰︶ ̄ Mo Dianxian۩۩۩’s blog-CSDN blogWhen Ubuntu18.04 installs the calibration_toolkit calibration toolbox, a compilation error is reported, 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/126266954 make[2]: *** [/home/nnnn/calibration /devel/lib/libcalibrationtoolkit.so] Error 1_╰︶ ̄ Mo Dianxian۩۩۩’s Blog-CSDN Blog 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[Untitled] error: 'CV_RGB' was not declared in this scope_╰︶ ̄ Mo Dianxian۩۩۩'s blog-CSDN blog received an error when installing and compiling the calibration_toolkit joint calibration toolbox: error: 'CV_RGB' was not declared in this scope https://blog.csdn.net/qq_49959714/article/details/126234827After successful compilation, execute the following naming operation:

roscore
source devel/setup.bash
rosrun calibration_camera_lidar calibration_toolkit

You may encounter some problems here:

Problem 1: The executable file calibration_camera_lidar cannot be found

[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

Solution: Modify the CMakeLists.txt file
to report that the executable file calibration_camera_lidar cannot be found. The reason is that my system is ubuntu18.04 and the ROS supported is melodic, so I need to modify the CMakeLists.txt under the calibration_camera_lidar function package and add support for the melodic version of ROS. As shown in the figure below, modify everything in CMakeLists.txt. (" ROSVERSION " MATCHES " ( indigo ∣ jade ∣ kinetic ) " ) changed to ("{ROS_VERSION}" MATCHES "(indigo|jade|kinetic|melodic)")

Then execute catkin_make to compile

Another question may arise at this time:
Question 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

Solution:
Modify the libnlopt.conf file

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

Add the following content to the libnlopt.conf file: /usr/local/lib

sudo ldconfig

 At this time, execute the following command to run the calibration_toolkit tool

rosrun calibration_camera_lidar calibration_toolkit

For camera and lidar calibration, you can refer to my blog:
Ubuntu18.04 uses calibration_toolkit for joint calibration of camera and three-dimensional lidar_╰︶ ̄ Mo Dongxian۩۩۩’s blog-CSDN blog super detailed calibration tutorial, used in ubuntu18.04 calibration_toolkit performs joint calibration of cameras and three-dimensional lidar, uses autoware to perform camera internal parameter calibration, and uses tutorials on how to view the effects of calibration. https://blog.csdn.net/qq_49959714/article/details/126281312

Guess you like

Origin blog.csdn.net/qq_49959714/article/details/129144320
Recommended