kalibr installation and compilation under Ubuntu 18.04 + ROS melody

kalibr installation and compilation under Ubuntu 18.04 + ROS melody

Attention & emphasis: any course must be browsed first, and there is a general idea in mind. Follow the process step by step, and you can have an early warning before falling into the pit

Recommended tutorials: Joint calibration of Xiaomi binocular and IMU Because some of the commands in the kalibr installation steps in have problems in typesetting and cannot be used directly, they are slightly modified. The installation commands are as follows:

(1) Install dependencies

$ sudo apt-get install python-setuptools python-rosinstall ipython libeigen3-dev libboost-all-dev doxygen libopencv-dev
$ sudo apt-get install ros-melodic-vision-opencv ros-melodic-image-transport-plugins ros-melodic-cmake-modules 
$ sudo apt-get install python-software-properties software-properties-common libpoco-dev python-matplotlib python-scipy python-git python-pip ipython 
$ sudo apt-get install libtbb-dev libblas-dev liblapack-dev python-catkin-tools libv4l-dev

$ sudo pip install python-igraph --upgrade

Where $sudo PIP install Python iGraph -- upgrade is very important. If it is not installed and compiled, an error will be reported (or an error will be reported if pip is not installed)

(2) Create workspace

$ mkdir -p ~/kalibr_workspace/src
$ cd ~/kalibr_workspace
$ source /opt/ros/kinetic/setup.bash
$ catkin init
$ catkin config --extend /opt/ros/kinetic
$ catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release

(3) Download and compile

$ cd ~/kalibr_workspace/src
$ git clone https://github.com/ethz-asl/Kalibr.git
 
$ cd ~/kalibr_workspace
$ catkin build -DCMAKE_BUILD_TYPE=Release -j12

When compiling, make sure to use the above command catkin build instead of catkin_make compilation, because catkin_make can be regarded as an integrated compilation of catkin buid-j12-l12, which will be compiled by multiple threads at the same time, with warnings like * * warning: -jN forced in submake: disabling jobserver mode. *. Because some make is a recursive call of make, in this case, the called make process cannot communicate with other make processes, so it can only handle these tasks in parallel.

(4) Setting up the environment

source ~/kalibr_workspace/devel/setup.bash

Installation succeeded.

Here are the possible problems:

1,catkin_ Download suitesparse too long or even fail during make

(1)catkin_ Download suitesparse too long or even fail during make

(2)Compilation of camera IMU calibration tool Kalibr

What I learned: the second link is the main link. It's best to choose suitesparse-4.2.1 when downloading. Although the version is very old, it helps to compile smoothly. After all, the most important thing is to install kalibr successfully. It is suggested that the thread should be expanded to j8 and the SuiteSparse should be downloaded to the local area in advance.

 DOWNLOAD_COMMAND rm -f SuiteSparse-${VERSION}.tar.gz #&& wget http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-${VERSION}.tar.gz
  PATCH_COMMAND tar -xzf /home/chm/Downloads/suitesparse-${VERSION}.tar.gz && rm -rf ../suitesparse_src-build/SuiteSparse && sed -i.bu "s/\\/usr\\/local\\/lib/..\\/lib/g" suitesparse-4.2.1/SuiteSparse_config/SuiteSparse_config.mk && sed -i.bu "s/\\/usr\\/local\\/include/..\\/include/g" suitesparse-4.2.1/SuiteSparse_config/SuiteSparse_config.mk && mv suitesparse-4.2.1 ../suitesparse_src-build/
  CONFIGURE_COMMAND ""
  BUILD_COMMAND cd suitesparse-4.2.1 && make library -j8 -l8
  INSTALL_COMMAND cd suitesparse-4.2.1 && mkdir -p lib 

2. ReadTimeoutError: HTTPSConnectionPool during installation and compilation

Solution to ReadTimeoutError: HTTPSConnectionPool in python using pip installation module

In general, the ReadTimeoutError of pip is given to the wall by GFW, which can be solved by selecting the domestic image.

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple module_name

This may be because of the problems in the process of their own tossing environment before. By the way, the problems in the groping tutorial are also attached at the back

dpkg: warning: files list file for package `** ** **'

When installing kalibr dependency (after trying many tutorials, the dependency of installation is not very consistent), there is one sentence

$sudo apt-get install --reinstall python-numpy

Dpkg: warning: files list file for

dpkg: warning: files list file for package

It's very meaningful that the following blogger's reply is very detailed and tells how to run this script. Again, it is summarized as follows:

(1) First edit the code content of the script in Text Editor, and then save the file as file_name.sh (file_name is the name of the file you started) under the home folder (other locations are also available)

The above content is equivalent to: create a new. sh script file with any name, and then copy the found script code into it

(2) Open the terminal in the folder where the. Sh file is saved, and enter sudo chmod 777 file_name.sh , make the script executable

The above is equivalent to giving execution permission on the command line, such as sudo chmod 777 file_name.sh

(3) Then input sudo. / file in the terminal_ name.sh , start running the script, and wait for the execution to finish.

The above is equivalent to executing the SH file under the command line, for example:. / file_name.sh

Tags: Python sudo pip git

Posted on Sat, 13 Jun 2020 00:35:06 -0400 by WhiteCube