Unable to create a RuntimeReferenceLibrary with AR Foundation in Unity - c#

I'm trying to create a simple app for Android that recognizes images using AR Foundation in Unity. Using the normal ReferenceLibrary and filling it within the editor works perfectly without any issues. The reason I want to use the RuntimeLibrary is to be able to fill it up using an api.
I've tried everything on the documentation as shown here:
https://docs.unity3d.com/Packages/com.unity.xr.arfoundation#4.1/manual/tracked-image-manager.html
I'm using AR Foundation 4.1.9 and Unity LTS 2021.
The problem is that when debugging (using LogCat or a serialized text field on the canvas) I do get a message saying the image is being added but when running the app it can't find it and instantiate a prefab on it.
Also have tried looking it up on the AR Foundation fora but no luck either.
Does anyone else have this issue or a solution for this strange behaviour?

Related

Unity 3D freezing after leaving Game Mode (MRTK)

I've been working in a project some weeks now in a Mixed Reality project using Unity and MRTK and I've found a strange behaviour when adding screen capture to the application. I'm using Unity 2019.4.26f1, and I haven't found any issues so far but after adding this line of code
ScreenCapture.CaptureScreenshot("test.png");
into a script, I've realised that when I press Play and go into Game mode, everything goes correctly (the game starts, the screenshot is taken). BUT when I stop it and try to go into Play mode again, Unity freezes. If I don't press Play again, Unity still works until it tries to compile scripts or some heavy task like that, when it freezes and can only be closed with the task manager.
If I remove that line, Unity goes back to normal.
This issue cannot be reproduced in Unity 2020.3 LTS. Does this happen when the remoting play or in Editor? According to Choosing a Unity version and XR plugin - Mixed Reality | Microsoft Docs, if you target to HoloLens 2, please upgrade to the recommended 2020.3 LTS version that is stated in the document.
In addition, ScreenCapture is a Unity built-in class and if there are any usage questions, you may find support from Unity forum.

Importing 3D model in Xamarin.iOS

I'm working on a Xamarin.ios app that requires a 3d model to be displayed throughout the app's runtime.
I'm hosting the model online, but it's not responding when I call it using its URI. I tried hosting it on Google Drive and glitch, but it still wouldn't let me use it.
Is there a method to bundle the model in the app and try to implement it? I know it can be done in Swift with NSBundle, but I'm using Xamarin in C#.

JsonConvert.SerializeObject always return {} in XamarinForms

JsonConvert.SerializeObject seems to be not working in xamarin forms. Or i might be missing something here. Here is the output when i serialize a simple object.
See it returns {}. I tried serializing a class also and it did return the same.
What could be the problem here?
UPDATE
Still no solution to this issue. I tried creating a simple console application and serializeObject is working on that project so i assume it is not working in xamarin forms only. Does anybody have a xamarin forms project where JSON.NET's serializeobject is working?
I am using visual studio 2017, json.net 10.0.3 and live player.
This is a known problem see https://developer.xamarin.com/guides/cross-platform/live/limitations/
Limited support for reflection (currently affects some popular NuGets, like SQLite and Json.NET). Other NuGets are still supported.
If you compile it to an APK it works fine on the actual device.
Also posted an issue here: https://github.com/JamesNK/Newtonsoft.Json/issues/1578
I tried setting up emulator on a fast machine and the serialize works! So it means it doesn't work when i run it on live player using my android phone. I will set this as an answer for now. if someone else posted on how to make it work on live player, i will set it as the correct answer

Getting list of current area descriptions from tango api DLL through Unity

We are working on a project using tango and VR, and i got to the point of wanting to test to implement it into our app. our app is using both tango and vr in combination, and thus we have both the tango VR sdk and the google VR sdk in out project. We are using the latest verstion of uinty, gvr gvr 1.1 and tango sdk Caporales.
Just for the record we are working in unity and have had a great deal of problems so far, the combination of googlevr and tango sdks seems to do something to each other and cause a lot of issues... We've tried to use different unity versions and different versions of both sdks and found out that a project with both tango and vr sdks can only run if we disable the Tango UX component in the tango manager prefab. I'm not sure what that does exactly but if it is enbaled the app just crashes on launch.
Anyway the problem at hand is that i'm trying to anable the area learning features. I am using the TangoAreaDescriptionmanager scene from the example and the code that goes with it. I've isolated the issue to occur in the AreaDescriptionAPI class (line 800 or there about in the AreaDescription file) in the method called TangoService_getAreaDescriptionUUIDList. As soon as that method is called from the _GetUUIDList method in the same file the code does not execute furter. mind you that the app does not crash but nothing happens, so there is some error that happens in the external library that i am not albe to figure out.
Does someone have some information on this?
I'll happlily supply more information if needed.
EDIT: I looked at the logcat from my device and found that the problem maybe is something else... pastebin.com/53Htz9YQ here is the file with relevant logs. It seems to be that the TANGO_CLIENT_API is not being loaded correctly...
The application needs to have the ADF_LOAD_SAVE_PERMISSION for this call to work. Same thing for the actual loading or saving of a learned area.
Be sure to review this part of the doc: Tango Permissions and Lifecycle in Unity, and especially the "Manually request permissions and connect (Area Learning)" as the workflow is special to handle this permission.

How to get the AR example running for Unity using Google's tango example

So I am starting out to do some projects in Tango using Unity. I cloned the examples from their github (https://github.com/googlesamples/tango-examples-unity) and tried running their Experimental Augmented Reality example. So I figured out how to attach the scripts to their respective game modules.
However, everytime I try to run the program, in the ARScreen.cs script this line m_textures = m_tangoApplication.GetVideoOverlayTextureYUV(); always returns null. So I combed through google's documentation to see what causes it to return null but I could not find anything on it. Is there anyone that successfully ran the Experimental Augmented Reality example that can shed some light on this?
I just verified that my Experimental Augmented Reality example works fine.
It looks like project tango has made a new release called "release-weyl" on sept 15th. I'm not sure if there is a mandatory firmware update for this new release.
I'm using previous version release-vonmises. Just try this release. It might just work.

Categories

Resources