Start a new topic
Answered

Image tracking sample not working

Hi

I have downloaded and installed the SDK Snapdragon Spaces 0.12.1 for Unity.


(Also tried to use v 0.11.1)


The Image tracking sample does not detect any images. I have printed the pdf https://docs.spaces.qualcomm.com/static/spaces_town_a4.pdf as well as tried to display it on a computer monitor.


Debugging the code in the ImageTrackingSampleController I have discovered that :

 public override void OnEnable() {            

            base.OnEnable();

            arImageManager.trackedImagesChanged += OnTrackedImagesChanged;

            Debug.Log("Count: " + arImageManager.referenceLibrary.count);


Logged is "Count:  1" when starting the code in the Windows editor.

Logged is "Count: 0" when starting as an app on the ThninkReality A3 running on a Motorola edge 30 Pro.


Does anybody have some insight as to what the problem is?


When I deploy I get the following errors:

DeploymentOperationFailedException: No activity in the manifest with action MAIN and category LAUNCHER. Try launching the application manually on the device.

UnityException: Could not find any valid targets to launch on for Android


Launching the application manually works fine. Camera sample works. So camera permission should not be the problem.

With version 0.11.1 of the SDK the handtracking also workd. v 0.12.1 has the handtracking removed?


I have added an AndroidManifest.xml (See attached)


Thank you






Best Answer

Hi again Stefan,


I'm getting this log: "XRReferenceImage 'Spaces Town' has an invalid texture format (ASTC_6x6). Image targets must be set to RGB24 bit format." 

As the Format of the texture is set to automatic I would assume that your graphics settings for android are incompatible. Your player settings for texture compression format seem to match the default samples on a first glance. Did you modify something graphics related there? 


As a workaround I would suggest setting the format of tracked textures explicitly to RGB 24 bit which fixed the issue for me:





1 person has this question

Hi Stefan, 


there have been some changes to image and hand tracking with the latest release. 


Can you please check if your Snapdragon Spaces Services runtime is up to date on version 0.12.1 as well? 

Can you please test image tracking on the pre-built sample apk that is provided with the plugin? This should tell us if there is something wrong with the setup on your phone or your project.


Having an additional android manifest file is tricky since there is one autogenerated in the background that does not get merged well by Unity. This is required for launching your app as well as the companion controller. 

Do you have a specific reason to use an additional android manifest? 


Hand tracking has been marked deprecated in the latest release, but it should still continue to work for now. If you are using the QCHT package - we are aware of it not working in 0.12.1 and working on a solution. 


-Simon

Hi Simon 

Thank you for your response.

I have updated the Snapdragon Spaces Services runtime to 0.12.1.  (It was on the older 0.11.1 version)

I have installed the sample apk. The Image tracking works in this sample.


The sample that I built myself with Unity 2021.3.16f Image tracking does unfortunately still not work.

The XR Reference Image Library is somehow not included as the count property returns 0. In the Unity Editor it returns 1.


I have included a manifest in an attempt to stop the errors happening. Including or xxcluding them doesn 't seem to have any effect on these errors.(DeploymentOperationFailedException and UnityException)

Hi Stefan,


there is likely something going wrong in your project setup. Please make sure you followed the Unity Setup Guide correctly. 


If the issue persists please upload a sample project containing only the Assets, Packages and ProjectSettings folder and I'd be happy to take a look. 


The manifest should not be necessary. 

Hey,

I have a similar experience as Stefan with the image tracking. I’ve tested with version 0.11 and version 0.12. The pre-build samples are working fine in both cases, but when building the samples myself it breaks.


I’ve tested it in a new project (Unity v. 2021.3.16), installed the Spaces and the Hand packages via package manager and ran the project setup like described in your documentary. After that I just built the sample scenes.


As soon Image tracking is initiated, I’m greeted by the following error:


“Failed to create Image Tracker: XR_ERROR_RUNTIME_FAILURE”


followed by


“Failed to locate image targets: XR_ERROR_HANDLE_INVALID” (spamming)


You'll find the full log in the attachments

txt

Hey again,


Are you using our spaces town texture or another? 

Please make sure the images you are using for image tracking have the right format set:

  • In the texture import settings:
    • Images must be in a RGB 24bit format - which may also appear as RGB8
    • The texture should have the Read/Write flag also enabled 
  • In the reference image library
    • Check "Keep Texture at Runtime"
    • Check specify size and provide the real world size of the texture

Hi

I have rechecked the instructions linked above. 

I am using the spaces town texture as is.

I have checked "Keep Texture at Runtime"

and real world dimensions are also set.


I am also receiving the following error in Android Studio logcat


2023-04-17 15:32:41.027 2289-2382/? E/QVRServiceTracker: Min index found 16 input timestamp 4746440593062 closest timestamp 4746440593062

2023-04-17 15:32:41.028 29498-31800/? W/QXRStream: SP: QVRSparsePoints_GetPoints Failed, ret1= 0. Frame= 9531, Format= 2. But numValidPoints= 0

2023-04-17 15:32:41.031 29613-31465/? I/XrCompositor::ProcessEvent: Start

2023-04-17 15:32:41.034 31322-31429/com.... E/ipc_compositor_layer_commit: release sync_handle: 5

2023-04-17 15:32:41.035 31322-31367/com.... E/Unity: Failed to locate image targets: XR_ERROR_HANDLE_INVALID

    Qualcomm.Snapdragon.Spaces.ImageTrackingFeature:TryLocateImageTargets(UInt64, Int32, List`1&)

    Qualcomm.Snapdragon.Spaces.ImageTrackingProvider:GetChanges(XRTrackedImage, Allocator)

    UnityEngine.XR.ARSubsystems.XRImageTrackingSubsystem:GetChanges(Allocator)

    UnityEngine.XR.ARFoundation.ARTrackableManager`5:Update()



1 person likes this

Hi Stefan,


can you please upload a sample project and/or your built apk for me to take a look at? 

Hi Simon


I have created a public repo

https://github.com/ypsomed/YDS-INO-SnapdragonSpaces-SDK-Samples.git


You'll find the APK and Unity project. Rebuilt the sample from scratch using the Unity instructions provided with the same error.

Hello Simon


Have you any progress to report? I posted a message here that has not been approved. (Containing the git repo)


Thank you

Hi Stefan, I just downloaded the repo and will look right into it 

Answer

Hi again Stefan,


I'm getting this log: "XRReferenceImage 'Spaces Town' has an invalid texture format (ASTC_6x6). Image targets must be set to RGB24 bit format." 

As the Format of the texture is set to automatic I would assume that your graphics settings for android are incompatible. Your player settings for texture compression format seem to match the default samples on a first glance. Did you modify something graphics related there? 


As a workaround I would suggest setting the format of tracked textures explicitly to RGB 24 bit which fixed the issue for me:





2 people like this

Thank you so much! 


The screenshot helped me with understanding what was meant with RGB 24 bit format. I looked into the png file and saw RGB color space and assumed that was what was being referred to. May I suggest adding the above screenshot to the Unity instructions?


Thank you again for the help!

Regards 

Stefan


1 person likes this

Thanks for the suggestion, I will look into having the screenshot added!

Login to post a comment