forums.naturalpoint.com

Discussion and Support for the OptiTrack, SmartNav and TrackIR brands by NaturalPoint

.net wrappers for c++ SDK

by jjreilly » Tue Oct 25, 2011 4:44 am

I figured out the problem. If you don't set the CAMERALIBRARY_IMPORTS macro, you get bizarre behavior, as previously described. It seems to run most of the time under the debugger, but not at all sans debugger. Once setting that, it works w/ VS 2010 Express debug & release builds outside of the IDE.

-reilly.
jjreilly
 
Posts: 3
Joined: Thu Oct 13, 2011 7:52 am

by johnbsys » Wed Oct 26, 2011 4:10 am

Reilly,

Can you show me an example of how you are referencing the cameralibrary.dll in .net? I cannot seem to get it to work.

Thanks.
johnbsys
 
Posts: 15
Joined: Mon Oct 10, 2011 4:20 pm
Location: Iowa

by Robbie86 » Thu Oct 27, 2011 2:20 am

[quote=johnbsys]Reilly,

Can you show me an example of how you are referencing the cameralibrary.dll in .net? I cannot seem to get it to work.

Thanks. [/quote]

You must not reference the cameralibrary.dll this is only possible if its enabled for COM.

You need to create an Managed C++/CLI DLL arround the native DLL. Then you can reference the Managed DLL in your .NET project.
Robbie86
 
Posts: 5
Joined: Mon Sep 26, 2011 4:21 am

by jjreilly » Mon Nov 28, 2011 8:50 am

@johnbsys,

I don't really understand your question. The .NET wrapper (NPCameraSDKDotNet) is a C++/CLI-coded .NET assembly, but it is a C++ project mostly. So that project links to cameralibrary.lib to resolve symbols. That means the resulting .NET assembly will try to dynamically load the cameralibrary.dll. Therefore the DLL must be in the application's path, as is usual for any ole DLL.

A .NET project will need a .NET "reference" to NPCameraSDKDotNet.dll (assembly). How you do that is mechanical based upon the language / IDE of your choice. What is your question: how to use Microsoft Visual Studio to use the assembly? Or how to build the wrapper assembly?

-reilly.
jjreilly
 
Posts: 3
Joined: Thu Oct 13, 2011 7:52 am

by nbviper » Thu Dec 01, 2011 12:54 pm

Looking at this example code (not the wrapper itself)
http://code.google.com/p/kinearx2dotserver/

This appears to be using the older OptiTrack DLL, am i missing something? I'm attempting to expand the Wrapper for my needs but would like to make sure I have some baseline code that I know works.

Thanks!
nbviper
 
Posts: 1
Joined: Wed Nov 30, 2011 7:09 pm

by NaturalPoint - Mike » Mon Dec 05, 2011 1:48 pm

This does appear to be based off of the OptiTrack SDK, not the current Camera SDK.
NaturalPoint - Mike
 
Posts: 1896
Joined: Tue Feb 01, 2011 8:41 am
Location: Corvallis, OR

by leith » Tue Jan 31, 2012 3:32 pm

Sorry. Been busy for a while.

I have not published an updated version of kinearx that uses the new wrappers. Though I do have a hacked version of it somewhere that does.

But yea, its using the older code. So it will not help you.

My newer apps that I was using this wrapper for, were using unity3d on a mac as a application framework. and I can confirm, its totally possible to use the wrapper to get your tracking data streaming across the network and into a client application on a mac. such as a game engine.

-brad
leith
 
Posts: 192
Joined: Tue Jan 02, 2007 2:17 pm

by AlanSL » Mon Mar 19, 2012 4:08 am

Hi, Everyone!

I'm a newcomer in working with this Camera SDK.

Could you please, advice,
where can I find some code samples, based on this wrapper, which work with frames.

It woould be very helpfull! Thank you!
AlanSL
 
Posts: 3
Joined: Sat Mar 17, 2012 6:22 am

by leith » Tue Mar 20, 2012 9:21 pm

Just a note: I'm putting thought into how best to update the wrappers and keep them up to date more easily. One thing has caught my eye as a possibility:

http://tirania.org/blog/archive/2011/Dec-19.html

Going to keep an eye on it. It's unclear if it has relevance on windows. But it might.

If anyone has thoughts, I'm all ears.
leith
 
Posts: 192
Joined: Tue Jan 02, 2007 2:17 pm

by AlanSL » Sat Mar 24, 2012 3:22 am

Brad,

Thank you for this link.
But, how to use this tool? I couldn't find any "how to" instruction ?
Thanks for advance!
AlanSL
 
Posts: 3
Joined: Sat Mar 17, 2012 6:22 am

PreviousNext

Return to Camera SDK

cron