#🧐-ar-simulation-help

https://github.com/needle-tools/ar-simulation#troubleshooting-%EF%B8%8F

I

Anyone else have issues with the plane manager? This is an AR Foundations problems where the planes end up stacking on top of eachother the longer it runs. Here i am running the "RayCast Planes" scene from the examples files, but i get the same behavior in other projects like ar-foundation-samples. Both in simulator and on device

marwi123

Hey, try increase the sample count to 4 or 5 on the Simulated AR Plane Generation script.

(sample count means: how many points on a plane need to be detected to emit a new AR plane, so it is less likely to find these planes with weird slopes (like in your image) because one point hit a the side of an object and two other hit the ground)

marwi123

I havent used vuforia in years, they seem to support AR Foundation now but I havent tried that yet. If you only need plane detection you can also just use AR Foundation + Plane Manager. But it depends on your app I guess (and if vuforia does make specific things easier for you)

marwi123

That being said: ARSim is for editor simulation only, so it will help you to develop your app but not run on device πŸ™‚

_debbiedowner

Hi everyone. I appear to be blind - is there still an evaluation package available? I'm torn between this asset and the AR Remote.

hybridherbst

Hi! Also please note that AR Simulation and AR Remote serve kind of different use cases - ours adds AR capabilities to the editor so you can simulate how a device will behave, the Remote requires you to pick up your physical device and find a spot where you can test the thing you're testing, etc

_debbiedowner

I know and that's why I am leaning towards your asset but still would love to have a look at it first πŸ˜„

hybridherbst

Haha, totally understood, that's why we have the eval version! Both are useful in specific situations (and they should even work together).

S

Hi, I'd managed to install ARSim in a project last week, allowing me to run the provided examples and also run in my own image tracking scene. I've pulled that content into a new project and now get the following errors, stopping the same scenes from working. I've removed and re-imported the the plugin so hoping I've just missed a setting somewhere. The 'no available subsystem' warning is something I'd normally expect without the plugin installed. "Call to StopSubsystems without an initialized manager.Please make sure wait for initialization to complete before calling this API. UnityEngine.XR.Management.XRManagerSettings:OnDisable ()" & "No active UnityEngine.XR.ARSubsystems.XRCameraSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings."

marwi123

Did you enable AR simulation in Edit/project settings/XR-plugin-management? (There is a tab on the right side with a checkbox at ARSimulation that should be ticked)

S

Ah ok, it's working now, thanks. However, unchecking it then rechecking in my original project has broken that one πŸ™‚ Main thing is getting it working for the latest project.

S

For the example scenes. It was odd because it was working in my own image tracking scene but no longer does.

S

Can I ask how you created the Cylinder.arobject in the object tracking example ... if there's an app available for simple scans? I've seen a few in the app store but the export file extensions appear to be different. Thanks

S

Hi, I have a working image tracking scene in Unity but if I start from a different scene then load in the image tracking one it doesn't instantiate the tracked image prefab (a tracking plane is visible). I've tried combinations of all the options in the project settings for AR Sim. Is there a recommended way to ensure that the sim plugin isn't doing anything as an app launches then initialize it on entering a scene with an AR feature? Thanks. Also, regardless of the scene I start on, I see "Call to StopSubsystems without an initialized manager" warnings and "No active UnityEngine.XR.XRInputSubsystem is available".

S

Yes, scene works ok playing in editor directly. I have a splash and menu scene though. Starting there then loading the image tracking scene, it doesn't instantiate the prefab.

S

Not sure if it's possible but I'd like to have no functionality from the plugin as the editor starts the app ... I'd initialize it as the AR scene loads.

marwi123

The plugin should do nothing on its own if no AR components are active and you dont start the subsystems. Do you think you could send me a small repro? Otherwise ill see if i can repro later myself.

S

Point Cloud is included but I'm not using it directly. (It's often included in examples but I've not determined whether it's used by the other components or simply there as another representation of information being gathered in the scene).

marwi123

Its not necessary if youre not using any points clouds :) Can you try if disabling the SimulatedTrackedImage component helps (and then enable it at runtime once the scene has loaded)?

S

I think it's because I'm additively loading scenes. Instances of the Sim components are normally loaded into the same scene but in my project they're loaded into the base scene (where ui for all scenes is managed).

S

For some reason the Simulated instance for tracked images isn't created as a result (when starting from another scene). Adding the SimulatedTrackedImage component to the image tracking scene beforehand results in errors where it can't find the image library reference.

S

This setup works ok on device ... the issue just relates to running in editor. It's probably an unusual setup for the plugin so no worries.

marwi123

Ah so your simulation components are in another scene? Are those created at runtime?

S

I'll try including all those generated components in the image tracking scene and disable the auto settings in the AR Simulation project settings. (Also, they're not removed when unloading the TrackImage scene ... that doesn't appear to cause a problem though.)

marwi123

Should definitely work, but if there are no subsystems and no ar foundation managers the simulated components will have no effect right now (they register in OnEnable to the plugin subsystems if they exist) - I try to reproduce later/tomorrow and see how to improve that :)

marwi123

Any chance that you also get this warning when loading the tracking scene?:

Image TrackedImageExample not found in reference library
UnityEngine.Debug:LogWarning (object,UnityEngine.Object)
Needle.XR.ARSimulation.ARSimulationImageTrackingProvider/ARSimulationProvider:GetChanges (UnityEngine.XR.ARSubsystems.XRTrackedImage,Unity.Collections.Allocator) (at C:/git/npm/development/ar-simulation/package/Runtime/ARSimulationImageTrackingSubsystem.cs:190)
UnityEngine.XR.ARFoundation.ARTrackableManager`5<UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem, UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystemDescriptor, UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem/Provider, UnityEngine.XR.ARSubsystems.XRTrackedImage, UnityEngine.XR.ARFoundation.ARTrackedImage>:Update () (at Library/PackageCache/[email protected]/Runtime/AR/ARTrackableManager.cs:187)
S

Yeah, if I add the components into the image tracking scene instead of letting them be generated automatically, the library object doesn't find the registered reference library images.

marwi123

Ok so the reason is: xr subsystems are started before the ARImageManager can be found when using LoadScene (via FindObject or Resources) and currently we only add images at start to the library that are actually used (so it matches what you would get on device). But when starting the scene directly the TrackedImageManager CAN be found and thus it works there. Not sure why that is different...

marwi123

but when I remove those checks (only add the library that is actually assigned) then it works with loading the scene too...

marwi123

<@!814264061620781077> I published a new version as 1.3.1. Please let me know if the fix works for you

S

Hi Marcel, fantastic, thanks! That's it's working, starting from the non-AR scene. πŸ‘

marwi123

Leaving a review (if you haven't already^^) would be highly appreciated of course πŸ™‚

robicop

Hey, I just bought the asset and have some troubles, I have unity 2021.2.0f1, arFoundation 4.1.7, arSimulation 1.3.1 I'm folowing the slow start, when I open the Menu scene I have some enabled buttons, and clicking Simple AR bring a black scene with the following warnings :

Call to StopSubsystems without an initialized manager.Please make sure wait for initialization to complete before calling this API.

Call to StopSubsystems without an initialized manager.Please make sure wait for initialization to complete before calling this API.

No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

No active UnityEngine.XR.XRInputSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

No active UnityEngine.XR.ARSubsystems.XRCameraSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

No active UnityEngine.XR.ARSubsystems.XROcclusionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

No active UnityEngine.XR.ARSubsystems.XRDepthSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

No active UnityEngine.XR.ARSubsystems.XRPlaneSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

No active UnityEngine.XR.ARSubsystems.XRRaycastSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

marwi123

Did you enable AR simulation in Edit/project settings/XR-plugin-management? (There is a tab on the right side with a checkbox at ARSimulation that should be ticked)

hybridherbst

Would you mind clarifying which version of Unity you're using? There's no 2021.2.0f1 yet

marwi123

I think the method is not used by default so it might just be a reflection error but not affect anything else

pzhine

Any tips on how to mock ARKitSessionSubsystem.GetARWorldMapAsync and ARKitSessionSubsystem.ApplyWorldMap using AR Simulation?

pzhine

I guess another way to ask this is: Is there a way to save and restore the ARSession in the AR Simulation plugin?

marwi123

We currently dont support the AR world api calls.

How/What exactly would you need to save and restore? You could save/restore the state of the simulation components

pzhine

Yes, essentially I need to restore the anchors. So, yes, I could just save/restore the simulation Anchor objects by wrapping the ARKitSessionSubsystem in an abstraction layer.

marwi123

if you wrap the arkit subsystem it would change nothing in editor because in editor you're using the ARSimulationSessionSubsystem and anchors are stored in the AnchorsSubsystem if I'm not mistaken.

pzhine

Maybe "wrap" is the wrong term. I just mean that when I want to save my WorldMap, I'll call WorldMapProvider.GetWorldMapAsync, which internally will call ARKitSessionSubsystem.GetARWorldMapAsync on the device but in the Editor will generate some serializable data that represents the current state of all of the anchors.

mryasaremir

Hello I downloaded it from git I'm new with ar development actually I dont understand how it works

marwi123

Which Unity version do you have and which arfoundation version?

What errors do you get? Currently on mobile, cant read the screenshot unfortunately

mryasaremir

version is 2019.4.3.1 and sorry it was my mistake. I created a project with ar template and deleted packages after reinstall its giving error. I recreated empty project and just include necessary packages it worked