Page 5 of 5

Re: .net wrappers for c++ SDK

Posted: Thu Jul 19, 2012 12:10 pm
by beckdo
In native, it's pretty straight forward. The synchronizer class is cModuleSync. To attach and prepare cameras to return synchronized frames:

sync = new cModuleSync();
sync->AddCamera(camera1);
sync->AddCamera(camera2);

Then instead of calling camera->GetFrame(), you call sync->GetFrameGroup() which returns an array from camera frames that are synchronized.

Unforuntately this class doesn't appear to be wrapped by Brad's C# wrapper.

Re: .net wrappers for c++ SDK

Posted: Fri Jul 20, 2012 7:00 am
by jmoody6
I am using NPCameraSDKDotNet and have working C# code that calls 1 optitrack V120: SLIM camera, outputs its images to a window/saves them to a file. But I would like to do this with 2 synchronized cameras. Is this possible using NPCameraSDKDotNet? If so, how would I synchronize frames?

Any help would be greatly appreciated.

Re: .net wrappers for c++ SDK

Posted: Tue May 07, 2013 5:16 am
by motion3d
I was able to use the wrapper with vb net code, but i couldn't get the image using the Rasterize function.

Any help with main direction or an example how to get the image using vb net will be much appreciated.

Re: .net wrappers for c++ SDK

Posted: Tue May 07, 2013 12:47 pm
by beckdo
The main challenge of getting an image into VB will be marshaling the frame buffer to store the image. You effectively need to get an array of bytes into the wrapper layer that you can then pass to the native Camera SDK Frame::Rasterize() to populate.

Re: .net wrappers for c++ SDK

Posted: Tue Feb 28, 2023 12:55 pm
by BroncoBilli
Hm. I haven't seen this thread. I have been working on a few wrappers for the Motive/Camera SDK stuff. It might warrant a new thread.

My stuff:

1. Creates a slightly smarter C++ API layer to do different housekeeping chores with the OT stuff. Like auto switching the stuff between the CameraSDK and the MotiveAPI, to do different things. I had to do this because (apparently) TT_CameraFrameBuffer() or whatever it is called to get the luma bits from the camera, is busted in the MotiveAPI's TT call.

2. Creates a C# wrapper around the C++ motive layer. This allows you to directly call a lot of motive stuff from C#.

3. Creates a gRPC stack, so you can call the motive stuff from a REMOTE computer and get the bits back.

I was thinking of making this open source....

my email is motive - dogstar - us, if you replace the first dash with 'at', and the second dash with a dot, that is my email.
Or I'll look back here occasionally.

Re: .net wrappers for c++ SDK

Posted: Thu May 11, 2023 5:34 am
by anagysm
Hi,

We are developing an application in .NET Core and we would like to use 3D marker coordinates and/or rigid body position in this app.
If I understand the documents I think we should use the MotiveAPI to get these information. I built a wrapper DLL to export desired methods to access it from C# but I have several issues here. First I created a console app for testing purposes and set everything to 64bit. After I start it and call the TT_Initialize method I received this message:

Code: Select all

QWindowsContext: OleInitialize() failed:  "COM error 0xffffffff80010106 RPC_E_CHANGED_MODE (Unknown error 0x080010106)"
I get same message if I run the marker example code. Is this something installation issue?

In my code sometime I receiving this message if I call the TT_Initialize():

Code: Select all

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
If I run it under Visual Studio I can see this dialog then the application exit:

Code: Select all

Motive Error 1732 Debugger has been found running in your system. Please, unload it from memory and restart your program
I using Motive 3.0.1.
Anybody met these issues? Is there any solution?

Re: .net wrappers for c++ SDK

Posted: Mon Feb 19, 2024 2:33 am
by bandknobby
Thank you, for your contribution. The new Software Development Kit (SDK) represents a significant milestone as it has been completely rewritten with a focus on simplicity and power for end-users. We've optimized all of the image processing code to maximize performance, ensuring that the SDK operates efficiently while leaving ample CPU resources available for user applications. This dedication to optimization allows developers to harness the full potential of the SDK without sacrificing system resources, ultimately enhancing the overall user experience. We're excited about the possibilities this new SDK opens up and look forward to its impact on future projects.