kalibr相机校正工具安装
1、 环境准备
Ubuntu18.04
ROS-melodic
Python3.7
2、Kalibr安装
本文只针对Kalibr源码编译,详情请看官方文档
2.1 ros系统安装
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
export ROS1_DISTRO = melodic
sudo apt-get install ros-melodic-desktop-full
sudo apt-get install python-catkin-tools
2.2 依赖项安装
sudo apt-get install -y \
git wget autoconf automake nano \
libeigen3-dev libboost-all-dev libsuitesparse-dev \
doxygen libopencv-dev \
libpoco-dev libtbb-dev libblas-dev liblapack-dev libv4l-dev
针对不同的python版本环境进行安装
# Ubuntu 18.04
sudo apt-get install -y python3-dev python-pip python-scipy \
python-matplotlib ipython python-wxgtk4.0 python-tk python-igraph python-pyx
2.3 创建一个工作空间
mkdir -p ~/kalibr_ws/src
cd ~/kalibr_ws
export ROS1_DISTRO = melodic
source /opt/ros/melodic/setup.bash
catkin init
catkin config --extend /opt/ros/$ROS1_DISTRO
catkin config --merge-devel # Necessary for catkin_tools >= 0.4.
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
2.4 添加KAlibr项目
此处直接下载代码也可以,或者使用git clone方法,如下所示:
cd ~/kalibr_ws/src
git clone https://github.com/ethz-asl/kalibr.git
2.5 编译Kalibr
cd ~/kalibr_ws/
catkin build -DCMAKE_BUILD_TYPE=Release -j4
2.6 刷新工作空间
source ~/kalibr_ws/devel/setup.bash
2.7 验证
在bulid后可能因为某些原因导致报错 == kalibr_calibrate_imu_camera: command not found==
查找相关包位置后
find . -name "kalibr_calibrate_imu_camera"
应该实行以下命令进行使用
./build/kalibr/catkin_generated/installspace/kalibr_calibrate_imu_camera --target april_6x6.yaml --cam camchain.yaml --imu imu_adis16448.yaml --bag dynamic.bag --bag-from-to 5 45
3、编译踩坑解决
3.1 头文件缺失
报错:error: '_1' was not declared in this scope
在对应cmake文件中添加
using namespace std;
using namespace placeholders;