qian256 / HoloLensARToolKit

Marker tracking using the front-facing camera of HoloLens (both 1 and 2) and Unity, with a wrapper of ARToolKit built for UWP (Windows Universal Platform)
GNU Lesser General Public License v3.0
349 stars 92 forks source link

Unity 2020LTS does not build project #63

Closed ergo333 closed 3 years ago

ergo333 commented 3 years ago

Hi @qian256, I'm quite new with HoloLens and Unity developing. I am trying to create an application that uses some markers attached to a real robot. I necessarily need ROS integration with Unity 2020 LTS.

I tried starting from the tutorial scene ARToolkitSingle but Unity2020 is not able to build the project. The Log console provides the following error: "Assets\ARToolKitUWP\Scripts\ARUWPVideo.cs(723,20): error CS0103: The name 'WorldManager' does not exist in the current context".

I do not know how to fix this problem, has anyone solved it yet?

a-sinclaire commented 3 years ago

Hello! I was running into the same issue. It seems UnityEngine.XR.WSA.WorldManager.GetNativeISpatialCoordinateSystemPtr() is no longer supported.

I got around this by commenting out the trouble line and replacing it with this: worldOrigin = SpatialLocator.GetDefault().CreateStationaryFrameOfReferenceAtCurrentLocation().CoordinateSystem; It directly sets the worldOrigin rather than dealing with an IntPtr at all. This is where I found the snippet that gives the SpacialCoordinateSystem

ergo333 commented 3 years ago

Oh thank you @sLaderoute, very nice. I will try this modification!

soudehchegini commented 3 years ago

@sLaderoute when I make this change I can build and deploy. But once the program is running on hololens- I lose the virtual cube when i look at the printed cube marker. Did you encounter this?

a-sinclaire commented 3 years ago

@soudehchegini I honestly can't remember what I encountered as it was a few months ago since I've last worked with this. I believe I didn't end up using this package at all in my project. Sorry I couldn't be of more help! GL

shoukailiang commented 2 years ago

@sLaderoute when I make this change I can build and deploy. But once the program is running on hololens- I lose the virtual cube when i look at the printed cube marker. Did you encounter this?

Hello, @soudehchegini .Did you solve it .

soudehchegini commented 2 years ago

@sLaderoute thankyou for checkin in. This was a while ago now and Ive moved on from WorldLocking. However, I did run some WL programs so I must've found a way to make it work. I recall your suggestion above was very helpful. thankyou