Log in or register to post comments

QCAR Inside the UINavigationController

September 21, 2012 - 7:18am #1

Well. I've tried to customize the popular ImageTargets example. First I tried and succeded to buid the app. Then I converted the files to the ARC-compatitability using Edit->Refactor. Then I added a storyboard to the project and changed the AddDelegate a bit to suit the storyboard-based style. Third I customized the ARParentController class so that arRect is now being inited inside the initWithCoder method. qUtils is inited and two targets are added also there. The code from loadView was moved to viewDidLoad. Well then I added a ViewController to my stryboard and changed it class to the ARParentController. Well, it worked. Then I changed my storyboard so now it has two view controllers, embeded in the UINavigationController. The first one has in it's view a button, which actions in a segue to the second view controller, which one is our ARParentController. Well, this works too. But not for long. After going forward-returning for multiple times (from 2 to 10) the app crashes.

I knew about that the qUtils objects is declared static so it stays right there even when I come back to the first view and that it includes no code that sets targetList array to nil (forgetting about dealloc method which is not called because we have a strong pointer to our qUtils object since it is static), so in initWithCoder of ARParentController I do: 

qUtils.targetsList = [NSMutableArray array];

Still it doesn't help. In Instruments utility I see an inceasement of memory used at about 1.5MB and 1500 points in #Live column. After digging into the instruments I noticed that two of the largest leaked objects are pretty similar to the two target .dat files (meaning their size). So I suppose that they are still in memory.

QCAR Inside the UINavigationController

October 3, 2014 - 6:57am #41

Updated Link ? Or GitHUb repo ?

 

pls + thx !

QCAR Inside the UINavigationController

July 11, 2014 - 5:05am #40

https://www.dropbox.com/s/rcruso03jroxsaz/VideoPlaybackiOS6%20%28Vuforia%20AR%29.zip

Hello

i was find above link but didn't get any drop box content for this. is it correct link or did you change the location for this. please check and suggest.  

QCAR Inside the UINavigationController

June 18, 2013 - 3:04am #39

You might need to email the author, as this is not an official Vuforia sample.

N

QCAR Inside the UINavigationController

June 17, 2013 - 11:04pm #38

Please help

QCAR Inside the UINavigationController

May 15, 2013 - 5:33am #37

I've tried code from https://www.dropbox.com/s/rcruso03jroxsaz/VideoPlaybackiOS6%20%28Vuforia%20AR%29.zip

Everything work fine except playing a remote file in fullscreen and happened when double tap the local file for fullscreen too.

when target is detected it show hourgalss and I heard the audio of the video clip ,but the native player didn't show on the screen and the audio still play.

I think the streaming work fine but the player's view didn't add to the screen.

 

Please help Thanks

QCAR Inside the UINavigationController

March 22, 2013 - 10:36am #36

N,

Thanks...  I will keep working the problem.  I'll keep you up to date.  If you have the opportunity to try please let me know what you find out.

 

Thanks again,

 

Steve

QCAR Inside the UINavigationController

March 22, 2013 - 2:46am #35

Have you tried to switch to another view via a segue from VPParentView?  If so, please let me know the steps you followed.  If not, please try and let me know what your results are

Sorry, no.

I looked at the initial project but not the VideoPlayback one.

If I get time I will try to take a look, but no promises :)

 

N

QCAR Inside the UINavigationController

March 21, 2013 - 9:54am #34

Have you tried to switch to another view via a segue from VPParentView?  If so, please let me know the steps you followed.  If not, please try and let me know what your results are.

I've done a few AR Apps using the native (non-NIB, non-Storyboard) Vuforia tools.  I'm trying to transition existing Apps to Nibs and then Storyboards.  I have Nibs working, but running into issues with Storyboards.   I've built several Apps in App store and for businesses using Storyboards, so I've checked all segments of the IB, and code.  The segue appears in the IB document outliner...

 

Thanks,

Steve

QCAR Inside the UINavigationController

March 21, 2013 - 9:18am #33

This does not sound like a Vuforia issue.

Normally Storyboard errors like this occur when the ID has not been setup correctly in Interface Builder, or if there is no Navigation Controller setup as a source for the segue..

I am also wondering whether you might be reconfiguring your views at runtime, thus invalidating what was setup in IB?

N

QCAR Inside the UINavigationController

March 21, 2013 - 9:01am #32

I've downloaded this App and it works fine.  I then embedded the VPParentViewController inside of a Tabbar using the UI Builder for Storyboards.  That all worked fine, with very little effort.

Be aware that in order for Full Screen video to work I needed to change [parentView addSubview: movieplayerview]  to  [window addSubview: movieplayer].

My issue:

I'm running into an issue trying to branch to another view controller from VPParentViewController.  When I attempt a 

[self performSegueWithIdentifier:@"SegToDiffView" sender:self];

the App crashes saying that it can't locate a segue with that name.  Its as though when I created the segue between the VPParentViewController and the next view, the connection was not established with VPParentViewController...

 I have extensive experience with Storyboards, yet this one is driving me crazy.

Any help welcomed, so thanks in advance!

 

Steve

QCAR Inside the UINavigationController

March 12, 2013 - 10:57am #31

 

Here's the link, sorry just made a backup and the file got moved, thnx for notice.

https://www.dropbox.com/s/rcruso03jroxsaz/VideoPlaybackiOS6%20%28Vuforia%20AR%29.zip

Best regards.

QCAR Inside the UINavigationController

March 11, 2013 - 10:21am #30

@pakitomx I just tried running your example but it appears that the link is dead. Would it be possible to repost? Thanks!

QCAR Inside the UINavigationController

January 24, 2013 - 6:57am #29

Thanks for this contribution.

Hope that other devs find this helpful, and I look forward to trying this out for myself!

thanks again

N

QCAR Inside the UINavigationController

January 23, 2013 - 10:06am #28

Just followed the Danchoys image targets demo adaption and I did the same stuff but for the VideoPlayBack Demo.

The demo It's updgraded to be fully compatible with iOS 6, ARC, Storyboards and MVC stuff.

This adaption could make easier to integrate video to your current proyects.

*For playing remote videos that it's up to you...*

https://www.dropbox.com/sh/gj5w8m0d1q0fzm3/Pl-wCFlML9

Please feel free to make any changes and share the knowledge...

regards.

it works :) thanks a lot :)

January 4, 2013 - 5:42am #27

it works :) thanks a lot :) don't know what was wrong though

works like a charm, seems

January 4, 2013 - 5:35am #26

works like a charm, seems that some detail is out of place :/

In older version it works good, I have a white screen for a while and then camera shows up. Same like with new version except the camera...

Well yes, though I did write

January 4, 2013 - 5:21am #25

Well yes, though I did write the Migration guide for iOS ;)  - would love to know if something is wrong here.

Was it working in 1.5.x ?

N

All you did was download

January 4, 2013 - 5:20am #24

All you did was download project from github and do migration as it is in given dev guide? Nothing more?

 

generally I'm trying to run Cloud Reco with Storyboards as in Danchoy's example it is with ImageTargets, but it is painful...

Sorry to hear this.  When I

January 4, 2013 - 5:14am #23

Sorry to hear this.  When I tried it it worked...

N

Took Danchoy's app, fixed

January 4, 2013 - 4:07am #22

Took Danchoy's app, fixed with migration guide. Now I hane an app that works, from logs I can tell it loaded datasets etc, but ther is no camera....

I'll try right away. Forgot

January 3, 2013 - 12:45am #21

I'll try right away. Forgot to mention, that I built from scratch and compared parts with Danchoy's version - or at least I thought I did

Danchoys code should work

January 2, 2013 - 9:21am #20

Danchoys code should work with 2.0, so not sure where yours is different?

If it's working with 1.5.9 make a copy and attempt a migration to 2.0 as per the migration guide

https://developer.vuforia.com/resources/dev-guide/migrating-your-ios-sdk-project

...and see if it works.

N

Yes, I did and example from

January 2, 2013 - 4:57am #19

Yes, I did and example from github eventually did work with Vuforia 1.5.9, but now that we have 2.0 I did sit down and tried to make it.

No luck so far, I did set my Xcode and Vuforia 2.0 itself, but I have something very similiar to Danchoys version: menu with a "go" button,

but it leads me to black screen of ARParentViewController... somehow I cannot make it run :(

Here goes what it's logging me:

2013-01-02 13:54:43.604 IsisA[463:707] ARParentVC: creating
2013-01-02 13:54:43.704 IsisA[463:707] ARVC: loadView
2013-01-02 13:54:44.023 IsisA[463:707] QCAR OpenGL flag: 2
2013-01-02 13:54:44.025 IsisA[463:707] ARVC: viewDidLoad
2013-01-02 13:54:44.069 IsisA[463:707] QCARutils onCreate()
2013-01-02 13:54:44.071 IsisA[463:707] APPSTATUS_INIT_APP
2013-01-02 13:54:44.075 IsisA[463:707] APPSTATUS_INIT_QCAR
2013-01-02 13:54:44.079 IsisA[463:707] ARParentVC: loading
2013-01-02 13:54:44.081 IsisA[463:707] ARVC: Rotating to Portrait
2013-01-02 13:54:44.084 IsisA[463:707] ARParentVC: appearing
2013-01-02 13:54:44.086 IsisA[463:707] ARVC: Rotating to Portrait
2013-01-02 13:54:44.087 IsisA[463:707] ARVC: viewWillAppear
2013-01-02 13:54:44.147 IsisA[463:3e07] INFO/AR(463) 2013-01-02 13:54:44: QCAR SDK version 2.0.29
2013-01-02 13:54:44.342 IsisA[463:707] APPSTATUS_INIT_TRACKER
2013-01-02 13:54:44.378 IsisA[463:707] Successfully initialized ImageTracker.
2013-01-02 13:54:44.380 IsisA[463:707] APPSTATUS_INIT_APP_AR
2013-01-02 13:54:44.381 IsisA[463:707] APPSTATUS_LOAD_TRACKER
2013-01-02 13:54:44.383 IsisA[463:3e0b] QCARutils: Failed to load any target
2013-01-02 13:54:44.461 IsisA[463:707] ARParentVC: appeared
2013-01-02 13:54:44.464 IsisA[463:707] ARVC: viewDidAppear
2013-01-02 13:54:44.466 IsisA[463:707] QCARutils onResume()

 

I tried to play and I did comment out [self createParentViewAndSplashContinuation]; in loadView, but changes led me to alert about failing to launch app and it self exited. Any idea how to manage with situation?

The example on Github does

December 19, 2012 - 10:03am #18

The example on Github does work.

Do you get a white screen?

Have you tried on an iPad?

N

Is there any new stuff on

December 19, 2012 - 8:43am #17

Is there any new stuff on Vuforia & Storyboards? Tried the example given from github, but with no success - none at all :/ I'm trying to figure out how to put anything between splash screen and actual vuforia view controllers, but it's a painful job as I'm still digging through whole project to see what's where...

QCAR Inside the UINavigationController

December 10, 2012 - 4:15am #16

Hi elsevero

Tested the example which you've recommended to me but without any succes, I get the a white screen and blank UINavigation bar

Yes this is what I got when I first tried it :)  Basically this happens because the  Storyboard.storyboard is set up for an iPad (on which it will run fine) and I was trying on an iPhone.  In order to get it to work on an iPhone simply select all and copy on the existing storyboard, create a new Storyboard.iPhone and paste.  Then set the new Storyboard.iPhone to be the default, build/run and you should see some buttons.

As for mixing XCode/Unity, some have had success here https://ar.qualcomm.at/content/unityios-must-unityviewcontroller-be-rootviewcontroller

..though you may wish to search the forums for any other experience that might be helpful.

HTH

N

 

QCAR Inside the UINavigationController

December 10, 2012 - 2:19am #15

@NalinS: Thanks for your reply!

Tested the example which you've recommended to me but without any succes, I get the a white screen and blank UINavigation bar.

I need to use the xCode project which Unity3D generated because I'll will display an animation on the target image.

Any other leads which you might know?

 

QCAR Inside the UINavigationController

December 7, 2012 - 4:14am #14

Hi elsevero,

The easiest thing to do is to start with Danchoys sample and go from there because this is quite a complex thing to do and currently the samples do not show ARC/Storyboard integration.

You should be able to get this running fairly quickly, though from memory the sample is for an iPad and might need an iPhone Storyboard created to hold the button.

HTH

N

QCAR Inside the UINavigationController

December 5, 2012 - 9:08am #13


I've been followed along the posts on different forums about this issue but didn't figure out how to "do the hack" for QCAR "inside the uinavigation controller".

Maybe others already solved to integrate QCAR & Vuforia SDK into their app and have a child view with the AR screen.

 

For my case I have a iPhone app with a dashboard and several screens, one of the screen is the AR one. If I pop the AR screen I get the following log:

2012-12-05 16:20:45.502 arapp[5993:907] <HomeViewController: 0x246db00>

StopQCAR

(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)

Could not deactivate dataset.

(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)

Could not destroy dataset.

(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)

Could not deinitialize the tracker.

(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)

Could not deinitialize the tracker. 

(Filename: /Applications/buildAgent/work/14194e8ce88cdf47/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)

ghashtable.c:294: assertion 'hash != NULL' failed


Any thoughts ?

 

Kindly appriciate your feedback :)

 

QCAR Inside the UINavigationController

December 4, 2012 - 5:03am #12

Hello NalinS

Thanks for your answer.

So I decided to continue using QCAR in ARC environment.

Thank you.

Masatoshi_Suzuki2002.

 

QCAR Inside the UINavigationController

November 28, 2012 - 2:55am #11

Hi masatoshi_suzuki2002,

The samples have not been built with ARC so you will need to experiment a little.

This is where Danchoys sample is very helpful to study because to my knowledge it does not crash with ARC.

I seem to remember another developer had issues with textures and was able to fix these by amending the dealloc() to the following:

-(void)dealloc {

//NSLog(@"deallocing Texture...");

    if (pngData) {

        delete[] pngData;

    }

 

if (_textureID) {

//NSLog(@"deleting Texture...");

glDeleteTextures(1, &_textureID);

}    

    [super dealloc];

}

 

HTH

N

QCAR Inside the UINavigationController

November 27, 2012 - 10:11pm #10

Hello NalinS

I use QCAR library in ARC environment.

It is the same as that of the case of Danchoys, my application crash some times too.

So I want to know wheather to be crashed by an issue with delete textures occurs in ARC environment only or not.

Please help me.

 

QCAR Inside the UINavigationController

October 2, 2012 - 2:29am #9

Hi Danchoys and all of you

Congratulations! Your work looks very well. I have AR Qualcomm in a NavigationController. When i tried to go back doing 

[[self navigationController] popViewControllerAnimated:YES];

AR Qualcomm crashed in QCARutils onDestroy()


I used your solution and now, it works perfectly when i go back. But, when i enter again in AR Qualcomm, it crashes because it doesn´t find Dataset. Here you are log application.


Could you check if there is a problem with dataset? 

Thank you very much


2012-10-02 11:20:00.258 APP[185:707] ARVC: viewDidDisappear

2012-10-02 11:20:00.259 APP[185:707] ARParentVC: dissappeared

2012-10-02 11:20:00.260 APP[185:707] ARVC: viewDidDisappear

2012-10-02 11:20:00.261 APP[185:707] QCARutils onDestroy()

2012-10-02 11:20:00.269 APP[185:707] Successfully unloaded data set.

2012-10-02 11:20:00.270 APP[185:707] DataSets unloaded successfully

2012-10-02 11:20:00.271 APP[185:707] ERROR/AR(185) 2012-10-02 11:20:00: Failed to deinit tracker because the camera it is bound to is already initialized. A camera must be deinitialized before unbinding a tracker from it.

2012-10-02 11:20:00.272 APP[185:707] Error deiniting tracker

2012-10-02 11:20:16.073 APP[185:707] ARParentVC: creating

2012-10-02 11:20:16.074 APP[185:707] ARVC: loadView

2012-10-02 11:20:16.080 APP[185:707] QCAR OpenGL flag: 2

2012-10-02 11:20:16.081 APP[185:707] ARVC: viewDidLoad

2012-10-02 11:20:16.126 APP[185:707] QCARutils onCreate()

2012-10-02 11:20:16.126 APP[185:707] APPSTATUS_INIT_APP

2012-10-02 11:20:16.127 APP[185:707] APPSTATUS_INIT_QCAR

2012-10-02 11:20:16.129 APP[185:70c3] INFO/AR(185) 2012-10-02 11:20:16: QCAR SDK version 1.5.9

2012-10-02 11:20:16.133 APP[185:707] autofocus: 1, autofocusContinuous: 1, torch 1

2012-10-02 11:20:16.133 APP[185:707] ARParentVC: loading

2012-10-02 11:20:16.134 APP[185:707] ARVC: Rotating to Portrait

2012-10-02 11:20:16.138 APP[185:707] *** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSCFSet: 0x58ffc0> was mutated while being enumerated.'

*** First throw call stack:

(0x37afc8bf 0x315e21e5 0x37afc3e3 0x34ece447 0x34ecdf01 0x34eb44ed 0x34eb3d2d 0x375d1df3 0x37ad0553 0x37ad04f5 0x37acf343 0x37a524dd 0x37a523a5 0x375d0fcd 0x34ee2743 0x36fb 0x3690)

terminate called throwing an exception


QCAR Inside the UINavigationController

October 1, 2012 - 6:34am #8

Hi Danchoys,

I tried your sample, but for some reason it just comes up with a blank Navigation controller ?

Have I missed something?

N

QCAR Inside the UINavigationController

September 25, 2012 - 2:33am #7

Great stuff!

Thanks so much for this.

Looking forward to seeing this :)

N

QCAR Inside the UINavigationController

September 24, 2012 - 11:35am #6

QCAR Inside the UINavigationController

September 24, 2012 - 9:08am #5

Finally I've found a solution to this issue. The problem definitely lies in the QCAR::deinit() method, it seems to keep some strong references. I decided not to call it anymore and therefore create a private boolean variable called QCARinited. If QCARinited is "NO" then QCAR should be inited and QCARinited set to "YES". The proper place for that is in the initQCAR method of QCARutils class. Moreover I placed the same check inside the initApplication method for the QCAR::onSurfaceCreated() command. I don't know whether the latter is needed but I decided to put it there because the onSurfaceCreated command is originally called only once during the whole cycle of initialization and BEFORE the QCAR is inited. So now it works great. Each time I return to the previous screen (except the very first one when QCAR::init() is called) I see the memory usage falling to the same value. And there are no crashes!

 Here is some code that might help:

- (void)destroyAR

{

    NSLog(@"QCARutils onDestroy()");

    

    // Deinitialise QCAR SDK

    if (appStatus != APPSTATUS_UNINITED){

        // For some reason DataSets remain in memory even after QCAR::deinit() was called. Let's unload them manually

        int counter = 0;

        for (DataSetItem *aDataSet in targetsList)

            if ([self unloadDataSet:aDataSet.dataSet]) counter++;

        if (counter == [targetsList count])

            NSLog(@"DataSets unloaded successfully");

        else

            NSLog(@"Error unloading DataSets");

        

        // Let's deinit tracker

        QCAR::TrackerManager& trackerManager = QCAR::TrackerManager::getInstance();

        BOOL result = NO;

        if (targetType != TYPE_FRAMEMARKERS)

            result = trackerManager.deinitTracker(QCAR::Tracker::IMAGE_TRACKER);

        else

            result = trackerManager.deinitTracker(QCAR::Tracker::MARKER_TRACKER);

        

        if (result)

            NSLog(@"Tracker deinited successfully");

        else

            NSLog(@"Error deiniting tracker");

        

        // Let's keep the qUtils alive, but targetsList must be released anyway;

        targetsList = [NSMutableArray array];

 

    }

    appStatus = APPSTATUS_UNINITED;

}

 

and some more deiniting stuff for AR_EAGLView.h:

- (void)dealloc

{

    NSLog(@"EAGLView: dealloc");

    [self deinitRendering];

    [self deleteFramebuffer];

 

    // Tear down context

    [EAGLContext setCurrentContext:nil];

}

- (void)deinitRendering

{

    if (!renderingInited)

        return;

    

    NSLog(@"EAGLView: deinitRendering");

    

    // Delete textures

    GLuint *textureIDs = new GLuint [[textures count]];

    for (int i = 0; i < [textures count]; ++i) {

        Texture *texture = [textures objectAtIndex:i];

        textureIDs[i] = texture.textureID;

    }

    glDeleteTextures([textures count], textureIDs);

    delete [] textureIDs;

    

    renderingInited = NO;

}

 

The more I deinit the better I feel :) Hope this will help people trying to do the same :)

QCAR Inside the UINavigationController

September 24, 2012 - 9:00am #4

Great effort !

I'll check with the dev team regarding any potential problems with deinit(), as I know there was an issue with deleteTextures.

If you are able to share the sample integrating ARC and Storyboards, I would really like to see it :)

cheers,

Nalin 

QCAR Inside the UINavigationController

September 24, 2012 - 1:59am #3

Hi Danchoys

It's great that you are trying the latest iOS technologies with Vuforia, but at present the samples are not making use of these, and as such we cannot guarantee that there will not be problems.  Specifically features such as ARC, Storyboards, GLKit are not explicitly supported, though there is nothing to stop you from integrating these yourself.

At present the Vuforia team is working hard on the release of the next version of the SDK.  If you want these technologies supported in the samples, then please add these to the wish list here https://ar.qualcomm.at/content/wish-list

Hope you can understand this situation.

 

thanks,

N

QCAR Inside the UINavigationController

September 23, 2012 - 10:49pm #2

No single idea??

Log in or register to post comments