TTAPIFrameAvailable
TTAPIFrameAvailable
Hi,
Does anyone has succeeded to use the cTTAPIListener class ?
I have created a derived class and overrided the TTAPIFrameAvailable virtual function.
When I run my application, the TTAPIFrameAvailable is never called.
My application still poll on regular basis to call the TT_Update, and I can see that my rigid body is tracked correctly. So I know my setup (camera, license...) are OK.
Note: I used an OptiTrack Optihub 2 on which 2 OptiTrack Flex13 cameras are connected to.
Is there a setting I need to configure in TrackingTool to have access to this functionality ?
thank,
Martin
Does anyone has succeeded to use the cTTAPIListener class ?
I have created a derived class and overrided the TTAPIFrameAvailable virtual function.
When I run my application, the TTAPIFrameAvailable is never called.
My application still poll on regular basis to call the TT_Update, and I can see that my rigid body is tracked correctly. So I know my setup (camera, license...) are OK.
Note: I used an OptiTrack Optihub 2 on which 2 OptiTrack Flex13 cameras are connected to.
Is there a setting I need to configure in TrackingTool to have access to this functionality ?
thank,
Martin
Re: TTAPIFrameAvailable
Hi,
Originally my application called the TT_AttachListener, before the call to TT_Initialize.
Now I have decided to perform the call TT_AttachListerer AFTER the TT_Initialize, and the TTAPIFrameAvailable is now called!!!
Martin
Originally my application called the TT_AttachListener, before the call to TT_Initialize.
Now I have decided to perform the call TT_AttachListerer AFTER the TT_Initialize, and the TTAPIFrameAvailable is now called!!!
Martin
Re: TTAPIFrameAvailable
I still have a problem.
When I said it was working, I had a thread running which was performing TT_Update() on regular interval.
I have removed this thread, and now the TTAPIFrameAvailable is never called.
So the initial question remains, does anyone have succeeded to use the TTListener ?
thank you,
Martin
When I said it was working, I had a thread running which was performing TT_Update() on regular interval.
I have removed this thread, and now the TTAPIFrameAvailable is never called.
So the initial question remains, does anyone have succeeded to use the TTListener ?
thank you,
Martin
Re: TTAPIFrameAvailable
Hi,
I have found that if I call TT_AttachListener before performing a TT_LoadProject, it works (the TTAPIFrameAvailable is called and then I can call the TT_Update)
If I call TT_LoadProject and then call TT_AttachListener, the TTAPIFrameAvailable is not called
I have not seen anything about this behavior in the documentation.
Does someone can confirm this is the expected behavior ?
thank you,
Martin
I have found that if I call TT_AttachListener before performing a TT_LoadProject, it works (the TTAPIFrameAvailable is called and then I can call the TT_Update)
If I call TT_LoadProject and then call TT_AttachListener, the TTAPIFrameAvailable is not called
I have not seen anything about this behavior in the documentation.
Does someone can confirm this is the expected behavior ?
thank you,
Martin
-
- Posts: 323
- Joined: Thu Oct 11, 2012 9:18 am
Re: TTAPIFrameAvailable
I am forwarding this on to one of our developers and will get back to you guys with an answer soon.
Re: TTAPIFrameAvailable
Has there been any update on this?
I am using the callback approach as well and it only seems to work if I attach the listener object after TT_Initialize and before and calls to LoadProject/Cal/Trackables/etc.
I am using SDK packaged with the latest Motive build (Apr 2013)
I am using the callback approach as well and it only seems to work if I attach the listener object after TT_Initialize and before and calls to LoadProject/Cal/Trackables/etc.
I am using SDK packaged with the latest Motive build (Apr 2013)
-
- Posts: 609
- Joined: Tue Mar 19, 2013 5:03 pm
Re: TTAPIFrameAvailable
Martin,
I apologize for the delay. I will research this issue for you and have a response shortly.
Best Regards
I apologize for the delay. I will research this issue for you and have a response shortly.
Best Regards
Dustin
Technical Support Engineer
OptiTrack | TrackIR | SmartNav
Technical Support Engineer
OptiTrack | TrackIR | SmartNav
Re: TTAPIFrameAvailable
Hi,
ok let me know when you will have an answer.
thank you,
martin
ok let me know when you will have an answer.
thank you,
martin
Re: TTAPIFrameAvailable
You should be able to attach your callback listener after TT_Initialize without issue. There's one thing you need to watch out for. If you're triggering your TT_Update() from FrameAvailable notifications you have to be mindful that the notifications will stop coming if the frame queues overflow, ie. your app gets behind. In order to prevent this issue from arising, you'll want to make sure to call TT_Update() after attaching your callback listener and then you should be good to go.
Re: TTAPIFrameAvailable
Ok that would explain the behavior I have observed. My solution was the proper one in this case, immediately begin calling TT_Update in the listener as soon as it is attached. However I have noticed that the tracking data seems to be invalid for a period of time until the project and calibration etc are successfully loaded.
I had before only been calling Update when a flag (defined by me) had been set indicating that my own code was initialized and ready to receive tracking data. This must have caused the frame queue as you say to overflow, which was happening very shortly after the initialize call.
I suppose the problem is that once the frame queue overflows, it will never recover?
I had before only been calling Update when a flag (defined by me) had been set indicating that my own code was initialized and ready to receive tracking data. This must have caused the frame queue as you say to overflow, which was happening very shortly after the initialize call.
I suppose the problem is that once the frame queue overflows, it will never recover?