前言
摄像头感知可以完成障碍物识别、车道线识别、红绿灯识别三种功能。
首先读取摄像头感知配置文件,该配置文件目录modules/perception/production/conf/perception/camera/fusion_camera_detection_component.pb.txt
,目前摄像头感知模块只支持双摄像头感知,按照官方推荐分别是6mm和12mm焦距的摄像头。
初始化需要摄像头的内参和外参标定文件,相关标定文件在文件夹modules/perception/data/params
下,内参文件命名规则是frame_id + "_intrinsics.yaml"
,内容如下
header:
seq: 0
stamp:
secs: 0
nsecs: 0
frame_id: ''
height: 1080
width: 1920
distortion_model: plumb_bob
D: [0.000000000000e+00, 0.000000000000e+00, 0.000000000000e+00, 0.000000000000e+00, 0.000000000000e+00]
K: [1.158033737075e+03, 0.000000000000e+00, 9.600000000000e+02, 0.000000000000e+00, 1.158033737075e+03, 5.400000000000e+02, 0.000000000000e+00, 0.000000000000e+00, 1.000000000000e+00]
R: [1.000000000000e+00, 0.000000000000e+00, 0.000000000000e+00, 0.000000000000e+00, 1.000000000000e+00, 0.000000000000e+00, 0.000000000000e+00, 0.000000000000e+00, 1.000000000000e+00]
P: [1.158033737075e+03, 0.000000000000e+00, 9.600000000000e+02, 0.000000000000e+00, 0.000000000000e+00, 1.158033737075e+03, 5.400000000000e+02, 0.000000000000e+00, 0.000000000000e+00, 0.000000000000e+00, 1.000000000000e+00, 0.000000000000e+00]
binning_x: 0
binning_y: 0
roi:
x_offset: 0
y_offset: 0
height: 0
width: 0
do_rectify: False
读取内参文件的参数是height
、width
、D
、K
。
外参文件命名规则camera_name +"_extrinsics.yaml"
,摄像头高度是根据激光雷达高度以及摄像头外参文件计算得到的