• D435i相机标定


    D435i相机标定

    IMU标定

    • 安装imu_utils、code_utils、realsense-ros
    • 使用imu_utils录制imu_calibration.bag
    #1. 运行相机d435i
    roslaunch realsense2_camera rs_camera.launch unite_imu_method:="linear_interpolation" enable_gyro:=true enable_accel:=true
    #2.录制IMU数据包
    rosbag record -O imu_calibration /camera/imu
    #3.使用imu_utils进行标定,首先需要新建一个imu_utils的launch文件,内容如下所示
    
        
            
            
            
            
            
            
            
            
            
        
    
    #4.我们把新建的launch文件命名为d435i_imu_calibration.launch ,然后通过如下的命令就可以运行了:
    roslaunch imu_utils d435i_imu_calibration.launch
    #5. 播放之前录制的数据包,找到录制的数据包,运行下面的命令
    rosbag play -r 200 imu_calibration.bag
    #6.这一部分的工作都完成之后,我们会得到D435i相机IMU的标定文件D435i_imu_param.yaml
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24

    使用Kalibr进行相机和IMU联合标定

    • 安装kalibr
    # 创建kalibr的ros工作空间
    mkdir -p kalibr_ws/src && cd kalibr_ws/src
    git clone https://github.com/ethz-asl/Kalibr.git
    cd ..
    catkin_make
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 运行kalibr生成标定板
    rosrun kalibr kalibr_create_target_pdf --type apriltag --nx 6 --ny 6 
    --tsize 0.03 --tspace 0.3
    或者
    rosrun kalibr kalibr_create_target_pdf --type checkerboard --nx 6 --ny 7 
    --csx 0.05 --csy 0.05
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 可能会出现的错误的解决方法:
    出现ModuleNotFoundError: No module named 'pyx'时,如果使用pip安装无法解决,则需要使
    用sudo apt-get install python3-pyx进行安装.或者sudo apt-get install python-pyx安装
    
    
    • 1
    • 2
    • 3

    上面的命令会生成6x6、格子大小为3cm的标定板(后者是棋盘格子),并将下述参数写入Kalibr/data/checkerboader.yaml文件:

    tagCols: 6               #number of apriltags
    tagRows: 6               #number of apriltags
    tagSize: 0.03            #size of apriltag, edge to edge [m]
    tagSpacing: 0.3          #ratio of space between tags to tagSize
    
    • 1
    • 2
    • 3
    • 4

    棋盘格的参数对应为:

    arget_type: 'checkerboard'
    targetCols: 6 # 横向的角点数
    targetRows: 7
    rowSpacingMeters: 0.03 # 每个格子的宽度
    colSpacingMeters: 0.03
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 采集相机标定数据
      - 开启相机节点:
    roslaunch realsense2_camera rs_camera.launch
    
    • 1
    • 打开可视化窗口,随时查看相机拍摄情况:
    rviz  //坐标系选camera_link,然后添加相机话题即可实时可视化图像
    
    • 1
    • 调整采集图片分辨率,重新发布一个话题:
    rosrun topic_tools throttle messages /camera/color/image_raw 6.0 /calib_image
    
    • 1
    • 录制标定数据bag包
    rosbag record -o d435i_calib_rgbimage /calib_image
    
    
    • 1
    • 2
    • 开始利用Kalibr标定
    rosrun kalibr kalibr_calibrate_cameras --target ./src/Kalibr/data/target.yaml --bag ./src/Kalibr/data/d435i_calib_rgbimage_2022-11-03-09-14-20.bag --models pinhole-equi --topics /calib_image
    
    • 1

    ModuleNotFoundError: No module named ‘wx’: 在使用python的时候使用的是/usr/bin中的python,并不是conda环境中的python,所以需要使用sudo pip安装wx包.
    - igraph的版本问题,可以安装第版本的igraph

    sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple igraph==0.1.1
    
    
    • 1
    • 2

    如果igraph出现无.Graph对象,则卸载igraph安装python_igraph

    #卸载igraph
    pip uninstall igraph
    #先安装如下包,否则无法编译python_igraph包
    sudo apt-get install -y libigraph0-dev
    sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple python_graph==0.7.1.post6
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    标定时出现 Attempt to unlock mutex that was not locked 已放弃 (核心已转储)错误时,将标定命令的show参数去除

    rosrun kalibr kalibr_calibrate_cameras --target ./src/Kalibr/data/target.yaml --bag ./src/Kalibr/data/d435i_calib_rgbimage_2022-11-03-09-14-20.bag --models pinhole-equi --topics /calib_image
    
    
    • 1
    • 2

    参考:https://blog.csdn.net/weixin_50508111/article/details/123985154

    • IMU+相机联合标定
      • 录制标定数据
    # 仍然使用之前的标定板,运行下面的命令发布图像和IMU话题
    roslaunch realsense2_camera rs_camera.launch unite_imu_method:="linear_interpolation"
    
    #将图像频率设置为20Hz,IMU频率设置为200Hz:
    rosrun topic_tools throttle messages /camera/color/image_raw 20.0 /color
    rosrun topic_tools throttle messages /camera/imu 200.0 /imu
    
    #开始录制
    rosbag record -O dynamic /color /imu
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 开始标定
    rosrun kalibr kalibr_calibrate_imu_camera --target ./src/Kalibr/data/target.yaml --cam ./src/Kalibr/data/camchain.yaml --imu ./src/Kalibr/data/imu.yaml --bag ./src/Kalibr/data/dynamic.bag
    
    • 1
  • 相关阅读:
    Rust之自动化测试(三): 测试组合
    Day8、9、10、11 计算机网络——数据链路层
    企业微信hook接口协议,ipad协议http,设置消息回调地址
    贝叶斯风险
    SpringBoot + Vue 实现侧边栏目录动态展示
    JAVA byte类型转String类型
    Java程序员不掌握SpringBoot怎么进大厂,你就想摆烂吗,还不来看看,卷死他们!
    生物信息学笔记03 -- 基因组序列分析 方法
    C++ 队列和双向队列
    腾讯罗嘉黎:基于APM的腾讯可观测平台技术与实践
  • 原文地址:https://blog.csdn.net/qq_28915885/article/details/127673069