Start a new topic

Object Tracking black screen comes, camera won't start

Hi Folks


I am working on Object Tracking Android Native API. SDK version 9.5.0.


I am facing issue of black screen on loading of .wto file from android assets folder. 


Camera is not starting to track the object. I have created separate project and taking help from wikitude sample example. 


Permission already given of Camera during runtime as Android OS version is 10.

Wikitude Camera permission is also checked during runtime.

Check of Supportive Device is also checked.


I have trail license key and separate project of object tracking.


When I load below two line after setting up Configuration blank screen appears and If I comment these two lines camera start working but it won't track the object.


final TargetCollectionResource targetCollectionResource = wikitudeSDK.getTrackerManager().createTargetCollectionResource("file:///android_asset/bottle.wto");

wikitudeSDK.getTrackerManager().createObjectTracker(targetCollectionResource, MainActivity.this, null);

Please help me on this. I did so much brain storming to solve this but not able to get root cause.

Hi,


I don't see anything wrong with your code from the details you give me, but I can't reproduce your issue in our sample app, so I would need more information about how are you reproducing this to keep investigating the issue. Please answer the next questions so I can have a better idea: Did you try our native sample application? Did the Object Tracking samples work in the same device? Which device are you using? Is the bottle.wto placed in the path you mention? Is the .wto valid?


Regards,


Aitor.

Hi Aitor


Good to see your response.


Yeah I tried your native sample app and it is working perfectly fine. 

It is doing object tracking in my same device.

Device Name: Xiaomi Note Pro 7, Android version 10.

Yeah bottle.wto is placed in correct path.

Yeah .wto is valid. I created it from wikitude studio.


You can look into this link for more clearance.


https://github.com/MRAndroidNeeraj/object-tracking/blob/master/app/src/main/java/com/example/wititude/MainActivity.java


Thanks

Hi,


I can see a big difference that may be causing this issue: we always call wikitudeSDK.onResume() after the wikitudeSDK.onCreate() (which must be done) while in your sample this is not happening as you are checking if your device supports the OBJECT_TRACKING feature, and then wait for the checkPermissions callback to be called.


I'm pretty sure that with this approach, the onCreate() method is called after the onResume() and will cause it to not work. Isn't there any log from the sdk warning you about it?


My suggestion would be: move the onResume() call or check the permission and the isDeviceSupporting outside the Activity.


Please let me know if it worked or not.


Regards,


Aitor.


1 person likes this

Hey Aitor


Thanks for your keen looking into my code. I notice that wikitudeSdk.onResume() is getting called before wikitudeSdk.onCreate().


My camera is started. But it is not detecting my object.


Log that is I am getting


2021-03-03 18:32:23.436 26572-28376/com.example.wititude V/SimpleObjectTracking: Object tracker loaded


Just this, after that nothing happening.


Can you help me on this?


Thanks  

Hi,


I can't see anything wrong with your code if you have moved the onResume method. Maybe you could try your object in our sample app to see if there's actually a problem with the wto itself.


Regards,


Aitor.  

Login or Signup to post a comment