BlackTrax

  Previous  Next

Introduction

BlackTrax by CAST Software is a real-time, vision-based tracking system. The data the system provides can be used in MADRIX 5.

Currently, you need to use MADRIX 5 Script in order to let both systems, MADRIX 5 and BlackTrax, work together.
MADRIX 5 is using the real-time tracking protocol for the integration in order to receive positional data (RTTrPM).

 

Available Functions

These functions are available in the MAS Script Effect as well as Macros For Effects.

Please note: Incoming values entirely depend on the configured sender. MADRIX 5 is only receiving the incoming values.

Function

Description

void BlackTraxBeaconClear()

Globally deletes the current set of recognized beacons in the MADRIX 5 Software.

int BlackTraxBeaconIsExist(string beaconname)

Allows you to check if the specified beacon currently exists in the set of recognized beacons in the MADRIX 5 Software. If the return value = 0, the beacon does not exist.

int BlackTraxBeaconGetTimestamp(string beaconname)

Returns the optional time stamp of the specified beacon. If the return value = 0, no time stamp exists.

int BlackTraxBeaconGetPositionCentroidLatency(string beaconname)

Returns the approximate time since the last measurement for the center position of the specified beacon in milliseconds.

float BlackTraxBeaconGetPositionCentroidX(string beaconname)

Returns the center position of the specified beacon in X.

float BlackTraxBeaconGetPositionCentroidY(string beaconname)

Returns the center position of the specified beacon in Y.

float BlackTraxBeaconGetPositionCentroidZ(string beaconname)

Returns the center position of the specified beacon in Z.

int BlackTraxBeaconGetPositionTrackedLatency(string beaconname, int value)

Returns the approximate time since the last measurement for the tracked position of the specified beacon in milliseconds. Specify which LED is used via value [0, 1, or 2].

float BlackTraxBeaconGetPositionTrackedX(string beaconname, int value)

Returns the position of the specified beacon in X, which can deviate from the center position. As you can specify an offset to the center for each LED, the offset will be automatically added here, which then represents center position plus offset equals tracked position. Specify which LED is used via value [0, 1, or 2].

float BlackTraxBeaconGetPositionTrackedY(string beaconname, int value)

Returns the position of the specified beacon in Y, which can deviate from the center position. As you can specify an offset to the center for each LED, the offset will be automatically added here, which then represents center position plus offset equals tracked position. Specify which LED is used via value [0, 1, or 2].

float BlackTraxBeaconGetPositionTrackedZ(string beaconname, int value)

Returns the position of the specified beacon in Z, which can deviate from the center position. As you can specify an offset to the center for each LED, the offset will be automatically added here, which then represents center position plus offset equals tracked position. Specify which LED is used via value [0, 1, or 2].

int BlackTraxBeaconGetQuaterionsLatency(string beaconname)

Returns the approximate time since the last measurement for the quaternions position of the specified beacon in milliseconds.

float BlackTraxBeaconGetQuaternionsX(string beaconname)

Returns the position of the specified beacon in X as expressed in quaternions; a number system for complex numbers and three-dimensional spaces.

float BlackTraxBeaconGetQuaternionsY(string beaconname)

Returns the position of the specified beacon in Y as expressed in quaternions; a number system for complex numbers and three-dimensional spaces.

float BlackTraxBeaconGetQuaternionsZ(string beaconname)

Returns the position of the specified beacon in Z as expressed in quaternions; a number system for complex numbers and three-dimensional spaces.

float BlackTraxBeaconGetQuaternionsW(string beaconname)

Returns the angle W of the specified beacon as expressed in quaternions; a number system for complex numbers and three-dimensional spaces.

int BlackTraxBeaconGetEulerLatency(string beaconname)

Returns the approximate time since the last measurement for the Euler position of the specified beacon in milliseconds.

int BlackTraxBeaconGetEulerOrder(string beaconname)

Returns the direction of the specified beacon as expressed in an Euler system.

float BlackTraxBeaconGetEulerRotation1(string beaconname)

Returns the first part of the rotation of the specified beacon as expressed in an Euler system.

float BlackTraxBeaconGetEulerRotation2(string beaconname)

Returns the second part of the rotation of the specified beacon as expressed in an Euler system.

float BlackTraxBeaconGetEulerRotation3(string beaconname)

Returns the third part of the rotation of the specified beacon as expressed in an Euler system.

float BlackTraxBeaconGetAccelerationX(string beaconname)

Returns the acceleration of the specified beacon in X.

float BlackTraxBeaconGetAccelerationY(string beaconname)

Returns the acceleration of the specified beacon in Y.

float BlackTraxBeaconGetAccelerationZ(string beaconname)

Returns the acceleration of the specified beacon in Z.

float BlackTraxBeaconGetVelocityX(string beaconname)

Returns the speed of the specified beacon in X.

float BlackTraxBeaconGetVelocityY(string beaconname)

Returns the speed of the specified beacon in Y.

float BlackTraxBeaconGetVelocityZ(string beaconname)

Returns the speed of the specified beacon in Z.

 

Example

@scriptname="BlackTrax Test Sample";
@author="inoage GmbH";
@version="1.0
@description="An example of reading BlackTrax RTTrPM data";
 
void InitEffect()
{
 BlackTraxBeaconClear();
}
 
void RenderEffect()
{
 const int iCount = 85; // maximum classic beacon count
 for(int i=0; i<iCount; i++)
 {
         if(BlackTraxBeaconIsExist((string)(i)) != 0)
         {
                 // POSITION CENTROID
                 const int  lc = BlackTraxBeaconGetPositionCentroidLatency((string)(i));
                 const float x = BlackTraxBeaconGetPositionCentroidX((string)(i));
                 const float y = BlackTraxBeaconGetPositionCentroidY((string)(i));
                 const float z = BlackTraxBeaconGetPositionCentroidZ((string)(i));
                 WriteText("Beacon " + (string)(i) + " Position Centroid | x "
                 + (string)x + " | y " +(string)y + " | z " +(string)z  
                 + " | Latency " +(string)lc);
 
                 SetVectorPixel(RED, x, y);
                 SetVectorPixel3D(WHITE, x, y, z);
 
                 // POSITION TRACKED LED 1,2,3
                 for(int j=0; j<3;j++)
                 {
                         const int  lt = BlackTraxBeaconGetPositionTrackedLatency((string)(i), j);
                         const float x = BlackTraxBeaconGetPositionTrackedX((string)(i), j);
                         const float y = BlackTraxBeaconGetPositionTrackedY((string)(i), j);
                         const float z = BlackTraxBeaconGetPositionTrackedZ((string)(i), j);
                         WriteText("Beacon " + (string)(i) + " Pos Tracked Led "+(string)j 
                         + " | x " + (string)x + " | y " +(string)y + " | z " +(string)z +
                         " | Latency " +(string)lt);
                 }        
                 
                 // TIMESTAMP
                 const int   t = BlackTraxBeaconGetTimestamp(  (string)(i)); 
                 WriteText("Beacon " + (string)(i) + " Timestamp    | " +(string)t);
 
                 // QUATERNIONS
                 const int   lq = BlackTraxBeaconGetQuaternionsLatency((string)(i));
                 const float qx = BlackTraxBeaconGetQuaternionsX((string)(i));
                 const float qy = BlackTraxBeaconGetQuaternionsY((string)(i));
                 const float qz = BlackTraxBeaconGetQuaternionsZ((string)(i));
                 const float qw = BlackTraxBeaconGetQuaternionsW((string)(i));
                 WriteText("Beacon " + (string)(i) + " Quaternions | qx " 
                 + (string)qx + " | qy " +(string)qy + " | qz " 
                 +(string)qz + " | qw " +(string)qw + " | Latency " +(string)lq);
 
                 // EULER
                 const int   le = BlackTraxBeaconGetEulerLatency((string)(i));
                 const int   eo = BlackTraxBeaconGetEulerOrder((string)(i));
                 const float e1 = BlackTraxBeaconGetEulerRotation1((string)(i));
                 const float e2 = BlackTraxBeaconGetEulerRotation2((string)(i));
                 const float e3 = BlackTraxBeaconGetEulerRotation3((string)(i));
                 WriteText("Beacon " + (string)(i) + " Euler | eo " 
                 + (string)eo + " | e1 " +(string)e1 + " | e2 " +(string)e2 
                 + " | e3 " +(string)e3 + " | Latency " +(string)le);
 
                 // ACCELERATION
                 const float ax = BlackTraxBeaconGetAccelerationX((string)(i));
                 const float ay = BlackTraxBeaconGetAccelerationY((string)(i));
                 const float az = BlackTraxBeaconGetAccelerationZ((string)(i));
                 WriteText("Beacon " + (string)(i) + " Acceleration | ax " 
                 + (string)ax + " | ay " +(string)ay + " | az " +(string)z);
 
                 // VELOCITY
                 const float vx = BlackTraxBeaconGetVelocityX((string)(i));
                 const float vy = BlackTraxBeaconGetVelocityY((string)(i));
                 const float vz = BlackTraxBeaconGetVelocityZ((string)(i));
                 WriteText("Beacon " + (string)(i) + " Velocity | vx " 
                 + (string)vx + " | vy " +(string)vy + " | vz " +(string)vz);
         }
 }
}
 
void MatrixSizeChanged()
{
 InitEffect();
}
 
 
 

MADRIX Version: 5.7 | Script Version: 3.23
[Ctrl & +/-] = Zoom In/Out | [Ctrl & 0] = 100%
 Previous   Next

 


Enable automatic translation | Activer la traduction automatique |