Version: 1.6.0

Listener

The Listener interface contains event driven callback methods. Implementing the listener interface allows you to receive the event data containing important information. These callbacks are called on different occasions and allow you to structure your application' logic accordingly. Usually the listener will pass a custom event object, containing the current analyser instance, as well as useful data corresponding to the occurred event. It is important to note here that there is no fixed sequence of callbacks meaning there is no guarantee that for example a PoseEvent is always received before a MetricValuesEvent. A detailed documentation about the Listener can be found in the Javadocs reference.

onReady

Event: ReadyEvent

This event is called when the analyser has successfully established a connection with the server and the exercise has been successfully configured. In order for this to happen you must first create an Analyser instance, during which the client will attempt to set up a connection.

onPose

Event: PoseEvent

The PoseEvent is called when the human pose estimation analysed an image and returns the results. The event includes a Pose, that contains the Point for each BodyPointType.

Pose

  • Point - The key point containing a double for the X-coordinate, Y-coordinate and confidence score for each BodyPointType.
public enum BodyPointType
{
    NOSE,
    NECK,
    LEFT_EAR,
    RIGHT_EAR,
    LEFT_EYE,
    RIGHT_EYE,
    LEFT_SHOULDER,
    RIGHT_SHOULDER,
    LEFT_ELBOW,
    RIGHT_ELBOW,
    LEFT_WRIST,
    RIGHT_WRIST,
    LEFT_HIP,
    RIGHT_HIP,
    LEFT_KNEE,
    RIGHT_KNEE,
    LEFT_ANKLE,
    RIGHT_ANKLE,
    MID_HIP,
}

onMetricValues

Event: MetricValuesEvent

This event is called when metric values are received from the movement analysis. The event includes a list of MetricValues. A MetricValue is described by a value that belongs to a Metric and its confidence score.

onFeedback

Event: FeedbackEvent

The FeedbackEvent is received when a movement violation has been detected. The event contains a list of all Feedback, where each Feedback is linked to a Metric and includes a Key, Name and a list of possible feedback messages.

onActivity

Event: ActivityEvent

After every recognized activity, an ActivityEvent provides the Activity and a list of all Feedback that were received during the activity.

The Activity can be one of the following:

  • Repetition: The exercise was completed once with a full range. The repetition summary furthermore contains the repetition Duration.
  • Attempt: The exercise was performed but the range of motion or form deviated too much from the target exercise that it is not considered a repetition but only an attempt.

onRepetition

Event: RepetitionEvent

After every recognized repetition, a RepetitionEvent providing the Duration of the repetition and a list of all Feedback that were received during the duration. This event holds the same information as the onActivity event if a repetition is detected.

onError

Event: ErrorEvent

If an error occurs, the ErrorEvent is described by an ErrorText. The error is further grouped into one of the following ErrorType.

enum ErrorType
{
    SERVER_ERROR,
    INVALID_INPUT,
    CONNECTION_ERROR,
    TIMEOUT,
    OTHER,
}

onStop

No Event

onStop is called when the analyser has been stopped and no further images can be submitted to the server for analysis.

onSessionQualityChanged

Event: SessionQualityChangedEvent

The session quality quantifies the LATENCY and the ENVIRONMENT. If one of these subjects changes, the SessionQualityChangedEvent is called where the new ratings for both subjects are provided. More details how to interpret the session quality can be found on a separate page. Possible qualities are:

  • NONE: No quality information available yet.
  • BAD: The quality may impair the movement analysis. We cannot guarantee a good performance.
  • OK: The quality is good enough to perform the movement analysis, but the accuracy can be affected.
  • GOOD: The quality is optimal and enables the movement analysis.

onSessionStateChanged

Event: SessionStateChangedEvent

When the session state changes, the SessionStateChangedEvent is received with the new SessionState. The SessionState can be in one of the following states:

  • NO_HUMAN: No human can be recognized in the provided image.
  • POSITIONING: The starting position has not been reached by the user.
  • EXERCISING: The starting position was reached by the user and the exercise is running.

results matching ""

    No results matching ""