Select to view content in your preferred language

Unity and ArcGIS Maps in Hololens2

112
3
Tuesday
BillWinston
Regular Contributor

I am trying to build upon the introductory Map Creator UI tutorial and deploy the project into a Hololens2 device.  I am adding the MRTK XR Rig and it is conflicting with the ArcGISCamera so that I am not able to see the map content in Play mode or when I build and deploy to the Hololens 2. 

Has anyone successfully configured a Unity project for Hololens 2 with MRTK3 and the ArcGIS SDK?  My goal is to build a scene that can be displayed as a table top view of a map scene that I can walk around.

0 Kudos
3 Replies
AShahbaz
Esri Contributor

You should remove the camera component from ArcGISCamera so that the XR rig camera is used for the rendering. However, ArcGISCamera is used for loading the map tiles, so you need to keep it in the scene and orient it toward the map. For a tabletop setup, this could be above the map, pointing downward (i.e., the ArcGISLocation component of ArcGISCamera has the same position as the map origin and a rotation of 0,0,0)

In case you didn't know, there is a a tabletop sample included in the plugin. I haven't tested this scene with a hololens but it could give you some clues about the camera setup and possible functionality for zooming and panning  

0 Kudos
AShahbaz
Esri Contributor

Something else, when you remove the Camera component from ArcGISCamera, the values for FoV and viewport under ArcGIS Camera component will likely fall back to 0, so make sure to set them to something meaningful (possibly those from the camera of the XR rig)

0 Kudos
BillWinston
Regular Contributor

Thanks, both comments have been helpful.  I reviewed the TableTop sample and added the TableTop Prefab into a scene with an MRTK XR Rig.  I have successfully deployed the app to my Hololens2 device.  See the attached image for my Hierarchy.

I do have a question about spatial referencing.  I cannot change WKID from 3857 in the ArcGIS Map component, it keeps returning to the default value of 3857...where is that stored and how can I change it?

I also noticed that position is set in several places:

  • TabletopMap Prefab- in the ArcGIS Tabletop Controller
  • ArcGISMap Prefab - in the ArcGIS Map component
  • ArcGISCamera - in the ArcGIS Location component

How do these positions interact?

0 Kudos