Main Content

lidarScan

2 次元 LIDAR スキャンを保存するためのオブジェクトの作成

R2019b 以降

説明

lidarScan オブジェクトには、単一の 2 次元 LIDAR (光検出と測距) スキャンのデータが含まれています。LIDAR スキャンは、特定の角度 (Angles) で測定した環境内のセンサーから障害物までの距離 (Ranges) をもつ 2 次元平面用のレーザー スキャンです。このレーザー スキャン オブジェクトを、matchScanscontrollerVFHmonteCarloLocalization など、他のロボティクス アルゴリズムへの入力として使用します。

作成

説明

scan = lidarScan(ranges,angles) は、LIDAR センサーから収集されたデータを表す rangesangles から lidarScan オブジェクトを作成します。ranges 入力と angles 入力は同じ長さのベクトルであり、Ranges プロパティおよび Angles プロパティに直接設定されます。

scan = lidarScan(cart) は、入力直交座標を n 行 2 列の行列として使用して lidarScan オブジェクトを作成します。Cartesian プロパティはこの入力から直接設定されます。

scan = lidarScan(scanMsg) は、LaserScan (ROS Toolbox) ROS メッセージ オブジェクトから lidarScan オブジェクトを作成します。

プロパティ

すべて展開する

LIDAR からの距離の読み取り値。メートル単位のベクトルとして指定します。このベクトルは Angles と同じ長さで、ベクトル要素はメートル単位で測定されます。

データ型: single | double

LIDAR からの距離の読み取り値の角度。ベクトルとして指定します。このベクトルは Ranges と同じ長さで、ベクトル要素はラジアン単位で測定されます。角度は、正の z 軸を中心として反時計回りに測定されます。

データ型: single | double

LIDAR 読み取り値の直交座標。[x y] 行列として返されます。LIDAR 座標系では、正の x は前方向、正の y は左方向です。

データ型: single | double

LIDAR 読み取り値の数。スカラーとして返されます。このスカラーは、Ranges ベクトルと Angles ベクトルの長さ、または Cartesian 内の行数とも等しくなります。

データ型: double

オブジェクト関数

plotレーザーまたは LIDAR スキャンの読み取り値の表示
removeInvalidDataRemove invalid range and angle data
transformScanTransform laser scan based on relative pose

すべて折りたたむ

LIDAR データを距離と角度のベクトルとして指定します。これらの値には、センサーの範囲外の読み取り値が含まれます。

x = linspace(-2,2);
ranges = abs((1.5).*x.^2 + 5);
ranges(45:55) = 3.5;
angles = linspace(-pi/2,pi/2,numel(ranges));

距離と角度を指定することにより、LIDAR スキャンを作成します。LIDAR スキャンのすべての点をプロットします。

scan = lidarScan(ranges,angles);
plot(scan)

Figure contains an axes object. The axes object with title LiDAR Scan, xlabel X, ylabel Y contains a line object which displays its values using only markers.

指定した最小/最大距離に基づいて、無効な点を削除します。

minRange = 0.1;
maxRange = 7;
scan2 = removeInvalidData(scan,'RangeLimits',[minRange maxRange]);
hold on
plot(scan2)
legend('All Points','Valid Points')

Figure contains an axes object. The axes object with title LiDAR Scan, xlabel X, ylabel Y contains 2 objects of type line. One or more of the lines displays its values using only markers These objects represent All Points, Valid Points.

lidarScan オブジェクトを作成します。距離と角度をベクトルとして指定します。

refRanges = 5*ones(1,300);
refAngles = linspace(-pi/2,pi/2,300);
refScan = lidarScan(refRanges,refAngles);

[x y](0.5,0.2) だけオフセットしてレーザー スキャンを平行移動します。

transformedScan = transformScan(refScan,[0.5 0.2 0]);

レーザー スキャンを 20 度回転します。

rotateScan = transformScan(refScan,[0,0,deg2rad(20)]);

lidarScan (Robotics System Toolbox) を使用して、基準 LIDAR スキャンを作成します。距離と角度をベクトルとして指定します。

refRanges = 5*ones(1,300);
refAngles = linspace(-pi/2,pi/2,300); 
refScan = lidarScan(refRanges,refAngles);

関数transformScan (Robotics System Toolbox)を使用して、x,y オフセット (0.5,0.2) で 2 番目の LIDAR スキャンを生成します。

currScan = transformScan(refScan,[0.5 0.2 0]);

基準スキャンと 2 番目のスキャンを照合して、それらの間の姿勢の誤差を推定します。

pose = matchScans(currScan,refScan);

関数 transformScan を使用し、相対姿勢の誤差を使用して 2 番目のスキャンを最初のスキャンの座標系に変換することにより、スキャンを調整します。元のスキャンと調整されたスキャンの両方をプロットします。

currScan2 = transformScan(currScan,pose);

subplot(2,1,1);
hold on
plot(currScan)
plot(refScan)
title('Original Scans')
hold off

subplot(2,1,2);
hold on
plot(currScan2)
plot(refScan)
title('Aligned Scans')
xlim([0 5])
hold off

Figure contains 2 axes objects. Axes object 1 with title Original Scans, xlabel X, ylabel Y contains 2 objects of type line. One or more of the lines displays its values using only markers Axes object 2 with title Aligned Scans, xlabel X, ylabel Y contains 2 objects of type line. One or more of the lines displays its values using only markers

拡張機能

バージョン履歴

R2019b で導入