inflate
説明
inflate(
は、入力 map3D
,radius
)occupancyMap3D
オブジェクトで指定された各占有位置をメートル単位で指定された radius
でインフレートします。radius
は、マップの分解能に基づいて最も近い同等のセルに切り上げられます。このインフレーションにより、マップ内の占有位置のサイズが大きくなります。
例
3 次元占有マップでの光線の交点の取得
3 次元占有マップをインポートします。
map3D = importOccupancyMap3D("citymap.ot")
map3D = occupancyMap3D with properties: ProbabilitySaturation: [1.0000e-03 0.9990] Resolution: 1 OccupiedThreshold: 0.6500 FreeThreshold: 0.2000
半径 1 m で占有領域をインフレートします。マップを表示します。
inflate(map3D,1) show(map3D)
光線の交点とマップの占有セルを求めます。
numRays = 10; angles = linspace(-pi/2,pi/2,numRays); directions = [cos(angles); sin(angles); zeros(1,numRays)]'; sensorPose = [55 40 1 1 0 0 0]; maxrange = 15; [intersectionPts,isOccupied] = rayIntersection(map3D,sensorPose,directions,maxrange)
intersectionPts = 10×3
55.0000 32.0000 1.0000
57.9118 32.0000 1.0000
61.7128 32.0000 1.0000
67.9904 32.5000 1.0000
69.0000 37.5314 1.0000
69.0000 42.4686 1.0000
67.9904 47.5000 1.0000
64.6418 51.4907 1.0000
58.2757 49.0000 1.0000
55.0000 49.0000 1.0000
isOccupied = 10×1
1
1
1
-1
1
1
-1
-1
1
1
交点をプロットし、姿勢から交点への光線をプロットします。
hold on plotTransforms(sensorPose(1:3),sensorPose(4:end),... 'FrameSize',5,'MeshFilePath','groundvehicle.stl') % Vehicle sensor pose for i = 1:numRays plot3([sensorPose(1),intersectionPts(i,1)],... [sensorPose(2),intersectionPts(i,2)],... [sensorPose(3),intersectionPts(i,3)],'-b') % Plot rays if isOccupied(i) == 1 plot3(intersectionPts(i,1),intersectionPts(i,2),intersectionPts(i,3),'*r') % Intersection points end end
入力引数
map3D
— 3 次元占有マップ
occupancyMap3D
オブジェクト
3 次元占有マップ。occupancyMap3D
オブジェクトとして指定します。
radius
— 占有位置をインフレートする量
スカラー
占有位置をインフレートする量。スカラーとして指定します。radius
は最も近いセルの値に切り上げられます。
拡張機能
C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。
inflate
は、packType
引数を "flat"
に設定した場合、関数 packNGo
(MATLAB Coder) を使用したコード生成をサポートしません。
バージョン履歴
R2019b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)