Page 1 of 1

Motive acquisition with remote command and control

Posted: Tue May 05, 2015 6:53 am
by Benedetta
Hi,
I need to control the start and stop recording of the orientation and the position of a rigid body in Motive, with remote commands sent by a client computer via UDP. The state machine of my experiment run on labview.

I am not an expert C++ user.
I do not need data streaming in real time.

I only need to register the data in different files (i.e. Trial_i.csv) during an experiment. However, I was thinking about using the NATNET SDK tool and rearrange some of the samples script provided. The idea is to have a console app, running on the server ( i.e. the optitrack pc), that is in listening mode, and that starts ( and open a file) ad stop ( and close the file) the acquistion whenever the client sent a command ( for example a "stat" or "stop" string).

What is the best way to do that?

As far as I can see, it is possible to write a consol application that run on the client and use the sendMessage() and sendMessageandWait () command to start and stop the acquisition and set the current take name. However how can I guarantee the synchronization?

Re: Motive acquisition with remote command and control

Posted: Thu May 07, 2015 10:52 am
by steven.andrews
Hi Benedetta,

Thank you for reaching out to us regarding this workflow you are trying to achieve.

If the MATLAB PC is running windows, either the NatNet SDK or the UDP broadcast will be capable of updating the Take Name in Motive while triggering the recording. Using the NatNet SDK, you can issue .NET commands from MATLAB directly to Motive, including Start/Stop recording and SetTakeName.

The NatNet SDK has a MATLAB example and a Winforms .NET example. The MATLAB example shows how to use NatNet to communicate with MATLAB. The Winforms sample shows the complete list of commands that can be sent to Motive.


Regarding the sync, either method will trigger the recording as soon as the signal is received by Motive. This will be very fast with only some frames delay. If you are looking for truly frame accurate synchronization, you may need to incorporate one of our sync devices.


I hope this information is useful. I am happy to continue working with you through your open support ticket until we find the solution that works best for you.

Cheers,
Steven
--
Steven Andrews
OptiTrack | Customer Support Engineer

Re: Motive acquisition with remote command and control

Posted: Mon May 11, 2015 8:21 am
by Benedetta
Hi Steven,

I am using a revised BroadcastSample.ccp that you provided with the NatNet package to send the start and stop command.
I have configurated the file for my application, but it is not working ( see the attached file). I have alreadychecked that the XML strings sent to the receiver PC ( i.e. Motive) on the command port 1512 are those specified in the C++ code, to exclude the possibility of bad commands.

I fear I miss some configuration of the motive software.
At the moment I have set the broadcast configuration panel in the following way:
1) set the IP address as the local address of the Motive PC
2) set the command port as 1512
3) flag the remote trigger option -> true.
If I understand correctly, Motive should remian in a listening mode on port 1512, so that as the string command with the Start command and the specs on Take name and project directory arrives, it should start the acquisition. Am I right?
What could be the problem?

Re: Motive acquisition with remote command and control

Posted: Mon May 11, 2015 8:24 am
by Benedetta
Hi Steven,

I am using a revised BroadcastSample.ccp that you provided with the NatNet package to send the start and stop command.
I have configurated the file for my application, but it is not working ( see the attached file). I have alreadychecked that the XML strings sent to the receiver PC ( i.e. Motive) on the command port 1512 are those specified in the C++ code, to exclude the possibility of bad commands.

I fear I miss some configuration of the motive software.
At the moment I have set the broadcast configuration panel in the following way:
1) set the IP address as the local address of the Motive PC
2) set the command port as 1512
3) flag the remote trigger option -> true.
If I understand correctly, Motive should remian in a listening mode on port 1512, so that as the string command with the Start command and the specs on Take name and project directory arrives, it should start the acquisition. Am I right?
What could be the problem?

Re: Motive acquisition with remote command and control

Posted: Mon May 11, 2015 11:11 am
by steven.andrews
Hi Benedetta,

I believe I answered this question in your support ticket, but I am posting here as well.

Your setup sounds correct except for the port numbers. Whatever the Command Port is set to, in Motive, UDP triggers will be received on the Command Port + 2. That means if you've changed the Command Port to 1512 in Motive, the application sending the UDP triggers will need to send on port 1514.

I hope this helps with your triggers. If you need any more help with this, please feel free to communicate with us through your open support ticket.

Cheers,
Steven
--
Steven Andrews
OptiTrack | Customer Support Engineer