1.功能包安装
1-编译
mkdir -p ~/CL_calibration_ws/src
cd ~/CL_calibration_ws/src
git clone https://github.com/XidianLemon/calibration_camera_lidar.git
catkin_make
2-修改代码
打开CMakeLIsts.txt
将三处该行if ("${ROS_VERSION}" MATCHES "(indigo|jade|kinetic)")
改为if ("${ROS_VERSION}" MATCHES "(indigo|jade|kinetic|melodic)")
重新编译:
catkin_make
3-测试启动
输入命令,显示如下,则证明正常:
source devel/setup.bash
rosrun calibration_camera_lidar calibration_toolkit
2.启动传感器
启动激光雷达:
roslaunch rslidar_sdk start.launch
/velodyne_points
/rslidar_points
启动相机:
roslaunch realsense2_camera rs_camera.launch
/camera/color/image_raw
3.录制数据
rosbag record /velodyne_points /rslidar_points /camera/color/image_raw
4.测试标定板
rosbag play best.bag /velodyne_points:=/points_raw
roslaunch openni_launch openni.launch
rosrun camera_calibration cameracalibrator.py --size 6x8 --square 0.108 image:=/camera/color/image_raw camera:=/camera --no-service-check
5.播放数据
设置上面的尺寸为0.108m,格数为6x8。我标定了163帧得到如下结果,标定完了以后先点击“Calibrate”,再点击“Project”查看效果。注意校准的瞬间会占用大量CPU,我点完“Calibrate”后等待了5分钟,才计算出结果。最后点击左上角的“Save”,提示两个保存的内容都点“No”。保存名称为xxx.yaml。
rosbag play best.bag /velodyne_points:=/points_raw
cd CL_calibration_ws/
source devel/setup.bash
rosrun calibration_camera_lidar calibration_toolkit
6.Autoware验证联合标定效果
打开Autoware,设置标定参数,其他的不要设置,尤其是不要瞎改坐标系ID,就会导致出来的图像上没有点云。效果完美,问题解决。
设置PointImage,默认就行。
打开RVIZ,添加Pannels,选对应的参数,查看标定结果即可。
7.工程应用
单独启动功能:
rosbag play xxx.bag
roslaunch runtime_manager calibration_publisher_new.launch
roslaunch runtime_manager points2image_new.launch
8. 手动标定
1.github:https://github.com/PJLab-ADG/SensorsCalibration/tree/master/lidar2camera
2.rosbag文件转PCD
rosrun pcl_ros bag_to_pcd 222.bag /velodyne_points /home/nvidia/sss/pcd
3.rosbag文件转image
rosrun image_view extract_images image:=/camera/color/image_raw
4.进入到/lidar2camera/manual_calib目录,执行以下命令
mkdir -p build && cd build
cmake .. && make
5.矩阵变换
https://zhuanlan.zhihu.com/p/48979024
6.启动
./bin/run_lidar2camera image/frame3303.jpg pcd/1703039287.267443895.pcd center_camera-intrinsic.json top_center_lidar-to-center_camera-extrinsic.json文章来源:https://www.toymoban.com/news/detail-806398.html
参考:链接文章来源地址https://www.toymoban.com/news/detail-806398.html
到了这里,关于Autoware实现相机和激光雷达联合标定的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!