setOccupancy
位置の占有確率を設定
説明
例
occupancyMap3D オブジェクトを作成します。
map3D = occupancyMap3D;
地面を作成して占有値を 0 に設定します。
[xGround,yGround,zGround] = meshgrid(0:100,0:100,0); xyzGround = [xGround(:) yGround(:) zGround(:)]; occval = 0; setOccupancy(map3D,xyzGround,occval)
マップの特定のワールド位置に障害物を作成します。
[xBuilding1,yBuilding1,zBuilding1] = meshgrid(20:30,50:60,0:30); [xBuilding2,yBuilding2,zBuilding2] = meshgrid(50:60,10:30,0:40); [xBuilding3,yBuilding3,zBuilding3] = meshgrid(40:60,50:60,0:50); [xBuilding4,yBuilding4,zBuilding4] = meshgrid(70:80,35:45,0:60); xyzBuildings = [xBuilding1(:) yBuilding1(:) zBuilding1(:);... xBuilding2(:) yBuilding2(:) zBuilding2(:);... xBuilding3(:) yBuilding3(:) zBuilding3(:);... xBuilding4(:) yBuilding4(:) zBuilding4(:)];
新しい確率値を使用して障害物を更新し、マップを表示します。
obs = 0.65; updateOccupancy(map3D,xyzBuildings,obs) show(map3D)

マップ ファイルを作成する前に、citymap.ot という名前のマップ ファイルが現在のディレクトリに既に存在するか確認し、このファイルを削除します。
if exist("citymap.ot",'file') delete("citymap.ot") end
マップを八分木ファイルとしてエクスポートします。
filePath = fullfile(pwd,"citymap.ot");
exportOccupancyMap3D(map3D,filePath)入力引数
3 次元占有マップ。occupancyMap3D オブジェクトとして指定します。
ワールド座標。点 [x y z] の n 行 3 列の行列として指定します。ここで、n はワールド座標の数です。
確率占有値。xyz と同じ長さの列ベクトルまたはスカラーとして指定します。スカラー入力は xyz のすべての座標に適用されます。
0 に近い値は、セルが占有されておらず障害物がない確かさを表します。
拡張機能
バージョン履歴
R2019b で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- 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)