microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

Spatial mapping stopped working #308

Closed kaiomagalhaes closed 7 years ago

kaiomagalhaes commented 7 years ago

I'm using the latest version of holotoolkit, the spatial mapping worked for some days but suddenly it stoped. Now when I go to the device portal it says 'Failed to get surfaces' and everything works fine in unity. Any ideas?

StephenHodgson commented 7 years ago

What version of Unity are you using?

kaiomagalhaes commented 7 years ago

5.4.0f3-HTP

StephenHodgson commented 7 years ago

But you said it's not getting data from the device portal. Sounds like it might be hardware related, do you have another device to test on?

Have you tried the device recovery tool?

kaiomagalhaes commented 7 years ago

I'm running the Planetarium example just to make sure, because it was working just fine. See the logs below

https://gist.github.com/kaiomagalhaes/45d2e052f3806be8bafc2b0d1ee8f908

kaiomagalhaes commented 7 years ago

@HodgsonSDAS My partner is facing the same problem in his computer. Now I'm going to format my windows just to make sure

StephenHodgson commented 7 years ago

If it's happening on multiple devices, then it might be software related.

Please in the future, upload your log file and not post it directly in the thread. It's hard to read that way.

kaiomagalhaes commented 7 years ago

@HodgsonSDAS alright, edited my message with a gist link, hope it helps.

StephenHodgson commented 7 years ago

Yeah we've made some changes to the spatial mapping components over the last week to get it to work in the emulator and while using the Holographic Remoting feature. It's possible something could have broken.

@kaiomagalhaes Could you make a sample scene that can reproduce this for us? Or just write down the steps involved?

@darax Any thoughts on this?

kaiomagalhaes commented 7 years ago

The spatial processing test scene isn't working anymore, so it may be a good start.

StephenHodgson commented 7 years ago

Okay, give me a few minutes to test this out on my end.

StephenHodgson commented 7 years ago

Confirmed. Spatial Mapping broken in the SpatialProcessing.unity test scene. The thread has exited with code 0 (0x0).

kaiomagalhaes commented 7 years ago

Any ideas about when it will be fixed? My company has a product which is based on spatial mapping and we can't do a demo until it is fixed.

NeerajW commented 7 years ago

@kaiomagalhaes and @HodgsonSDAS @darax and I just verified the SpatialProcessing scene on Unity 5.5 b7 and Unity 5.4 f3 and it worked both in editor and on HoloLens. We debugged the scene and saw no error messages or incorrect stacks. Spatial Mapping rendered well and generated planes after say 30 seconds correctly. Starting the observer.

(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)

Setting up 1 worker threads for Enlighten.

Thread -> id: e24 -> priority: 1

Stopping the observer.

(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)

Finished making planes.

(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)

Finished removing vertices.

(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)

  1. What is the error stack you see?
  2. What device build are you on?
  3. Can you ensure you have SpatialPerception enabled in your Unity app and generated VS solution?
kaiomagalhaes commented 7 years ago

@NeerajW

1 -

Starting the observer.

(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)

The thread 0xb2c has exited with code 0 (0x0).
The thread 0x2c8 has exited with code 0 (0x0).
Stopping the observer.

(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)

Finished making planes.

(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)

Starting the observer.

(Filename: C:\buildslave\unity\build\artifacts/generated/Metro/runtime/UnityEngineDebugBindings.gen.cpp Line: 45)

The thread 0x608 has exited with code 0 (0x0).
Stopping the observer.

As you can see it starts and stops the observer a lot of times, in my gist above you can see its full version.

2 - I'm on my notebook and my partner in a PC

3 - Yes, the spatial perception is enabled in my unit app, but not sure how I could ensure it in the generated VS solution

kaiomagalhaes commented 7 years ago

@NeerajW

@HodgsonSDAS also faced the exactly same issue that I did

keveleigh commented 7 years ago

@kaiomagalhaes To check if Spatial Perception is enabled in the generated VS solution, right click on Package.appxmanifest in the Solution Explorer in VS, click View Code, and see if <uap2:Capability Name="spatialPerception" /> is under <Capabilities>

darax commented 7 years ago

Have you tried a release build instead of a debug build?

kaiomagalhaes commented 7 years ago

Thanks @keveleigh, I'm going to try it today.

@darax I have tried in release, master and debug.

I've formatted my machine today just to make sure and I'm going to check the spatialPerception in the appxmanifest later today.

darax commented 7 years ago

okay, I just tried in debug, on my PC, and it worked. Do make sure that you've pulled the latest HoloToolkit. Without my changes I would have seen what you did in the log you posted.

kaiomagalhaes commented 7 years ago

Hey guys, I updated my computer and as the 5.4.0f3-HTP wasn't available to download (broken link) I downloaded the 5.5.0b9 and it worked just fine for debug. When I try "master" it doesn't work, same happen if I build it for the device and upload it in the emulator.

Still facing the problem =/

StephenHodgson commented 7 years ago

@darax @NeerajW @keveleigh Yes the capabilities were enabled for Spatial Perception. Latest HoloToolkit Editor: Unity 5.4.0f3-HTP Build: x86 Release Windows Holographic OS: 10.0.14393.321 Firmware revision 005.05.P.1606291233R Error codes in this file

StephenHodgson commented 7 years ago

I was able to narrow it down I think. If you already have a good portion of the room mapped then it works fine, but when you move to map a new surface is when the errors occur.

The spatial mesh is replaced by a bunch of white boxes that approximately represents the surface area.

kaiomagalhaes commented 7 years ago

Update:

With the version 5.5.0b9 it worked but seems that there are a few weird things, like I wasn't able to generate the build in the toolkit and go run as master because there were a dll missing, then I generated it in the File>Build Settings > Build and after it I could generate in the toolkit just fine. With it, it worked in debug, master and with the released app. For some reason,my 3D view says that the device is not connected, but I don't know if it is related.

Also with the 5.5.0b9 it worked with my friend as well, so it is no an isolated case.

darax commented 7 years ago

@HodgsonSDAS that's what the processing scene is supposed to do.

@kaiomagalhaes it sounds like you are unblocked. Am I wrong?

StephenHodgson commented 7 years ago

Ah okay, well I'm still getting the The thread has exited with code 0 (0x0).

When it get's thrown the main thread hangs and it acts like the tracking was lost.

kaiomagalhaes commented 7 years ago

Yes @darax I'm unblocked.

StephenHodgson commented 7 years ago

So the spatial perception is only working for the 5.5 beta?

kaiomagalhaes commented 7 years ago

@HodgsonSDAS it is the conclusion I came through.

darax commented 7 years ago

It's working in 5.4 for Neeraj and me.

The thread exited message is likely a red herring. I see those all the time.

StephenHodgson commented 7 years ago

So I tested my own scenes and it's working fine.

I think the thing that threw me off was the error codes and seeing white all the sudden. Seemed like it just showed the tracking lost but if the white planes are intended then I guess it's working haha. Seeing all that white made me think it crashed.

darax commented 7 years ago

okay, I'll cancel the apt with my therapist. :)

StephenHodgson commented 7 years ago

It's hard to work remotely like this sometimes 😆