occupancyMatrix
説明
例
占有マップを行列に変換
幅と高さが 10 メートルの空の占有マップを作成します。
map = occupancyMap(10,10);
8 行 8 列の行列として確率占有値を指定します。
inputMatrix = repmat(0.2:0.1:0.9,8,1);
確率占有値行列をマップに割り当てます。
setOccupancy(map,[1 1],inputMatrix) show(map)
占有マップを確率占有値行列に変換します。
occupancyMatrix(map)
ans = 10×10
0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000
0.5000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 0.5000
0.5000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 0.5000
0.5000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 0.5000
0.5000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 0.5000
0.5000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 0.5000
0.5000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 0.5000
0.5000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 0.5000
0.5000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 0.5000
0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000 0.5000
占有マップを占有値行列に変換します。
occupancyMatrix(map,"ternary")
ans = 10×10
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 1 1 1 -1
-1 -1 -1 -1 -1 -1 1 1 1 -1
-1 -1 -1 -1 -1 -1 1 1 1 -1
-1 -1 -1 -1 -1 -1 1 1 1 -1
-1 -1 -1 -1 -1 -1 1 1 1 -1
-1 -1 -1 -1 -1 -1 1 1 1 -1
-1 -1 -1 -1 -1 -1 1 1 1 -1
-1 -1 -1 -1 -1 -1 1 1 1 -1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1
入力引数
map
— 地図表現
occupancyMap
オブジェクト
地図表現。occupancyMap
オブジェクトとして指定します。このオブジェクトはビークルの環境を表現します。オブジェクトには、セルの占有確率を表す値をもつ行列グリッドが含まれています。1 に近い値は、セルに障害物の含まれる確率が高いことを表します。0 に近い値は、セルが占有されておらず障害物のない確率が高いことを表します。
出力引数
mat
— 占有グリッドの値
行列
占有グリッドの値。h 行 w 列の行列として返されます。ここで、h と w は占有グリッド オブジェクトの GridSize
プロパティの 2 つの要素で定義されます。
データ型: double
拡張機能
C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。
バージョン履歴
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)