User Tools

Site Tools


visual3d:documentation:pipeline:event_commands:event_examples

Event Commands Examples

This page will provide an overview of all the examples from the EVENT LABEL commands.

Automatic Gait Events

Example 1: Simple Scenario

The first example shows the functionality of the Automatic_Gait_Events command. After loading in your workspace containing static and dynamic trail (with force assignments), you can simply add the command into the pipeline, which will look as follows:

Automatic_Gait_Events
! /FRAME_WINDOW=8
! /USE_TPR=TRUE
! /TPR_EVENT_INSTANCE=1
;

Example 2: Start-to-Finish

In the next example, the Automatic_Gait_Events command will be used with other commands to allow a user to go from starting with empty workspace to finding and highlighting events.

The pipeline will look as follows:

File_Open
/FILE_NAME=
! /FILE_PATH=
! /SEARCH_SUBFOLDERS=FALSE
! /SUFFIX=
! /SET_PROMPT=File_Open
! /ON_FILE_NOT_FOUND=PROMPT
! /FILE_TYPES_ON_PROMPT=
;

Automatic_Gait_Events
! /FRAME_WINDOW=8
! /USE_TPR=TRUE
! /TPR_EVENT_INSTANCE=1
;


For_Each
/ITERATION_PARAMETER_NAME=EVENT
! /ITERATION_PARAMETER_COUNT_NAME=
/ITEMS= LHS+LTO+LOFF+LON+RHS+RTO+ROFF+RON
;

Highlight_Event_Label
/EVENT_LABEL= ::EVENT
! /REMOVE_EXISTING_HIGHLIGHTS=FALSE
;

End_For_Each
/ITERATION_PARAMETER_NAME=EVENT
;

Switch_Between_Tabs
/SHOW_SIGNALS_AND_EVENTS_TAB=TRUE
! /SHOW_WORKSPACE_TAB=FALSE
! /SHOW_MODELS_TAB=FALSE
;

Interactive_Graph_Signals
/SIGNAL_TYPES=FORCE
/SIGNAL_FOLDER=ORIGINAL
/SIGNAL_NAMES=FP1
/SIGNAL_COMPONENTS=X
/GRAPH_INDEX=1
/GRAPH_SUBINDEX=1
! /ZOOM_START_TIME=
! /ZOOM_END_TIME=
/REPLACE_CURRENT=TRUE

After having run this pipeline, the program is able to display the following graph:

Event Copy

Example: Creating a new event at the first instance of two possible events

This example will show how to use the Event Copy command to create a copy of one of two possible events, based on which of those two events occurs first.

First, we will use Event Explicit to define our two possible events. In a practical application of this example these events might be defined by thresholds or a maximum/minimum.

Event_Explicit
/EVENT_NAME=ONE
/FRAME=NOT(DATA_EXISTS(EVENT_LABEL::ORIGINAL::ONE))*EOF
! /TIME=
;
Event_Explicit
/EVENT_NAME=TWO
/FRAME=NOT(DATA_EXISTS(EVENT_LABEL::ORIGINAL::TWO))*EOF
! /TIME=
;

Now we will create a copy of both of the events we defined, but the copy of whichever event occurred second will be placed at the end of the trial while the copy of the first event will be at the time of the first event.

Event_Copy
/EVENT_NAME=ONE
/NEW_EVENT_NAME=FIRST
! /EVENT_INSTANCE=0
! /EVENT_INSTANCE_AS_LIST=FALSE
! /RANGE_INSTANCE=0
/EVENT_SEQUENCE=ONE+TWO
! /EXCLUDE_EVENTS=
! /START_AT_EVENT=
! /END_AT_EVENT=
/FRAME_OFFSET=0
! /TIME_OFFSET=
! /PERCENT_OFFSET=
;
Event_Copy
/EVENT_NAME=TWO
/NEW_EVENT_NAME=FIRST
! /EVENT_INSTANCE=0
! /EVENT_INSTANCE_AS_LIST=FALSE
! /RANGE_INSTANCE=0
/EVENT_SEQUENCE=TWO+ONE
! /EXCLUDE_EVENTS=
! /START_AT_EVENT=
! /END_AT_EVENT=
/FRAME_OFFSET=0
! /TIME_OFFSET=
! /PERCENT_OFFSET=
;

Now, if you don't care the the missing event is created at the end of the file, you are done. To remove the event created at the end of the file we will create an event at the end of the file, and compare it with each of the other two events. If the event is at the end of the file, delete it.

Event_Explicit
/EVENT_NAME=EOF
! /FRAME=
/TIME=EOF
;
Conditional_Statement
/ITERATION_PARAMETER_NAME=INDEX
 /EXPRESSION=EVENT_LABEL::ORIGINAL::ONE = EVENT_LABEL::ORIGINAL::EOF
! /AS_INTEGER=TRUE
;
Event_Delete
/EVENT_NAME=ONE
! /EVENT_SEQUENCE=
! /EXCLUDE_EVENTS=
! /EVENT_INSTANCE=
! /TIME=
;
Conditional_Statement_End
/ITERATION_PARAMETER_NAME=INDEX
;
Conditional_Statement
/ITERATION_PARAMETER_NAME=INDEX2
 /EXPRESSION=EVENT_LABEL::ORIGINAL::TWO = EVENT_LABEL::ORIGINAL::EOF
! /AS_INTEGER=TRUE
;
Event_Delete
/EVENT_NAME=TWO
! /EVENT_SEQUENCE=
! /EXCLUDE_EVENTS=
! /EVENT_INSTANCE=
! /TIME=
;
Conditional_Statement_End
/ITERATION_PARAMETER_NAME=INDEX2
;

For most cases this same outcome can be accomplished more efficiently using the Event Create at Selected Event command shown below.

Event Between Examples

Event Create at Selected Event

Example: Identifying First and Last events from list

In this example, we create 3 random events at different frames using Event Explicit.

Then, Event Create at Selected Event is used to create a new event at the first or last event to occur from the original 3 events.

Creating events:

Event_Explicit
/EVENT_NAME=EVENT1
/FRAME=LIST(200,500,800)
! /TIME=
;

Event_Explicit
/EVENT_NAME=EVENT2
/FRAME=LIST(210,510,790)
! /TIME=
;

Event_Explicit
/EVENT_NAME=EVENT3
/FRAME=LIST(220,520,780)
! /TIME=
;

Creating event at first and last event:

Event_Create_At_Selected_Event
/NEW_EVENT_NAME=FIRST
/EVENT_NAMES=EVENT1+EVENT2+EVENT3
! /EVENT_SELECTION=1
! /EVENT_INSTANCE=0
! /EVENT_INSTANCE_AS_LIST=FALSE
! /RANGE_INSTANCE=0
! /EVENT_SEQUENCE=
! /EXCLUDE_EVENTS=
! /FRAME_OFFSET=0
! /TIME_OFFSET=
! /PERCENT_OFFSET=
;

Event_Create_At_Selected_Event
/NEW_EVENT_NAME=LAST
/EVENT_NAMES=EVENT1+EVENT2+EVENT3
/EVENT_SELECTION=-1
! /EVENT_INSTANCE=0
! /EVENT_INSTANCE_AS_LIST=FALSE
! /RANGE_INSTANCE=0
! /EVENT_SEQUENCE=
! /EXCLUDE_EVENTS=
! /FRAME_OFFSET=0
! /TIME_OFFSET=
! /PERCENT_OFFSET=
;

Example: Identifying end of windup in pitching motion

In this example, the Event Create at Selected Event command is used to create an event identifying the end of the windup in a pitching motion. Here we will use events marking the maximum horizontal abduction (retraction) of the throwing arm and the moment of left foot strike for a right handed pitcher. For some pitchers the foot strike occurs first, while max throwing arm retraction comes first for others.

Lead leg plant:

Automatic_Gait_Events
! /SELECT_X=FALSE
! /SELECT_Y=FALSE
! /SELECT_Z=TRUE
! /FRAME_WINDOW=8
 /USE_TPR=FALSE
;

Throwing arm horizontal abduction:

Event_Global_Minimum
/RESULT_EVENT_NAME=max_shoulder_horizontal_abduction
/SIGNAL_TYPES=LINK_MODEL_BASED
! /SIGNAL_FOLDER=ORIGINAL
/SIGNAL_NAMES=RT_SHOULDER_ANGLE
/SIGNAL_COMPONENTS=X
! /FRAME_OFFSET=0
! /TIME_OFFSET=
/EVENT_SEQUENCE=START+END
! /EXCLUDE_EVENTS=
! /EVENT_SEQUENCE_INSTANCE=0
! /EVENT_SUBSEQUENCE=
! /SUBSEQUENCE_EXCLUDE_EVENTS=
! /EVENT_SUBSEQUENCE_INSTANCE=0
! /THRESHOLD=
;

Determining time of first event:

Event_Create_At_Selected_Event
/NEW_EVENT_NAME=WINDUP_END
/EVENT_NAMES=MAX_SHOULDER_HORIZONTAL_ABDUCTION+LON
! /EVENT_SELECTION=1
! /EVENT_INSTANCE=0
! /EVENT_INSTANCE_AS_LIST=FALSE
! /RANGE_INSTANCE=0
/EVENT_SEQUENCE=START+END
! /EXCLUDE_EVENTS=
! /FRAME_OFFSET=0
! /TIME_OFFSET=
! /PERCENT_OFFSET=
;

For this pitcher the left foot plant occurs first at 0.803 seconds. The graph of the right shoulder adduction angle with events looks like so:

visual3d/documentation/pipeline/event_commands/event_examples.txt · Last modified: by mrobles