.net wrappers for c++ SDK

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

Re: .net wrappers for c++ SDK

Post by jjreilly »

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.
johnbsys
Posts: 15
Joined: Mon Oct 10, 2011 4:20 pm
Location: Iowa

Re: .net wrappers for c++ SDK

Post by 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.
Robbie86
Posts: 5
Joined: Mon Sep 26, 2011 4:21 am

Re: .net wrappers for c++ SDK

Post by Robbie86 »

[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.
jjreilly
Posts: 3
Joined: Thu Oct 13, 2011 7:52 am

Re: .net wrappers for c++ SDK

Post by jjreilly »

@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.
nbviper
Posts: 1
Joined: Wed Nov 30, 2011 7:09 pm

Re: .net wrappers for c++ SDK

Post by nbviper »

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!
NaturalPoint - Mike
Posts: 1896
Joined: Tue Feb 01, 2011 8:41 am
Location: Corvallis, OR

Re: .net wrappers for c++ SDK

Post by NaturalPoint - Mike »

This does appear to be based off of the OptiTrack SDK, not the current Camera SDK.
leith
Posts: 194
Joined: Tue Jan 02, 2007 2:17 pm

Re: .net wrappers for c++ SDK

Post by leith »

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
AlanSL
Posts: 3
Joined: Sat Mar 17, 2012 6:22 am

Re: .net wrappers for c++ SDK

Post by AlanSL »

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!
leith
Posts: 194
Joined: Tue Jan 02, 2007 2:17 pm

Re: .net wrappers for c++ SDK

Post by leith »

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.
AlanSL
Posts: 3
Joined: Sat Mar 17, 2012 6:22 am

Re: .net wrappers for c++ SDK

Post by AlanSL »

Brad,

Thank you for this link.
But, how to use this tool? I couldn't find any "how to" instruction ?
Thanks for advance!
Post Reply