Xavier ubuntu18.04 相机+imu标定算法的编译

6 篇文章 0 订阅
5 篇文章 0 订阅

Kalibr

用于标定相机的内外参数,相机与IMU之间的外参

安装依赖

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

sudo pip install python-igraph --upgrade

坑1

安装python-igraph失败

该包需要python3.7版本,xavier自带python版本2.7及3.6.9均不适用

方法1:

  • 安装anaconda,利用anaconda创建python3.7.0的环境

    conda create -n py37 python=3.7.0
    
  • 进入该虚拟环境

    conda activate py37
    
  • 按照anaconda官方的教程,安装python-igraph包

    Python Igraph :: Anaconda.org

    随便选取下面一条命令即可:

    conda install -c conda-forge python-igraph
    conda install -c conda-forge/label/gcc7 python-igraph
    conda install -c conda-forge/label/cf201901 python-igraph
    conda install -c conda-forge/label/cf202003 python-igraph
    

法2:
在python 2.7版本下安装该包python-igraph

sudo add-apt-repository ppa:igraph/ppa     # Add the Launchpad repository to apt

sudo apt-get update                        # update your package database

sudo apt-get install python-igraph

完成之后,查看目录/usr/lib/python2.7/dist-packages/就可以看到python-igraph安装成功

创建工作区间

mkdir -p kalibr_ws/src
cd kalibr_ws
source /opt/ros/melodic/setup.bash
catkin init
catkin config --extend /opt/ros/melodic
catkin config --merge-devel 
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release

克隆源文件至kalibr_ws的src目录下

cd src/
git clone https://github.com/ethz-asl/Kalibr.git

编译工具源码

cd kalibr_ws
catkin build -DCMAKE_BUILD_TYPE=Release -j8

坑2

  • catkin编译时kalibr下载suitsparse报错

    这个是在catkin编译的过程中使用wget从网上下载suitesparse时,产生的错误。

    可以通过修改CMakeLists.txt来解决:

    sudo gedit ~/kalibr_ws/src/kalibr/suitesparse/CMakeLists.txt
    

    将其中的

    DOWNLOAD_COMMAND rm -f SuiteSparse-${VERSION}.tar.gz && wget http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-${VERSION}.tar.gz
    

    改为:

    DOWNLOAD_COMMAND rm -f SuiteSparse-${VERSION}.tar.gz && wget https://mirror.sobukus.de/files/src/suitesparse/SuiteSparse-${VERSION}.tar.gz
    

    然后重新上一步catkin编译即可

imu_utils

标定IMU的内参,可以校准IMU的噪声密度和随机游走噪声

依赖

  • ceres库 ceres-solver

    已安装

安装code_utils

进入之前kalibr_ws工作空间

cd ~/kalibr_ws/src
sudo apt-get install libdw-dev
git clone https://github.com/gaowenliang/code_utils.git
  • 注意

    需要修改 code_utils 的 CMakeLists.txt 文件

    CMAKE_CXX_FLAGS “-std=c++11”
    

    修改为

    CMAKE_CXX_STANDARD 14
    

    并且在CMakeLists.txt下添加

    include_directories(include/code_utils)
    

编译

cd ~/kalibr_ws
catkin_make -j8

安装 imu_utils

cd kalibr_ws/src
git clone https://github.com/gaowenliang/imu_utils.git

注意,这里需要同样修改 imu_utils 的 CMakeLists.txt 文件, 将CMAKE_CXX_FLAGS “-std=c++11” 改为 CMAKE_CXX_STANDARD 14

编译

cd ~/kalibr_ws
catkin_make -j8
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值