Note that when using the Java API, all relevant classes are located within the
ai.vay.client.api package, except for the
which are located in the
ai.vay.client package. There is no need to interact
with any other classes/packages, than the aforementioned.
The following section outlines how to interact with our movement analysis service. Firstly, Analyser has to be created, where a specific exercise can be configured. The API is written based on an event Listener that can be added to the Analyser. Throughout an exercise, our movement analysis service provides information about the user's session state that is further explained in a separate page. When an event is triggered by the API, relevant information is received within the event data. In the following section, the most relevant event data are highlighted briefly.
The most basic output from the VAY service is the human pose, which is estimated
by our AI algorithm. The positions are stored for each body point within the
PoseEvent and are provided by the
onPose callback in the
points are useful for visualization and custom analysis.
For every metric that is tracked during the configured exercise, the API returns
a detailed analysis with the
onMetricValues callback containing the
value and the metric that the value belongs to. For a ROM metric, the
value can e.g. be used to obtain the user's ROM of a movement.
onFeedback callback provides feedback immediately after our AI algorithm
has detected an undesired body position. For example, if the user squats too
low, the corrective feedback is sent before the user is again in an upright
position where the repetition is completed. This can occur each time the user
reaches this undesired position.
After an exercise is completed, a summary with all feedback that were collected
during the activity are sent with the
onActivity callback. The activity
performed by the user is classified into either a
Repetition, where the
exercise is completed with a full range, or an
Attempt, where the user's range
of motion or form deviated too much from the target exercise. Hence the purpose
Attempt is to inform the user that the movement was recognized and what
is missing to be counted as repetition.
If a counter is used to show the number of repetitions, we recommend to only consider repetitions in the counter and not attempts.
Assume you are using the Java API to analyse a squat. An example of proper
alignment of a squat is keeping the back upright during execution to prevent
injuries. Therefore, the AI checks if the metric, specifically the angle between
the back and the vertical axis, is in the desired range. With the
onMetricValues callback, the API returns an understandable value for this
metric that is checked. Furthermore, one can see if the user does not keep the
back in an upright position by listening to the
onFeedback callback or the
onActivity callback. The
onActivity callback summarises all feedback after
the activity is complete, and classifies the activity into a
Repetition or an
Attempt. Finally, the corrective feedback would be
"Keep your torso upright".