• imu标定


     标定需要以下代码

    https://github.com/gaowenliang/imu_utils.git
    https://github.com/gaowenliang/code_utils.git

    要先将在code_utils下面找到sumpixel_test.cpp,修改#include "backward.hpp"为 #include “code_utils/backward.hpp”,再编译

    因为imu_utils 依赖code_utils 所以选择只编译单独的包 要先编译code_utils

    catkin_make -DCATKIN_WHITELIST_PACKAGES="code_utils"
    catkin_make -DCATKIN_WHITELIST_PACKAGES="imu_utils"

    可能会提示没有ceres
    首先需要安装ceres的依赖

    sudo apt-get install cmake
    sudo apt-get install libgoogle-glog-dev
    sudo apt-get install libatlas-base-dev
    sudo apt-get install libeigen3-dev
    sudo apt-get install libsuitesparse-dev
    sudo add-apt-repository ppa:bzindovic/suitesparse-bugfix-1319687
    sudo apt-get update
    sudo apt-get install libsuitesparse-dev

    然后在官网下载ceres包 https://github.com/ceres-solver/ceres-solver

    解压缩后
    将该包移到home目录下
    cd ceres-solver-1.14.0
    mkdir build && cd build
    cmake ..
    make -j4
    sudo make install

    在编译ceres过程中可能出现没有gflags

    git clone https://github.com/gflags/gflags.git
    cd gflags 
    mkdir build && cd build 
    cmake ..
    
    进入gflags/build中,找到CMakeCache.txt
    改为CMAKE_CXX_FLAGS:STRING=-fPIC
    
    export CXXFLAGS="-fPIC" && cmake .. && make VERBOSE=1
    make -j4
    sudo make install

    因为gflasg是源码安装可能会遇到如下问题

    /usr/bin/ld: /usr/local/lib/libgflags.a(gflags.cc.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `_ZN22gflags_mutex_namespace5MutexD1Ev' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/local/lib/l

    解决办法

    如果已经执行完cmake   make  make install 则需要先卸载 sudo make unistall gflags

    然后在按上面方法进行安装

     ceres安装是否成功可以通过以下方式检测

    pi@raspberry:~/ceres-solver-1.14.0$ build/bin/simple_bundle_adjuster data/problem-16-22106-pre.txt 
    iter      cost      cost_change  |gradient|   |step|    tr_ratio  tr_radius  ls_iter  iter_time  total_time
       0  4.185660e+06    0.00e+00    1.09e+08   0.00e+00   0.00e+00  1.00e+04        0    2.72e-01    7.86e-01
       1  1.062590e+05    4.08e+06    8.99e+06   5.36e+02   9.82e-01  3.00e+04        1    6.08e-01    1.39e+00
       2  4.992817e+04    5.63e+04    8.32e+06   3.19e+02   6.52e-01  3.09e+04        1    5.71e-01    1.97e+00
       3  1.899774e+04    3.09e+04    1.60e+06   1.24e+02   9.77e-01  9.26e+04        1    5.70e-01    2.54e+00
       4  1.808729e+04    9.10e+02    3.97e+05   6.39e+01   9.51e-01  2.78e+05        1    5.69e-01    3.11e+00
       5  1.803399e+04    5.33e+01    1.48e+04   1.23e+01   9.99e-01  8.33e+05        1    5.67e-01    3.67e+00
       6  1.803390e+04    9.02e-02    6.35e+01   8.00e-01   1.00e+00  2.50e+06        1    5.69e-01    4.24e+00
    
    Solver Summary (v 1.14.0-eigen-(3.3.4)-lapack-suitesparse-(5.1.2)-cxsparse-(3.1.9)-eigensparse-openmp-no_tbb)
    
                                         Original                  Reduced
    Parameter blocks                        22122                    22122
    Parameters                              66462                    66462
    Residual blocks                         83718                    83718
    Residuals                              167436                   167436
    
    Minimizer                        TRUST_REGION
    
    Dense linear algebra library            EIGEN
    Trust region strategy     LEVENBERG_MARQUARDT
    
                                            Given                     Used
    Linear solver                     DENSE_SCHUR              DENSE_SCHUR
    Threads                                     1                        1
    Linear solver ordering              AUTOMATIC                 22106,16
    Schur structure                         2,3,9                    2,3,9
    
    Cost:
    Initial                          4.185660e+06
    Final                            1.803390e+04
    Change                           4.167626e+06
    
    Minimizer iterations                        7
    Successful steps                            7
    Unsuccessful steps                          0
    
    Time (in seconds):
    Preprocessor                         0.513776
    
      Residual only evaluation           0.252024 (7)
      Jacobian & residual evaluation     1.538697 (7)
      Linear solver                      1.942833 (7)
    Minimizer                            4.066401
    
    Postprocessor                        0.021063
    Total                                4.601241
    
    Termination:                      CONVERGENCE (Function tolerance reached. |cost_change|/cost: 1.769760e-09 <= 1.000000e-06)

    首先先将imu固定水平保持静止两小时,通过rosbag将数据保存

    rosbag record /home/pi/ -a -O imu_raw.bag

    录制完成后
    重现数据并开始标定
    rosbag play -r 200 imu_raw.bag
    roslaunch imu_utils imu_test.launch

    完成后会在imu_utils/data/中生成.yaml文件具体名字在imu_test.launch中修改

    至于得到的.yaml文件如何使用尚不知,如有大神知道望不吝赐教。

  • 相关阅读:
    openssl生成公钥私钥对 加解密
    boost replace_if replace_all_regex_copy用法
    PS 图像滤镜— — USM 锐化
    使用boost库生成 随机数 随机字符串
    改动Android设备信息,如改动手机型号为iPhone7黄金土豪版!
    验证(Verification)与确认(Validation)的差别
    Spring-SpringMVC-Hibernate整合
    全面整理的C++面试题
    Metropolis Hasting算法
    捕捉到来自宇宙深空的神奇X-射线信号
  • 原文地址:https://www.cnblogs.com/miaorn/p/13975923.html
Copyright © 2020-2023  润新知