Vicon Real Time Data

<< Back to the Vicon Toolkit page

Vicon RealTime Data: How to access/use the Vicon data stream.

In this tutorial you will learn

  • How the MX Ultranet sends real time Vicon data.
  • How to request for marker/body data
  • How to request for RealTime data.

How the MX Ultranet sends real time data

The MX Ultranet is connected to the computer via a gigabit ethernet connection directly to the host computer. The MX Ultranet acts as a TCP server hosting all of the real time Vicon data on Localhost Port 800. To obtain Vicon data, a program must start a TCP socket and send a request the vicon host. Then, it will receive the requested data and any further processing must be done from the client side.

These are two common types of requests sent to the Vicon data.

  • EInfo sends a request for marker channel data. A Channel is the Vicon term for a stream of real time data. Each Marker is composed of four channels (X, Y, Z, Visible). Similarly each Body is composed of six channels (X, Y, Z, Y, P, R). EInfo requests are typically called at the start of a program to understand what markers are present in the system.
  • EData requests the real time data for each marker channel in the form of an array of doubles. X, Y, and Z values are presented in millimeters from the point of origin. Y, P, R values are represented in angle axis rotations.

Please note: Angle axis rotations can be hard to work as programmers typically expect a rotation angle relative to the point of origin. A world rotation calculation can be used to obtain Euler Angles. This acurately represents the rotation of the body about the point of origin.

Requesting Marker/Body data.

Typically people request the channel names of the Marker/Body data before obtaining the actual data to understand the data from the vicon system. A request is made by opening a TCP socket to port 800 and sending 8 bytes of data. The first byte is the request for Channel info (EInfo = 0x01). The rest should be padded to 0. After this data is sent, the same tcp socket can be set to receive a number of strings representing the marker/body names.

A typical Marker set looks like (the last channel specifies the Marker is visible):

Wand2:Base <P-X>
Wand2:Base <P-Y>
Wand2:Base <P-Z>
Wand2:Base <O>

A typical Body set looks like (a- for angle axis rotation t- for position):

Wand2:Shaft <a-X>
Wand2:Shaft <a-Y>
Wand2:Shaft <a-Z>
Wand2:Shaft <t-X>
Wand2:Shaft <t-Y>
Wand2:Shaft <t-Z>

Typically each channel set is saved in memory and recalled later when processing the data stream. For this purpose it is useful to create a class that will recognize Body and Marker data.

Please note: The first value returned is the frame rate of the system

Requesting Real Time Data

Once the Marker/Body information has been stored. A request can be made to obtain information from the real time data stream. Data is obtained from the real time data stream using a polling method. This request can be placed on a timer to enable automatic polling on set intervals. The most recent Maker/Body data is always returned.

A request is made by opening a TCP socket to port 800 and sending 8 bytes of data. The first byte is the request for Channel Data (EData = 0x02). The rest should be padded to 0. After this data is sent, the same tcp socket can be set to receive a number of doubles representing the marker/body values.

As mentioned earlier, the t-X, t-Y, and t-Z values are presented in millimeters from the point of origin. a-X, a-Y, a-Z values are represented in angle axis rotations. These can be later converted to Euler angles to provide actual Yaw, Pitch and Roll rotations.

Please note: The first value returned is the current timestamp.