Table of Contents
Event Create at Selected Event
Overview
The Event Create at Selected Event command can be used to create a new event at the location of an existing event within a specified list of events based on their order. This can be useful when defining events or positions for corresponding thresholds that may not always occur in the same order. One example of this could be defining the downswing in a golf swing which may start with a change in shaft angular velocity for some golfers or hip angular velocity for others. This command can be used to create an event marking the start of the downswing at whichever event occurs first or last.
Pipeline Command
The command can be found in the Pipeline Workshop under Event Creation as so:
Event_Create_At_Selected_Event /NEW_EVENT_NAME=TEST /EVENT_NAMES= ! /EVENT_SELECTION= ! /EVENT_INSTANCE=0 ! /EVENT_INSTANCE_AS_LIST=FALSE ! /RANGE_INSTANCE=0 ! /EVENT_SEQUENCE= ! /EXCLUDE_EVENTS= ! /FRAME_OFFSET=0 ! /TIME_OFFSET= ! /PERCENT_OFFSET= ;
Command Parameters
The following table shows the command parameters seen above and their descriptions:
| NEW_EVENT_NAME | Name of the new event to be created |
| EVENT_NAMES | Name of event(s) for new event to be created at |
| EVENT_SELECTION | Specify where in the order of events (from EVENT_NAMES) a new event is to be created at (1/-1 for first/last, 2 for second, etc.) |
| EVENT_INSTANCE | Defines how many event occurrences to consider (0 = all, 1 = first, etc.). |
| EVENT_INSTANCE_AS_LIST | Indicates whether the event instance is treated as a list. |
| RANGE_INSTANCE | Specifies which instance of an event range should be used |
| EVENT_SEQUENCE | A list of events (separated by “+” signs). For example, LHS+RTO |
| EXCLUDE_EVENTS | Specifies events that should not be copied, allowing more refined duplication |
| FRAME_OFFSET | The number of frames by which to offset the copied event |
| TIME_OFFSET | The time offset (in seconds) to apply to the copied event |
| PERCENT_OFFSET | A percentage offset relative to a defined event range |
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 top of back swing (P4) for a golf swing
There are generally 10 agreed upon key positions in the golf swing, labelled as P1-P10. The top of the backswing (P4) is loosely defined and can be determined using several signals, which sometimes occur in a different order for different golfers. Here we use Event Threshold, Event Global Maximum, and Event Create at Selected Event to determine 3 positions that could define the end of the backswing, then identify which position occurs in between the other 2 as a means of defining P4.
First, the start of the backswing is defined by identifying the moment at which the clubhead begins moving away from the target:
Event_Threshold /RESULT_EVENT_NAME=Backswing_Start /SIGNAL_TYPES=KINETIC_KINEMATIC /SIGNAL_FOLDER=CLUB_HEAD /SIGNAL_NAMES=CGVel /SIGNAL_COMPONENTS=X ! /FRAME_OFFSET=0 ! /TIME_OFFSET= ! /EVENT_SEQUENCE= ! /EXCLUDE_EVENTS= ! /EVENT_SEQUENCE_INSTANCE=0 ! /EVENT_SUBSEQUENCE= ! /SUBSEQUENCE_EXCLUDE_EVENTS= ! /EVENT_SUBSEQUENCE_INSTANCE=0 /EVENT_INSTANCE=1 /THRESHOLD=-0.1 /ON_ASCENT=FALSE /ON_DESCENT=TRUE ! /FRAME_WINDOW=8 ! /ENSURE_FRAMES_BEFORE=FALSE ! /ENSURE_FRAMES_AFTER=FALSE ;
Next, the moment of impact is defined using event explicit to label the frame at which the club impacts the ball:
Event_Explicit /EVENT_NAME=Impact /FRAME=1013 ! /TIME= ;
The first potential P4 position we'll identify is when the clubhead stops moving towards the target at the top of the swing and changes direction:
Event_Threshold /RESULT_EVENT_NAME=Clubhead_zero_vel /SIGNAL_TYPES=KINETIC_KINEMATIC /SIGNAL_FOLDER=CLUB_HEAD /SIGNAL_NAMES=CGVel /SIGNAL_COMPONENTS=X ! /FRAME_OFFSET=0 ! /TIME_OFFSET= /EVENT_SEQUENCE=Backswing_Start+Impact ! /EXCLUDE_EVENTS= ! /EVENT_SEQUENCE_INSTANCE=0 ! /EVENT_SUBSEQUENCE= ! /SUBSEQUENCE_EXCLUDE_EVENTS= ! /EVENT_SUBSEQUENCE_INSTANCE=0 ! /EVENT_INSTANCE=0 /THRESHOLD=0.0 /ON_ASCENT=FALSE /ON_DESCENT=TRUE ! /FRAME_WINDOW=8 ! /ENSURE_FRAMES_BEFORE=FALSE ! /ENSURE_FRAMES_AFTER=FALSE ;
Next, the moment at which the grip's angular velocity relative to the lab changes in direction is identified:
Event_Threshold /RESULT_EVENT_NAME=Grip_zero_ang_vel /SIGNAL_TYPES=KINETIC_KINEMATIC /SIGNAL_FOLDER=CLUB_GRIP /SIGNAL_NAMES=AngVel /SIGNAL_COMPONENTS=Y ! /FRAME_OFFSET=0 ! /TIME_OFFSET= /EVENT_SEQUENCE=Backswing_Start+Impact ! /EXCLUDE_EVENTS= ! /EVENT_SEQUENCE_INSTANCE=0 ! /EVENT_SUBSEQUENCE= ! /SUBSEQUENCE_EXCLUDE_EVENTS= ! /EVENT_SUBSEQUENCE_INSTANCE=0 ! /EVENT_INSTANCE=0 /THRESHOLD=0.0 /ON_ASCENT=FALSE /ON_DESCENT=TRUE /FRAME_WINDOW=10 ! /ENSURE_FRAMES_BEFORE=FALSE /ENSURE_FRAMES_AFTER=TRUE ;
The last of the three potential top of backswing events is when the hands reach their highest point, measured here using the position of the proximal end of the grip:
Event_Global_Maximum /RESULT_EVENT_NAME=Prox_Grip_Z_Max /SIGNAL_TYPES=KINETIC_KINEMATIC /SIGNAL_FOLDER=CLUB_GRIP /SIGNAL_NAMES=CGPos /SIGNAL_COMPONENTS=Z ! /FRAME_OFFSET=0 ! /TIME_OFFSET= /EVENT_SEQUENCE=Backswing_Start+Impact ! /EXCLUDE_EVENTS= ! /EVENT_SEQUENCE_INSTANCE=0 ! /EVENT_SUBSEQUENCE= ! /SUBSEQUENCE_EXCLUDE_EVENTS= ! /EVENT_SUBSEQUENCE_INSTANCE=0 ! /EVENT_INSTANCE=0 ! /FRAME_WINDOW=8 ! /THRESHOLD= ;
Finally, we identify the middle of these 3 events by setting EVENT_SELECTION to 2. The first of these 3 events could be selected by setting the value to 1, or the last by setting the value to 3 or -1.
Event_Create_At_Selected_Event /NEW_EVENT_NAME=BACKSWING_TOP /EVENT_NAMES=CLUBHEAD_ZERO_VEL+PROX_GRIP_Z_MAX+Grip_zero_ang_vel /EVENT_SELECTION=2 !/EVENT_INSTANCE=1 !/EVENT_INSTANCE_AS_LIST=FALSE ! /RANGE_INSTANCE=0 !/EVENT_SEQUENCE=BACKSWING_START+IMPACT ! /EXCLUDE_EVENTS= ! /FRAME_OFFSET=0 ! /TIME_OFFSET= ! /PERCENT_OFFSET= ;
The resulting top of backswing event occurs at 1.29s which corresponds to the Clubhead_zero_vel event. The 5 events on a graph of the clubhead velocity in x look like so:
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:



