1
votes

I need to connect an Android device to a Hololens for 'spectator' viewing as in the sample 'Build 2019 Demo' code. However when I launch the Android and Hololens builds and enter the Hololens IP address on the Android side, all I see is an 'ArUco' code. No video and no 3D content are visible on the android device.

I should add that I have painstakingly reviewed the sample project as compared to my project and cannot determine any relevant differences.

Naturally, I want to get past this screen-code, but I am also confused about where this ArUco code exists in the application flow as it isn't part of any scene (or flow)that I am aware of.

1

1 Answers

1
votes

The ArUco code is appearing in order to localize the two devices. If everything is compiled correctly, the HoloLens will start using its camera to detect the ArUco code. Once its detected, the ArUco code will be dismissed and content will be positioned correctly across the two devices. It may be that you are missing the OpenCV native plugins required for ArUco marker detection. Instructions on how to build those plugins can be found here. You specifically need an x86 version of SpectatorView.OpenCV.dll for ArUco detection to work on a HoloLens 1 device.

The Build2019 sample uses Azure Spatial Anchors compared to ArUco markers for localization. If you want to use Azure Spatial Anchors, you need to go to Spectator View -> Edit Settings and Add a SpatialAnchorsCoordinateLocalizationInitializer to the prefab. You also need to declare in the SpatialLocalizationInitializationSettings a Prioritized Initializer that references this SpatialAnchorsCoordinateLocalizationInitializer. This will cause the SpatialAnchorsCoordinateLocalizationInitializer to be used compared to the default ArUco localization initializer.

If you have set up these settings, it may be that the SpatialAnchorsLocalizer isn't registering as available on your Android or HoloLens device. You need to add the SPATIALALIGNMENT_ASA preprocessor directive to your Android and WSA Player Settings to get the SpatialAnchorsLocalizer to declare itself as supported.