local2grid
説明
例
バイナリ占有マップのローカル座標をグリッド インデックスに変換
幅と高さが 10 メートルの空のバイナリ占有マップを作成します。
map = binaryOccupancyMap(10,10);
グリッド インデックスをローカル座標から取得します。
[xLocal,yLocal] = meshgrid(0:0.5:2); ij = local2grid(map,[xLocal(:) yLocal(:)]);
入力引数
map
— 地図表現
binaryOccupancyMap
オブジェクト
地図表現。binaryOccupancyMap
オブジェクトとして指定します。このオブジェクトはビークルの環境を表現します。
xy
— ローカル座標
n 行 2 列の行列
ローカル座標。[x y]
ペアを n 行 2 列の行列として指定します。ここで、n はローカル座標の数です。
データ型: double
出力引数
ij
— グリッド位置
n 行 2 列の行列
グリッド位置。[row col]
の形式で、[i j]
ペアからなる n 行 2 列の行列として返されます。ここで、n はグリッド位置の数です。グリッド セルの位置は、グリッドの左上隅からカウントされます。
データ型: 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)