Documentation

LaserScan

创建激光扫描消息

Description

TheLaserScanobject is an implementation of thesensor_msgs/LaserScanmessage type in ROS. The object contains meta-information about the message and the laser scan data. You can extract the ranges and angles using the范围property and thereadscanangles功能。要访问笛卡尔坐标中的点,请使用Readcartesian

您也可以将此对象转换为利达尔扫与其他机器人算法一起使用的对象,例如matchScans,controllerVFH, ormonteCarloLocalization

Creation

Description

example

扫描= Rosmessage('Sensor_msgs/Laserscan')创建一个空LaserScanobject. You can specify scan info and data using the properties, or you can get these messages off a ROS network usingrossubscriber

Properties

expand all

此属性仅阅读。

信息type of ROS message, returned as a character vector.

Data Types:char

此属性仅阅读。

ROS Header message, returned as aHeaderobject. This header message contains the信息Type, sequence (Seq), timestamp (邮票), andFrameId。时间戳与扫描中第一射线的收购时间有关。

Minimum angle of range data, specified as a scalar in radians. Positive angles are measured from the forward direction of the robot.

Maximum angle of range data, specified as a scalar in radians. Positive angles are measured from the forward direction of the robot.

范围数据的角度增加, specified as a scalar in radians.

Time between individual range data points in seconds, specified as a scalar.

是时候在几秒钟内完成完整的扫描,指定为标量。

Minimum valid range value, specified as a scalar.

最大有效范围值,指定为标量。

Range readings from laser scan, specified as a vector. To get the corresponding angles, usereadscanangles

强度值读数范围,specified as a vector. If no valid intensity readings are found, this property is empty.

Object Functions

利达尔扫 Create object for storing 2-D lidar scan
plot 显示激光或激光扫描读数
Readcartesian 阅读笛卡尔坐标中的激光扫描范围
readscanangles Return scan angles for laser scan range readings

Examples

collapse all

Load, inspect, and display a sample laser scan message.

Create sample messages and inspect the laser scan message data.Thescanobject is a sample ROSLaserScanmessage object.

exampleHelperROSLoadMessages scan
scan = ROS LaserScan message with properties: MessageType: 'sensor_msgs/LaserScan' Header: [1x1 Header] AngleMin: -0.5467 AngleMax: 0.5467 AngleIncrement: 0.0017 TimeIncrement: 0 ScanTime: 0.0330 RangeMin: 0.4500 RangeMax: 10 Ranges: [640x1 single] Intensities: [0x1 single] Use showdetails to show the contents of the message

从对象属性获取范围和角度。检查范围和角度的大小相同。

ranges = scan.Ranges; angles = scan.readScanAngles; size(ranges)
ans =1×2640 1
size(angles)
ans =1×2640 1
plot(scan)

scan = rosmessage('sensor_msgs/laserscan')
scan = ROS LaserScan message with properties: MessageType: 'sensor_msgs/LaserScan' Header: [1x1 Header] AngleMin: 0 AngleMax: 0 AngleIncrement: 0 TimeIncrement: 0 ScanTime: 0 RangeMin: 0 RangeMax: 0 Ranges: [0x1 single] Intensities: [0x1 single] Use showdetails to show the contents of the message

Introduced in R2019b