转载自:https://www.cnblogs.com/21207-iHome/p/7840129.html
激光雷达工作时会先在当前位置发出激光并接收反射光束,解析得到距离信息,而后激光发射器会转过一个角度分辨率对应的角度再次重复这个过程。限于物理及机械方面的限制,激光雷达通常会有一部分“盲区”。
使用激光雷达返回的数据通常可以描绘出一幅极坐标图,极点位于雷达扫描中心,0-360°整周圆由扫描区域及盲区组成。在扫描区域中激光雷达在每个角度分辨率对应位置解析出的距离值会被依次连接起来。这样,通过极坐标表示就能非常直观地看到周围物体的轮廓,激光雷达扫描范围示意图可以参见下图。
激光雷达通常有四个性能衡量指标:测距分辨率、扫描频率(有时也用扫描周期)、角度分辨率、可视范围。
- 测距分辨率衡量在一个给定的距离下测距的精确程度,通常与距离真实值相差在5-20mm;
- 扫描频率衡量激光雷达完成一次完整扫描的快慢,通常在10Hz及以上;
- 角度分辨率直接决定激光雷达一次完整扫描能返回多少个样本点;
- 可视范围指激光雷达完整扫描的广角,可视范围之外即为盲区。
目前,移动机器人的研究中已经大量使用激光雷达辅助机器人的避障导航。通常激光雷达会提供ROS驱动,如果没有的话我们也可以自己采集激光数据后按照ROS中定义的消息格式将信息发布出去。首先,输入下面的指令查看LaserScan消息结构:
rosmsg show sensor_msgs/LaserScan
LaserScan消息结构如下:
std_msgs/Header header
uint32 seq
time stamp
string frame_id # in frame frame_id, angles are measured around the positive Z axis (counterclockwise, if Z is up)
# with zero angle being forward along the x axis
float32 angle_min # start angle of the scan [rad]
float32 angle_max # end angle of the scan [rad]
float32 angle_increment # angular distance between measurements [rad]
float32 time_increment # time between measurements [seconds] - if your scanner
# is moving, this will be used in interpolating position
# of 3d points
float32 scan_time # time between scans [seconds]
float32 range_min # minimum range value [m]
float32 range_max # maximum range value [m]
float32[] ranges # range data [m] (Note: values < range_min or > range_max should be discarded)
float32[] intensities # intensity data [device-specific units]. If your device does not provide intensities, please leave the array empty.
中文介绍就是
#
# 测量的激光扫描角度,逆时针为正
# 设备坐标帧的0度面向前(沿着X轴方向)
#
Header header
float32 angle_min # scan的开始角度 [弧度]
float32 angle_max # scan的结束角度 [弧度]
float32 angle_increment # 测量的角度间的距离 [弧度]
float32 time_increment # 测量间的时间 [秒]
float32 scan_time # 扫描间的时间 [秒]
float32 range_min # 最小的测量距离 [米]
float32 range_max # 最大的测量距离 [米]
float32[] ranges # 测量的距离数据 [米] (注意: 值 < range_min 或 > range_max 应当被丢弃)
float32[] intensities # 强度数据 [device-specific units]
以下图为例,该激光雷达扫描范围为270°,角度分辨率为0.25°,扫描距离为0~20m,每扫描一圈会得到1081个点:
那么该激光雷达发布的LaserScan消息内容如下:
angle_min= -135 * (pi/180); //angle correspond to FIRST beam in scan ( in rad)
angle_max= 135 * (pi/180); //angle correspond to LAST beam in scan ( in rad)
angle_increment =0.25 * (pi/180); // Angular resolution i.e angle between 2 beams
// lets assume sensor gives 50 scans per second. i.e every 20 milli seconds 1 scan with 1081 beams.
// Each beam is measured in (20 ms/ 1081 ) ~ = 0.0185 ms
time_increment = (1 / 50) / (1081);
scan_time = ; // scan is collected at which time
range_min =0 ; // in meters
range_max = 20; // scan can measure upto this range
// ranges is array of 1081 floats for each laser beam
ranges[0] = //distance measure corresponds to angle -135 deg
ranges[1] = //distance measure corresponds to angle -134.75 deg
.
.
.
ranges[1080] = //distance measure corresponds to angle +135 deg
// To understand Intensities
// if a laser beam hits reflective surface like glass it will have intensity 1.
// And if beam hit some surface which absorbs laser , then intensity is zero.
// Middle values are different surfaces in between.
更多:http://wiki.ros.org/cn/navigation/Tutorials/RobotSetup/Sensors