MixedRealityCompanionKit icon indicating copy to clipboard operation
MixedRealityCompanionKit copied to clipboard

Holograms sticking to camera

Open voonfoo opened this issue 7 years ago • 18 comments

Hi, can u please guide me on how to use the SV on UNET network stack? I am having the same problem over and over again and it seems i cant get out of it for the issue of holograms sticking to camera. Please guide me on how to use SV with UNET network stack. Thank you :)

Unity version 5.6.2f1 The sample scene works for connecting

voonfoo avatar Nov 28 '17 23:11 voonfoo

I have the same problem too. Anyone please guide me through this it is so tough. Everything works but the holograms are just sticking to the camera :( Help :(

mengruoshan avatar Nov 29 '17 02:11 mengruoshan

What do you mean by "The sample scene works for connecting"?

When you launch the application on the spectator view HoloLens, do you see a new SV_Player prefab instance under the UNetAnchorRoot in your Hierarchy?

You should also see a SpectatorView prefab instance under the UNetAnchorRoot.

If you look through the spectator view HoloLens after launching the application, has it joined a session?

It sounds like Unity is not detecting the spectator view HoloLens.

Please ensure the following:

  1. Your SpectatorViewManager prefab has a correct Spectator View ID (name or IP of the spectator view HoloLens)
  2. SpectatorViewManager's Server ID is either "editor" or a valid IP of a device running the app on your network.
  3. Your firewall is not blocking incoming UDP traffic. Navigate to "Control Panel\System and Security\Windows Defender Firewall", select "Advanced Settings", select "Inbound Rules", Find all instance of the Unity you are using (and any older instances of Unity that reference the same "Program" path) and double click on them. Select "Allow the Connection" under the "General" tab and "Domain", "Private", and "Public" under the "Advanced" tab.
  4. Your network is not blocking UDP broadcast packets. Many corporate wireless networks do, so you will need to use a separate router in that case.
  5. If you run the application on your spectator view HoloLens under a debugger, do you have any debug spew?

fieldsJacksonG avatar Nov 30 '17 00:11 fieldsJacksonG

I do see the two SV_Player (Clone) and Spectator View under UNETAnchorRoot after i open the app for the spectator view hololens. However, when i tried to move the spectator view hololens and the camera, both SV_Player (Clone)'s transform did not change. Is that supposed to happen?

voonfoo avatar Nov 30 '17 00:11 voonfoo

The transform on both of those prefabs should change when you move the camera around.

Please see if you have any debug spew in the app running on your spectator view HoloLens. This will help to see if your application is blocked anywhere.

fieldsJacksonG avatar Nov 30 '17 00:11 fieldsJacksonG

Okay. May i know how do i check for any debug spew? Sorry i am just a newbie in this :(

voonfoo avatar Nov 30 '17 01:11 voonfoo

When you built your UWP application in Unity, it created a Visual Studio solution. Run that solution with "F5" against "Device" (if you are connected over USB) or "Remote Machine" to the spectator view HoloLens' IP.

On the bottom of your Visual Studio sln, you should have an "Output" window. Keep an eye on that while the application is running to see if it is printing anything useful.

fieldsJacksonG avatar Nov 30 '17 01:11 fieldsJacksonG

Hi, i have checked the debug spew and nothing is blocking the app. i have also closed all my firewall. Is there any more ip settings needed other than spectator view manager? For example, HTK network manager? Do we need to use that?

voonfoo avatar Nov 30 '17 01:11 voonfoo

Can you copy the debug output? You should ensure that an anchor has been created (no pose data can be transferred if not!)

Is this on the sample application or your own application? You should have a UNETSharingStage and a UNetAnchorRoot in your project. Nothing should need to be changed in the UNETSharingStage.

fieldsJacksonG avatar Nov 30 '17 01:11 fieldsJacksonG

remote player, analyzing start state UnityEngine.Debug:Log(Object) SpectatorView.PlayerController:Start() (at Assets/Addons/HolographicCameraRig/SV_UNET/Scripts/PlayerController.cs:419)

AnchorEstablished for HoloLens-BIF3N was True is now True UnityEngine.Debug:LogFormat(String, Object[]) SpectatorView.PlayerController:AnchorEstablishedChanged(Boolean) (at Assets/Addons/HolographicCameraRig/SV_UNET/Scripts/PlayerController.cs:141) SpectatorView.PlayerController:set_NetworkAnchorEstablished(Boolean) SpectatorView.PlayerController:CmdSendAnchorEstablished(Boolean) (at Assets/Addons/HolographicCameraRig/SV_UNET/Scripts/PlayerController.cs:131) SpectatorView.PlayerController:InvokeCmdCmdSendAnchorEstablished(NetworkBehaviour, NetworkReader) UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()

remote device likes the anchor UnityEngine.Debug:Log(Object) SpectatorView.PlayerController:CmdSendAnchorEstablished(Boolean) (at Assets/Addons/HolographicCameraRig/SV_UNET/Scripts/PlayerController.cs:134) SpectatorView.PlayerController:InvokeCmdCmdSendAnchorEstablished(NetworkBehaviour, NetworkReader) UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()

Setting saved anchor to bfb4d596-937b-4622-8f85-4c3e7dd67fde UnityEngine.Debug:Log(Object) SpectatorView.UNetAnchorManager:AnchorFoundRemotely() (at Assets/Addons/HolographicCameraRig/SV_UNET/Scripts/UNetAnchorManager.cs:436) SpectatorView.PlayerController:CmdSendAnchorEstablished(Boolean) (at Assets/Addons/HolographicCameraRig/SV_UNET/Scripts/PlayerController.cs:135) SpectatorView.PlayerController:InvokeCmdCmdSendAnchorEstablished(NetworkBehaviour, NetworkReader) UnityEngine.Networking.NetworkIdentity:UNetStaticUpdate()

It is my own application. I do have a UNETSharingStage and UNETAnchorRoot in my project.

voonfoo avatar Nov 30 '17 01:11 voonfoo

We do have an anchor, that's good!

In your Unity project, after you press "Play", do you have any errors in your Unity output?

fieldsJacksonG avatar Nov 30 '17 01:11 fieldsJacksonG

There are no errors but two warnings that look like this.

DontDestroyOnLoad only work for root GameObjects or components on root GameObjects. UnityEngine.Networking.NetworkManager:Awake()

DontDestroyOnLoad only work for root GameObjects or components on root GameObjects. UnityEngine.Networking.NetworkDiscovery:StartAsServer() SpectatorView.NetworkDiscoveryWithAnchors:StartHosting(String) (at Assets/Addons/HolographicCameraRig/SV_UNET/Scripts/NetworkDiscoveryWithAnchors.cs:259) SpectatorView.SpectatorViewManager:Update() (at Assets/Addons/HolographicCameraRig/Scripts/SpectatorViewManager.cs:314)

voonfoo avatar Nov 30 '17 01:11 voonfoo

Did you launch the spectator view compositor in Unity (SpectatorView tab, select "Compositor") Do you have active color frames in the compositor?

You may not get poses until you have valid color frames.

fieldsJacksonG avatar Nov 30 '17 02:11 fieldsJacksonG

Yes i did launch compositor. I have tried the older version of spectator view which is using the sharing service and it worked perfectly. However, changing to UNET network stack, the spectator view camera transform just doesnt seems to change when i moved the camera :(

voonfoo avatar Nov 30 '17 02:11 voonfoo

This is the block of code that sets the transform of your spectator view prefabs: https://github.com/Microsoft/MixedRealityCompanionKit/blob/master/SpectatorView/Samples/SharedHolograms/Assets/Addons/HolographicCameraRig/Scripts/SpectatorViewManager.cs#L246

It will block on having a valid color frame, so make sure your camera is connected and on.

You can also put a breakpoint in here to see if anything is being skipped, and see if currPos and currRot have valid data.

fieldsJacksonG avatar Nov 30 '17 02:11 fieldsJacksonG

Just saw your last post. We need to make sure the SpectatorViewManager is a child of the SpectatorView prefab at runtime and the code that I linked above is hit.

If SpectatorViewManager is not a child of SpectatorView, you will need to ensure that this line was called: https://github.com/Microsoft/MixedRealityCompanionKit/blob/b8f8cf836370895f7915a7a8b459ee71ade3913a/SpectatorView/Samples/SharedHolograms/Assets/Addons/HolographicCameraRig/SV_UNET/Scripts/PlayerController.cs#L392

fieldsJacksonG avatar Nov 30 '17 02:11 fieldsJacksonG

Hi, we tried to download another package and it worked perfectly!!! i think it might the addons problem. Thanks for the guide!!!

voonfoo avatar Nov 30 '17 03:11 voonfoo

Can we add custom rotation to the UNETSharedhologram script?

voonfoo avatar Nov 30 '17 10:11 voonfoo

voonfoo98, can you elaborate on what you mean by downloading another package? I am facing the same issue with the hologram "sticking" to the camera. Thanks!

KevGLewis avatar Mar 15 '18 19:03 KevGLewis