1. 相机驱动
-
在Noetic版本中,uvc_camera目前还没有提供二进制安装包,需要通过源码编译的方式安装
源码编译前需要先安装依赖的软件 -
然后将源码克隆到你的工作空间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. 校准摄像头
- 在Noetic中进行二进制安装
sudo apt-get install ros-noetic-camera-calibration
- 查看相机的默认信息,默认的标定信息
rosrun uvc_camera uvc_camera_node
- 进行标定,要先启动相机,注意图像的话题,
--square 单位是m
,--size 是角点,横竖
绿色状态后,点击save,就在/tmp获得标定结果,是一个压缩包,现在把他移动到主目录,里面的yaml就是标定结果rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.0255 image:=/usb_cam/image_raw
mv /tmp/calibrationdata.tar.gz ~
3. 雷达驱动
- 参考:
- 这里是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
- 安装环境,依赖就建议在工作空间下放这些就行
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
- 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
- 运行
5. 相机与雷达的标定2
- 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掉包侠修炼计划