Mixed Reality空間資料封裝工具檔

注意

已淘汰

自 2020 年 8 月 1 日起,此工具現在已被取代,且不再可在任何平臺上運作。 建議您改用 Device Portal 中的 地圖管理員 工具。

此工具及其作業依原樣提供。 它可能不需任何通知而變更,而且可能與未來的 Windows 或Windows Mixed Reality HMD 版本不相容。

下載

在這裡下載 MixedRealitySpatialDataPackager

裝置支援

功能 HoloLens (第 1 代) HoloLens 2 沉浸式頭戴裝置
Mixed Reality Spatial Data Packager ✔️

快速入門

Mixed Reality空間資料封裝工具會透過兩個步驟匯出和匯入程式,將目標應用程式的空間資料從一部電腦複製到另一部電腦。 此工具必須以系統管理員許可權執行,並在匯入時刪除現有的空間資料。 匯出會讓現有的空間資料保持不變。

主要需求和限制:

  1. 工具必須以系統管理員許可權執行
  2. 如果執行此工具之後,Mixed Reality入口網站不穩定,您可能需要重新開機電腦
  3. 遇到空間資料版本不符或不相容時,工具不會執行
  4. 工具會在匯入時清除現有的空間資料
  5. 如果匯入程式無法還原先前的資料,除非先前匯出已備份資料
  6. 空間地圖資料的「唯讀」模式的匯入功能品質

對應最佳做法

  1. 從主控台 (設定清除現有的對應 - > Mixed Reality - 環境 - >> 清除環境資料)
  2. 確定有足夠的光源可進行良好追蹤,而且如果執行鎖定的地圖模式嘗試維持相同的光源
  3. 盡可能讓光源動態範圍保持低,方法是避免深色陰影區域旁的高光線區域
  4. 最小化空白、無紋理表面,例如在白色牆上放置一系列不同的海報
  5. 對應場景中沒有動態物件的空間,例如移動人員
  6. 鎖定可透過 Insider Preview) 取得的匯入 (對應
  7. 在追蹤品質降低和/或環境中發生變更時,解除鎖定地圖並重新掃描環境 (光源或物件配置變更)

使用隨附腳本執行Mixed Reality空間資料封裝器

我們已提供MRSpatialPackagerHelperScript.ps1,以執行工具的對應封裝器。

腳本參數定義如下:

-AppName <String>
    On export: The spatial anchors from the app of interest
    On import: The target app that spatial anchors should be imported for
    Returns a list of apps containing the input string if a unique app is not found

-UserName <String>
    Target username, will return a list of users if a unique match is not found

-Mode <String>
    import or export

-MapxPath <String>
    On export: Directory to export your mapx files
    On import: Directory where import mapx are stored

-LockMap <Int32>
    0 to unlock map
    1 to lock map

-BinPath <String>
    Path to MixedRealitySpatialDataPackager.exe, default value is current directory

Powershell 腳本範例使用方式和輸出

.\MRSpatialPackagerHelperScript.ps1 -AppName holoshell -UserName Administrator -Mode export -MapxPath D:\temp\ -LockMap 0

Package Family Name for holoshell: HoloShell_cw5n1h2txyewy
User SID for Administrator: S-1-5-21-1279937937-3984375698-1043392598-499
Lock map value successfully set to 0

Running: C:\bin\MixedRealitySpatialDataPackager.exe export D:\temp\ HoloShell_cw5n1h2txyewy S-1-5-21-1279937937-3984375698-1043392598-499

Attempting to disable Windows MR driver
Driver disabled
Validating spatial data version information...
Device spatial data version OK
External spatial data version OK
Importing spatial anchors for user account phguan
Stopping SPECTRUM
Stopped SPECTRUM
Stopping SHAREDREALITYSVC
Stopped SHAREDREALITYSVC
Space ID is {00000000-4321-0000-0000-000000000000}
SUCCESS: Unpacked Space from D:\temp\map\het.mapx to
C:\ProgramData\WindowsHolographicDevices\SpatialStore\HoloLensSensors\{00000000-4321-0000-0000-000000000000}\
Space ID is {78FA06B5-4416-4815-BB00-B3CB5C983B7D}
SUCCESS: Unpacked Space from D:\temp\map\sa.mapx to
C:\ProgramData\Microsoft\Spectrum\PersistedSpatialAnchors\
Attempting to enable Windows MR driver
Driver enabled
Starting SHAREDREALITYSVC
Started SHAREDREALITYSVC
Starting SPECTRUM
Started SPECTRUM
IMPORT SUCCESS

如何使用 MixedRealitySpatialDataPackager.exe 匯出

MixedRealitySpatialDataPackager.exe export <folderpath to mapx files> <source package family name>    

從裝置匯出對應會產生兩個 mapx 檔案:het.mapx 和 sa.mapx。 在匯出程式期間,除了指定的應用程式和使用者建立的界限之外,會移除所有空間錨點,如果存在) ,則會 (。 來源套件系列名稱必須符合現有的已安裝應用程式,否則 exe 將會失敗。

如何使用 MixedRealitySpatialDataPackager.exe 匯入

MixedRealitySpatialDataPackager.exe import <folderpath to mapx files> <target package family name> <user SID>

匯入會刪除現有的空間資料,並將它取代為指定目錄中的資料。 應用程式名稱輸入會指定應該匯入空間錨點之目標應用程式的套件名稱,而目標使用者 SID 會指定應該可以存取匯入空間錨點的使用者。 目標套件系列名稱和使用者 SID 必須符合電腦上的現有值,否則 exe 將會失敗。


錯誤訊息

此外,下列錯誤訊息也會伴隨 HRESULT

如果發生錯誤不正確引數

Invalid command line parameters

如果可執行檔未以系統管理員模式執行

1. Unable to determine elevation privileges 
2. Please run with administrator privileges 

如果啟用或停用驅動程式時發生錯誤

1. Could not find the specified driver with class GUID {d612553d-06b1-49ca-8938-e39ef80eb16f}
2. Could not find the device instance ID for specified driver with class GUID {d612553d-06b1-49ca-8938-e39ef80eb16f}
3. Could not find the specified driver with device instance ID <INSTANCE ID>
4. Failed to enable/disable driver

如果驗證空間資料庫版本時發生錯誤

1. Could not read database version
2. This tool is not compatible with the current driver version of Windows Mixed Reality and/or the spatial data provided to replace the existing spatial data is an invalid version.
3. No spatial data is present on the current device please connect your Mixed Reality device to initialize spatial data. If the problem persists please restart your PC.

如果驗證提供給目標匯入/匯出應用程式的套件系列名稱時發生錯誤

The package family name does not correspond to an installed app

如果驗證使用者 SID 時發生錯誤

Failed to find local user for passed in user SID
1. Folder path to space store files doesn't exist 
2. het.mapx or sa.mapx file doesn't exist in <PATH> for import
3. Unable to create directory at <PATH> for export
1. Unable to open service manager <SERVICE>
2. Timed out trying to start/stop <SERVICE>