Log in or register to post comments

How can access trackable in the ARParentViewController

July 11, 2013 - 3:32am #1

Hi, 

 

here is my question,

 

i am working on image target sample. i am trying to show info about  3d model.

But i am a bit confused;

How can tell ARParentViewController.mm class to what object is drawing from EAGLView.mm.?

 

<pre class="brush: cpp">...

const QCAR::Trackable& trackable = result->getTrackable();

trackable.getName();

</pre>

this values i need to get from EAGLView.mm to ARParentViewController.mm. thanks in advance.

 

Thanks in advance. 

How can access trackable in the ARParentViewController

November 18, 2013 - 2:55am #19

Great to hear :)

How can access trackable in the ARParentViewController

November 17, 2013 - 8:15am #18

Hi NaliNs,

finally two days ago I'm able to integrate what I need in my IOS app.

There are some other little problem, but I'm working on it.

Thanks for your support.

Bye ;-)

Luca

How can access trackable in the ARParentViewController

November 15, 2013 - 7:33am #17

You need to focus on this:

QCARutils: Failed to load any target

..which means you have not specifed any dataset that contains any targets.

 

N

 

How can access trackable in the ARParentViewController

November 15, 2013 - 4:06am #16

I'm again, please don't hate me!! ;-)

I've edited the code and now I can compile the app but when I tap on the button on the MainViewController open a black screen and I can see these log messages:

 

2013-11-15 12:22:21.992 CloudReco[889:60b] Pressed - Highlight Image

2013-11-15 12:22:22.009 CloudReco[889:60b] Camera - Touch Init

2013-11-15 12:22:22.022 CloudReco[889:60b] Camera - Launch camera function

2013-11-15 12:22:22.029 CloudReco[889:60b] cameraViewController.arViewSize -W 320.000000 H 480.000000

2013-11-15 12:22:22.038 CloudReco[889:60b] Released - Normal Image

2013-11-15 12:22:22.041 CloudReco[889:60b] Camera - Touch End

2013-11-15 12:22:22.045 CloudReco[889:60b] #DEBUG LUCA ->CRParentViewController loadView

2013-11-15 12:22:22.055 CloudReco[889:60b] ARVC: loadView

2013-11-15 12:22:22.211 CloudReco[889:60b] QCAR OpenGL flag: 2

2013-11-15 12:22:22.220 CloudReco[889:60b] ARVC: viewDidLoad

2013-11-15 12:22:22.310 CloudReco[889:60b] QCARutils onCreate()

2013-11-15 12:22:22.315 CloudReco[889:60b] APPSTATUS_INIT_APP

2013-11-15 12:22:22.319 CloudReco[889:60b] APPSTATUS_INIT_QCAR

2013-11-15 12:22:22.410 CloudReco[889:60b] #DEBUG LUCA ->CRParentViewController viewDidLoad

2013-11-15 12:22:22.415 CloudReco[889:60b] ARParentVC: loading

2013-11-15 12:22:22.418 CloudReco[889:60b] ARVC: Rotating to Portrait

2013-11-15 12:22:22.424 CloudReco[889:60b] ARParentVC: appearing

2013-11-15 12:22:22.428 CloudReco[889:60b] ARVC: Rotating to Portrait

2013-11-15 12:22:22.431 CloudReco[889:60b] ARVC: viewWillAppear

2013-11-15 12:22:22.436 CloudReco[889:60b] ARVC: viewWillAppear

2013-11-15 12:22:22.446 CloudReco[889:60b] ARParentVC: appeared

2013-11-15 12:22:22.450 CloudReco[889:60b] ARVC: viewDidAppear

2013-11-15 12:22:22.453 CloudReco[889:60b] QCARutils onResume()

2013-11-15 12:22:22.461 CloudReco[889:60b] EAGLView: layoutSubviews

2013-11-15 12:22:22.559 CloudReco[889:60b] #DEBUG setRenderState 0 --> 0

2013-11-15 12:22:22.570 CloudReco[889:4507] INFO/AR(889) 2013-11-15 12:22:22: QCAR SDK version 2.6.8

2013-11-15 12:22:22.685 CloudReco[889:60b] ARVC: viewDidAppear

2013-11-15 12:22:22.704 CloudReco[889:60b] #DEBUG LUCA ->CRParentViewController endSplash

2013-11-15 12:22:22.707 CloudReco[889:60b] #DEBUG LUCA ->CRParentViewController videoStreamStarted == NO

2013-11-15 12:22:22.854 CloudReco[889:60b] #DEBUG LUCA ->CRParentViewController endSplash

2013-11-15 12:22:22.856 CloudReco[889:60b] #DEBUG LUCA ->CRParentViewController videoStreamStarted == NO

2013-11-15 12:22:22.905 CloudReco[889:60b] APPSTATUS_INIT_TRACKER

2013-11-15 12:22:22.954 CloudReco[889:60b] Successfully initialized ImageTracker.

2013-11-15 12:22:22.956 CloudReco[889:60b] APPSTATUS_INIT_APP_AR

2013-11-15 12:22:22.958 CloudReco[889:60b] APPSTATUS_LOAD_TRACKER

2013-11-15 12:22:22.962 CloudReco[889:450b] QCARutils: Failed to load any target

 

I think that now I've some problem with singletone class QCAR.

Can you help me?

How can access trackable in the ARParentViewController

November 15, 2013 - 2:20am #15

Each case was different.

You need to experiment a bit and try things out.

N

How can access trackable in the ARParentViewController

November 15, 2013 - 2:00am #14

Thanks for helping me!!!

I'm trying to follow your code's snippet but I've a doubt:

here you say:

 

 

3 - In CRParentViewController.h add this

@property (nonatomicCGSize arViewSize;

https://developer.vuforia.com/forum/ios/black-screen-after-pushing-view-my-custom-viewcontroller-arparentviewcontroller#comment-2034862

 

And here you say:

 

2  In ARParentViewController.h add the following line

 

@property (nonatomicCGSize arViewSize;

https://developer.vuforia.com/forum/ios/integrating-sample-codes-tabbed-application

Maybe I'm trying to make a miked of them and for this I'm encountering these problem?

Where I must add these lines?

How can access trackable in the ARParentViewController

November 15, 2013 - 1:56am #13

Ok, check the thread.

However please bear in mind that we are not here to debug Developers code - this is up to you.  

If you are new to iOS, then you may need to go through some more iOS tutorials to get some more familiarity.  BTW Unity is much easier.

N

How can access trackable in the ARParentViewController

November 15, 2013 - 1:37am #12

Scuse me,

I've used that thread because I'm trying to follow your code.

In reality I don't want use storyboard, I want only make this step:

1) Create a MainViewController with some buttons (Made and working)

2) Add an Action to one of the buttons on the MainViewController and launch a StartControllerView that start with CloudRecognition. 

3) Edit Vuforia sample for open a specific webpage in other ViewController when target is fount (Made and working).

I've made all this in Android and now I'm trying to make it on IOS for launch a project but I need some help.

Thanks

Luca

How can access trackable in the ARParentViewController

November 15, 2013 - 1:27am #11

Please do not re-use existing threads.

I have made a main page and I want launch recognition from there.

You need to think through what you need to achieve, and it seems you want to use Storyboards to do this.

The first step is to get some familiarity with Storyboards by going through the Apple iOS tutorials.

Next, it is possible to integrate these with Vuforia, but it is not easy, so here are a few threads which may help:

 

https://developer.vuforia.com/forum/cloud-recognition/cloudreco-storyboards-ios

https://developer.vuforia.com/forum/ios/integrating-sample-codes-tabbed-application

https://developer.vuforia.com/forum/ios/qcar-inside-uinavigationcontroller

 

HTH

N

 

 

How can access trackable in the ARParentViewController

November 14, 2013 - 11:34pm #10

After a deep search in forum I've found this post:

https://developer.vuforia.com/forum/ios/black-screen-after-pushing-view-my-custom-viewcontroller-arparentviewcontroller

Do you think that this suggestion will be ok for my issue?

Have some other suggestion?

Scuse me but it's not so easy for me understand how work Vuforia in IOS, but I like it very much and I'm working on it ;-)

Thanks in advance

Luca

How can access trackable in the ARParentViewController

November 14, 2013 - 11:32am #9

Ok,

now I've added my code and now when image is recognized a webview with my desidered URL will open.

I've another issue now.

I have made a main page and I want launch recognition from there.

For me it's not so easy understand how I can make this.

Can you help me?

When I've enconter same problem in Android other moderator have indicate me snippet code and varios guide that have help me in my trouble, there isn't same things for IOS?

Thanks in advance.

Luca

How can access trackable in the ARParentViewController

November 13, 2013 - 9:02am #8

I cannot tell you exactly how to do this, so the besty thing to do in the first instance would be to do build a basic iOS sample that brings up a web page in a UIWebView.

Next, set a break point in the TargetFound function, and then step through it so that you understand the code better.

Then think about how you can re-use your UIWebView code to bring up a web page - chances are you need to really think through the user experience here in the first instance.

HTH

N

How can access trackable in the ARParentViewController

November 13, 2013 - 6:19am #7

Scuse me,

I think that what I asked for was clear but maybe that was clear only for me ;-) sorry!

I want simply delete all references with books and substitute the call to targetOverlayView in targetFound function in CROverlayVirewController with my webpage.

I want launch a fully webpage in a webview with an URL (ex www.myurl.com) and appen to it targetImage's name.

I have no problem to take targetImage's name but it's not so clear (for me) how substitute the use of targetOverlayView with an entire webpage.

Thanks in advance for your time.

Luca

How can access trackable in the ARParentViewController

November 13, 2013 - 3:53am #6

Can you help me to understand how I can make the next step?

Unfortunately you have not described in any technical detail what it is you are trying to do.

You may just need to try a few things  out to understand the flow of code and wher you may need to change it.

 

N

 

How can access trackable in the ARParentViewController

November 13, 2013 - 1:51am #5

Hi,

scuse me for the last time, I had problem with variable because I didn't understand the correct flow of code in recognition time.

I've created an Android App that when image is recognized open a webpage with a link composed to fixed URL and image name.

Now I want recreate the same situation in IOS.

I think I know the flow of code now and I want simply delete the reference with book and substitute the targetOverlayView in targetFound function in CROverlayVirewController with my webpage.

I don't want use an overlay but open directly a webpage.

Can you help me to understand how I can make the next step?

Thanks in advance

Luca

 

P.s. I've searched many times in forum but I'm not able to find what I need

 

How can access trackable in the ARParentViewController

October 2, 2013 - 3:08am #4

If you are having problems with variables I think this is more a basic programming question as it is not really specific to Vuforia.

Either search the forums or search the web, but before this look at the various samples and become more familiar with them

 

N

 

How can access trackable in the ARParentViewController

October 1, 2013 - 3:17pm #3

Hi,

I'm try to follow your code but I don't understand how I can set myvariable with the ID that I obtain in the callback function, the result of newTrackable->getName();

I've created a variable as you have indicate but if I try to assign this value in callback function I obtain an error that say to me that myvariable is undeclared.

Can you help me in this issue?

My goal will be open an URL after a succesful recognition and part of URL will be target's name.

Thanks in advance

Luca

How can access trackable in the ARParentViewController

July 12, 2013 - 2:08am #2

It is worth trying to understand the existing hierarchy first:

 

ARParentViewController contains the following

 

    ARViewController* arViewController; // for the Augmented Reality view

and this ARViewContainer contains the EAGLView:

 

    IBOutlet EAGLView *arView;  // the Augmented Reality view

 

So, as an example, let's ay you wanted to print out the number of trackables detected in EAGLView:

Step 1 - define the variable in EAGLView.h:

 

@interface EAGLView : AR_EAGLView

{

@public

    int numTrackables;

}

 

@property int numTrackables;

 

@end

 
 
Step 2 - synthesize this in EAGLView.mm:
 

@synthesize numTrackables = _numTrackables;

 
 
Step 3 - set the variable in EAGLView.mm
 

    _numTrackables = state.getNumTrackableResults();

 
 
Step 4 - print it out in ARParentViewController.mm
 

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

{

    NSLog(@"Number of trackables = %d", arViewController.arView.numTrackables);

}

 
 

That's it.  

HTH.

N

 

 

 

Log in or register to post comments