ROS 中 相机与雷达

1. 相机驱动

  1. 在Noetic版本中,uvc_camera目前还没有提供二进制安装包,需要通过源码编译的方式安装
    源码编译前需要先安装依赖的软件

  2. 然后将源码克隆到你的工作空间src目录下,这里以catkin_ws工作空间为例

    sudo apt install libv4l-dev
    cd ~/catkin_ws/src/
    git clone https://github.com/ros-drivers/camera_umd.git
    git clone --branch=develop https://github.com/ros-drivers/usb_cam.git
    cd ..
    catkin_make
    

2. 校准摄像头

  1. 在Noetic中进行二进制安装
    sudo apt-get install ros-noetic-camera-calibration
    
  2. 查看相机的默认信息,默认的标定信息
    rosrun uvc_camera uvc_camera_node
    
  3. 进行标定,要先启动相机,注意图像的话题--square 单位是m--size 是角点,横竖
    rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.0255 image:=/usb_cam/image_raw
    
    绿色状态后,点击save,就在/tmp获得标定结果,是一个压缩包,现在把他移动到主目录,里面的yaml就是标定结果
    mv /tmp/calibrationdata.tar.gz  ~
    

3. 雷达驱动

  1. 参考:
  2. 这里是livox的安装环境
    # 随便找个位置安装sdk到系统
    git clone https://github.com/Livox-SDK/Livox-SDK2.git
    cd ./Livox-SDK2/
    mkdir build
    cd build
    cmake .. && make -j
    sudo make install
    # 安装ros驱动
    cd Livox_ws/src
    git clone https://github.com/Livox-SDK/livox_ros_driver2.git
    cd livox_ros_driver2/
    source /opt/ros/noetic/setup.sh
    ./build.sh ROS1
    # 测试运行,记得改 config/HAP_config.json 里面的IP
    

4. 雷达与相机的标定1

  1. 安装环境,依赖就建议在工作空间下放这些就行
    sudo apt install -y libglm-dev libglfw3-dev
    
    
    # 2. 依赖1
    mkdir temp_reply && cd temp_reply
    git clone https://github.com/koide3/iridescence --recursive
    cd iridescence
    mkdir build && cd build
    cmake ..
    make -j8
    sudo make install
    
    # 3. 依赖2
    git clone  https://github.com/fmtlib/fmt.git
    cd fmt
    # 修改这里面的cmakelists文件,一定添加:add_compile_options(-fPIC)
    mkdir build && cd build
    cmake ..
    make
    sudo make install
    
    # 依赖3,这个又依赖2
    git clone https://github.com/strasdat/Sophus.git
    cd Sophus
    mkdir build && cd build
    cmake ..
    make
    sudo make install
    
    # 依赖4
    git clone https://github.com/nlohmann/json.git
    cd json
    mkdir build && cd build
    cmake ..
    make
    sudo make install
    
  2. ROS功能包的安装, 如果编译有调用歧义的时候,需要更改源码为double:T_lidar_camera_gizmo.set_model_matrix(T_camera_lidar->inverse().matrix().cast<double>());
    # 3. 下面才是编译功能包,上面的是准备工作
    mkdir -p cal_lidar_cam_ws/src
    cd cal_lidar_cam_ws/src
    git clone https://github.com/koide3/direct_visual_lidar_calibration.git --recursive
    cd ..
    catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3 -j1
    
  3. 运行

5. 相机与雷达的标定2

  1. HKU的相机与雷达标定
    mkdir -p HKU_lidar_cam_ws/src
    cd HKU_lidar_cam_ws/src
    git clone https://github.com/hku-mars/livox_camera_calib.git
    cd ..
    catkin_make
    

参考

ROS小课堂:使用usb_cam软件包调试usb摄像头
CSDN:ROS掉包侠修炼计划

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

酸奶可乐

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值