Brackets

From Software Product Documentation
Jump to navigation Jump to search

Brackets

Parentheses

Parenthesis ( and ) are used to contain the parameters in a function
For Example
Vector(0,0,1)

Square_Brackets

Square Brackets

Square Brackets [ and ] specify frame numbers and components

Square Brackets [ and ] are used at the end of a function call or parenthesis ( ) to specify the frames numbers and components
Example, add two signals and retrieve the component 1 from frame 5
Evaluate_Expression
/Expression= (TARGET::ORIGINAL::RFT1 + TARGET::ORIGINAL::RFT2)[5,1]
/Result_Name=RFT_ADD_X
/Result_Type=DERIVED
/Result_Folder=PROCESSED
;
for example, add two signals and retrieve the component 1 for all frames
Evaluate_Expression
/Expression= (TARGET::ORIGINAL::RFT1 + TARGET::ORIGINAL::RFT2)[-1,1]
/Result_Name=RFT_ADD_X
/Result_Type=DERIVED
/Result_Folder=PROCESSED
;
NOTE a frame of -1 means all frames

Extracting one "component" of data from signal

The following command will result in the DERIVED signal TEST containing the X component values of the TARGET RFT1.
Evaluate_Expression
/EXPRESSION=TARGET::ORIGINAL::RFT1::X
/RESULT_NAME=TEST
/RESULT_TYPE=DERIVED
! /RESULT_FOLDER=PROCESSED
;

Using Square Brackets and Boolean Operators

In this example, project a collection of markers onto the floor
whenever the z-component of a marker is less than a threshold (e.g. 0.08 in this example)
otherwise set the resulting frame to NO_DATA
Evaluate_Expression
/EXPRESSION=(((CURRENT_SIGNAL[-1,3])<0.08)/((CURRENT_SIGNAL[-1,3])<0.08))*VECTOR(1,1,0)*CURRENT_SIGNAL
/SIGNAL_TYPES=TARGET
/SIGNAL_FOLDER=ORIGINAL
/SIGNAL_NAMES=LFT1+LFT2+LFT3+RFT1+RFT2+RFT3
/RESULT_TYPES=TARGET
/RESULT_FOLDERS=GROUND
! /RESULT_NAME=
/APPLY_AS_SUFFIX_TO_SIGNAL_NAME=TRUE
;
Retrieved from ""