Hi! everyone.
Looking for advice, especially from someone, who knows the internals of Vuforia library. Have been wrestling with the port from Vufora 6 to Vuforia 8.5 on iOS for a while now.
Long story short, for some unknown reason Vuforia::CameraDevice::getInstance().start() always return false. It is definitely not XCode, phone etc issue, because Vuforia samples work just fine.
So, what I do:
separate thread:
Vuforia::setInitParameters(), Vuforia::GL_20 -> OK
Vuforia::init() -> OK, runs from 1 to 100 just fine
switch back to main thread:
Vuforia::registerCallback(&vuforiaUpdate);
Vuforia::onSurfaceCreated();
Vuforia::onSurfaceChanged()
Vuforia::setRotation(Vuforia::ROTATE_IOS_90);
Vuforia::TrackerManager::getInstance(); -> returns instance just fine
Vuforia::Tracker* trackerBase = trackerManager.initTracker(Vuforia::ObjectTracker::getClassType())
Vuforia::Tracker* deviceTracker = trackerManager.initTracker(Vuforia::PositionalDeviceTracker::getClassType()); -> both return instances, all OK
separate thread:
static_cast<Vuforia::ObjectTracker*>(trackerManager.getTracker(Vuforia::ObjectTracker::getClassType())) -> returns and casts OK
objectTracker->createDataSet() -> creates instance, OK
dataSet->load() -> loads without errors, OK
objectTracker->activateDataSet() -> returns true, all OK
Vuforia::CameraDevice::getInstance().init() -> OK
Vuforia::CameraDevice::getInstance().selectVideoMode(Vuforia::CameraDevice::MODE_DEFAULT) -> OK
Vuforia::Renderer::getInstance().setVideoBackgroundConfig() -> 1370,2436 (same as in samples), OK
Vuforia::Renderer::getInstance().getRecommendedFps() -> 60, same as in samples, OK
Vuforia::Renderer::getInstance().setTargetFps() -> OK
Vuforia::CameraDevice::getInstance().start() -> FAIL, returns false.
Additional info that I can think of:
1. Access to camera is granted: [34353:5575522] User pre-granted access to the camera
2. I also have the EAGL view set up properly (renderFrameVuforia is called periodically, so, library finds it).
Been digging and comparing samples' code and my code and running out of ideas.
If I could get a list of conditions, especially from someone, who knows the internals of the library, where CameraDevice start() method returns false, would help the further debugging.
Thanks in advance
Hi,
Hi,
Looking at the steps you provided, overall it looks you are on the right path. You init, selectVideoMode() etc.
Hi!
Hi!
Thank you for the reply.
Aaand answering my question
Aaand answering my question myself.
One of the situations, where everything else works just fine, but CameraDevice::getInstance().start() fails is when you do not have ARKit.framework included with the project. Took me 1 week to figure that one out :)
Regards.