相机雷达标定cam_lidar_calibration
文章目录
-
- 运行环境:
- 1.1 ROS环境配置
-
- 1)工作空间创建和编译
- 2)官方数据集测试环境
- 2.1 在线标定
-
- 1)数据类型
- 2)标定板制作
- 3)配置文件
- 4)开始标定
- 5)完整实现步骤
- 3.1 python版本选择
- 3.2 rviz参数修改
运行环境:
ubuntu18.04.6 melodic
opencv 3.4.16
python 2.7.17 (ros自带)
usb-cam
速腾robosense 16
1.1 ROS环境配置
官方Github: https://github.com/acfr/cam_lidar_calibration
rs_to_velodyne :https://github.com/HViktorTsoi/rs_to_velodyne
1)工作空间创建和编译
# 创建工作空间
mkdir -p calib_new_ws/src
cd calib_new_ws/src# 克隆仓库
git clone -c http.sslverify=false https://gitlab.acfr.usyd.edu.au/its/cam_lidar_calibration.git# 下载ros和python依赖
sudo apt update && sudo apt-get install -y ros-noetic-pcl-conversions ros-noetic-pcl-ros ros-noetic-tf2-sensor-msgs
pip install pandas scipy# 编译
cd calib_new_ws
catkin_make
2)官方数据集测试环境
①开始标定
roslaunch cam_lidar_calibration run_optimiser.launch import_samples:=true
标定好的文件保存在 cam_lidar_calibration/data/vlp/路径下
②评估标定结果
roslaunch cam_lidar_calibration assess_results.launch csv:="$(rospack find cam_lidar_calibration)/data/vlp/calibration_quickstart.csv" visualise:=true
2.1 在线标定
1)数据类型
激光雷达点云类型为XYZIR
雷达话题数据类型 sensor_msgs::PointCloud2
相机话题数据类型 sensor_msgs::Image、sensor_msgs::CameraInfo
rostopic type /velodyne_points
rostopic type /usb_cam/image_raw
rostopic type /usb_cam/camera_info
标定好的文件保存在cam_lidar_calibration/data路径下
2)标定板制作
标定板打印路径
我们标定板大小:图3—A1(841 x 594mm), 小方格边长 95mm ,内部顶点 7x5
标定注意事项:标定板摆放与地面成45°角
3)配置文件
设置params.yaml中的话题和棋盘格大小(参考标定板制作内容)
# 速腾RS16 + usb_cam
camera_topic: "/usb_cam/image_raw"
camera_info: "/usb_cam/camera_info"
# rs 话题
# lidar_topic: "/rslidar_points"
# rs_to_velodyne 话题
lidar_topic: "/velodyne_points"
4)开始标定
偏移量设置(减少平均误差) distance_offset_mm=-30
①启动标定包
roslaunch cam_lidar_calibration run_optimiser.launch import_samples:=false
②调整 rqt_reconfigure 中的 x、y 、 z 分离出棋盘点云, 分离好一张点Capture, 有问题的点discard。分离好20张左右点Optimise。
标定注意事项:对于 VLP-16,至少保证7条线打在标定板上
②获取标定结果
roslaunch cam_lidar_calibration assess_results.launch csv:="$(rospack find cam_lidar_calibration)/data/vlp/calibration_quickstart.csv" visualise:=true
5)完整实现步骤
详细操作见博客:
Robosense激光雷达Linux配置
usb_cam 相机ROS配置
usb_cam相机标定实践 ROS
1.启动相机
cd /home/duduzai/SPbot/usb_cam_ws
source ./devel/setup.bash
roslaunch usb_cam usb_cam.launch2.启动雷达(注释雷达launch中的rviz)
cd /home/duduzai/SPbot/robosense_ws
source ./devel/setup.bash
roslaunch rslidar_sdk start.launch3.rs to velodyne
cd source ./devel/setup.bash
source ./devel/setup.bash
rosrun rs_to_velodyne rs_to_velodyne XYZIRT XYZIR4、标定
cd /home/duduzai/SPbot/calib_new_ws
source ./devel/setup.bash
roslaunch cam_lidar_calibration run_optimiser.launch import_samples:=false
roslaunch cam_lidar_calibration assess_results.launch csv:="$(rospack find cam_lidar_calibration)/data/vlp/calibration_2023-04-20_17-23-44.csv" visualise:=true
3.1 python版本选择
3.2 rviz参数修改
Panels:- Class: rviz/DisplaysHelp Height: 0Name: DisplaysProperty Tree Widget:Expanded:- /Global Options1- /Status1- /Image1- /Image2- /MarkerArray1Splitter Ratio: 0.5Tree Height: 366- Class: rviz/SelectionName: Selection- Class: rviz/Tool PropertiesExpanded:- /2D Pose Estimate1- /2D Nav Goal1- /Publish Point1Name: Tool PropertiesSplitter Ratio: 0.5886790156364441- Class: rviz/ViewsExpanded:- /Current View1Name: ViewsSplitter Ratio: 0.5- Class: rviz/TimeExperimental: falseName: TimeSyncMode: 0SyncSource: Image- Class: cam_lidar_calibration/CamLidarCalibrationName: CamLidarCalibration
Preferences:PromptSaveOnExit: true
Toolbars:toolButtonStyle: 2
Visualization Manager:Class: ""Displays:- Alpha: 0.5Cell Size: 1Class: rviz/GridColor: 160; 160; 164Enabled: trueLine Style:Line Width: 0.029999999329447746Value: LinesName: GridNormal Cell Count: 0Offset:X: 0Y: 0Z: 0Plane: XY# Plane Cell Count: 10Plane Cell Count: 50Reference Frame: <Fixed Frame>Value: true- Class: rviz/ImageEnabled: trueImage Topic: /gmsl/A0/image_colorMax Value: 1Median window: 5Min Value: 0Name: ImageNormalize Range: trueQueue Size: 2Transport Hint: rawUnreliable: falseValue: true- Class: rviz/ImageEnabled: true# Image Topic: /camera_featuresImage Topic: /usb_cam/image_rawMax Value: 1Median window: 5Min Value: 0Name: ImageNormalize Range: trueQueue Size: 2Transport Hint: rawUnreliable: falseValue: true- Alpha: 1Autocompute Intensity Bounds: trueAutocompute Value Bounds:Max Value: 10Min Value: -10Value: trueAxis: ZChannel Name: intensityClass: rviz/PointCloud2Color: 255; 255; 255Color Transformer: IntensityDecay Time: 0Enabled: trueInvert Rainbow: falseMax Color: 255; 255; 255# Max Intensity: 217Max Intensity: 155Min Color: 0; 0; 0Min Intensity: 1Name: Experimental RegionPosition Transformer: XYZQueue Size: 10Selectable: trueSize (Pixels): 3# Size (m): 0.009999999776482582Size (m): 0.01Style: Flat SquaresTopic: /feature_extraction/experimental_regionUnreliable: falseUse Fixed Frame: trueUse rainbow: trueValue: true- Alpha: 1Autocompute Intensity Bounds: trueAutocompute Value Bounds:Max Value: 10Min Value: -10Value: trueAxis: ZChannel Name: intensityClass: rviz/PointCloud2Color: 255; 255; 255Color Transformer: IntensityDecay Time: 0Enabled: trueInvert Rainbow: falseMax Color: 255; 255; 255Max Intensity: 60Min Color: 0; 0; 0Min Intensity: 1Name: ChessboardPosition Transformer: XYZQueue Size: 10Selectable: trueSize (Pixels): 3Size (m): 0.009999999776482582Style: Flat SquaresTopic: /feature_extraction/chessboardUnreliable: falseUse Fixed Frame: trueUse rainbow: trueValue: true- Class: rviz/MarkerArrayEnabled: trueMarker Topic: /feature_extraction/collected_samplesName: MarkerArrayNamespaces:Frame Rate: 30Name: rootTools:- Class: rviz/InteractHide Inactive Objects: true- Class: rviz/MoveCamera- Class: rviz/Select- Class: rviz/FocusCamera- Class: rviz/Measure- Class: rviz/SetInitialPoseTheta std deviation: 0.2617993950843811Topic: /initialposeX std deviation: 0.5Y std deviation: 0.5- Class: rviz/SetGoalTopic: /move_base_simple/goal- Class: rviz/PublishPointSingle click: trueTopic: /clicked_pointValue: trueViews:Current:Class: rviz/OrbitDistance: 7.726625442504883Enable Stereo Rendering:Stereo Eye Separation: 0.05999999865889549Stereo Focal Distance: 1Swap Stereo Eyes: falseValue: falseFocal Point:X: 2.3772096633911133Y: -1.2373826503753662Z: 1.9428495168685913Focal Shape Fixed Size: trueFocal Shape Size: 0.05000000074505806Invert Z Axis: falseName: Current ViewNear Clip Distance: 0.009999999776482582Pitch: 0.6603978276252747Target Frame: <Fixed Frame>Value: Orbit (rviz)Yaw: 2.71859073638916Saved: ~
Window Geometry:CamLidarCalibration:collapsed: falseDisplays:collapsed: falseHeight: 1075Hide Left Dock: falseHide Right Dock: trueImage:collapsed: falseQMainWindow State: 000000ff00000000fd00000004000000000000016a00000391fc020000000cfb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073000000003d000001ab000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d006100670065010000003d000001660000001600fffffffb0000000a0049006d00610067006501000001a90000016d0000001600fffffffb0000000a0049006d0061006700650100000172000001400000000000000000fb0000002600430061006d004c006900640061007200430061006c006900620072006100740069006f006e010000031c000000b2000000a300ffffff000000010000010f00000315fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000315000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000078000000042fc0100000002fb0000000800540069006d0065010000000000000780000002eb00fffffffb0000000800540069006d00650100000000000004500000000000000000000006100000039100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000Selection:collapsed: falseTime:collapsed: falseTool Properties:collapsed: falseViews:collapsed: trueWidth: 1920X: 1920Y: 201 Value: trueEnabled: trueGlobal Options:Background Color: 48; 48; 48Default Light: true# Fixed Frame: velodyne_front_link# Fixed Frame: rslidar Fixed Frame: velodyneFrame Rate: 30Name: rootTools:- Class: rviz/InteractHide Inactive Objects: true- Class: rviz/MoveCamera- Class: rviz/Select- Class: rviz/FocusCamera- Class: rviz/Measure- Class: rviz/SetInitialPoseTheta std deviation: 0.2617993950843811Topic: /initialposeX std deviation: 0.5Y std deviation: 0.5- Class: rviz/SetGoalTopic: /move_base_simple/goal- Class: rviz/PublishPointSingle click: trueTopic: /clicked_pointValue: trueViews:Current:Class: rviz/OrbitDistance: 7.726625442504883Enable Stereo Rendering:Stereo Eye Separation: 0.05999999865889549Stereo Focal Distance: 1Swap Stereo Eyes: falseValue: falseFocal Point:X: 2.3772096633911133Y: -1.2373826503753662Z: 1.9428495168685913Focal Shape Fixed Size: trueFocal Shape Size: 0.05000000074505806Invert Z Axis: falseName: Current ViewNear Clip Distance: 0.009999999776482582Pitch: 0.6603978276252747Target Frame: <Fixed Frame>Value: Orbit (rviz)Yaw: 2.71859073638916Saved: ~
Window Geometry:CamLidarCalibration:collapsed: falseDisplays:collapsed: falseHeight: 1075Hide Left Dock: falseHide Right Dock: trueImage:collapsed: falseQMainWindow State: 000000ff00000000fd00000004000000000000016a00000391fc020000000cfb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073000000003d000001ab000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d006100670065010000003d000001660000001600fffffffb0000000a0049006d00610067006501000001a90000016d0000001600fffffffb0000000a0049006d0061006700650100000172000001400000000000000000fb0000002600430061006d004c006900640061007200430061006c006900620072006100740069006f006e010000031c000000b2000000a300ffffff000000010000010f00000315fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003d00000315000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000078000000042fc0100000002fb0000000800540069006d0065010000000000000780000002eb00fffffffb0000000800540069006d00650100000000000004500000000000000000000006100000039100000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000Selection:collapsed: falseTime:collapsed: falseTool Properties:collapsed: falseViews:collapsed: trueWidth: 1920X: 1920Y: 201
⭐⭐⭐ 嘟嘟崽 ⭐⭐⭐ ⭐⭐⭐ 祝你成功 ⭐⭐⭐