3. Exercise Management
Before interacting with the API endpoints or the Portal redirects, it is essential to understand the core data structure of an Exercise within the Exercise-Engine.
3.1. The Exercise Object Structure
An Exercise object defines the metadata, the required starting posture, and the specific body parts the Portal needs to track. To keep your integration as simple as possible, the heavy lifting of biomechanical calculations is handled internally by the Portal. You as programmer only need to be familiar with the following high-level structure:
label(String): The display name of the exercise (e.g., "Bicep Curl").posture(String): The expected starting position of the user. Common values includestanding,sitting,sleeping1, orsleeping2.exerciseKey(String): The unique identifier for this exercise. You will use this key across all API requests and Portal redirects.description(String): Textual instructions or details guiding the user.cameras(Object): Contains the tracking configurations that dictate what the Portal observes.jointConfig: A key-value map representing the active joints being tracked and evaluated during the movement.conditionConfig: A list of custom conditions.distances: A list of defined distances and measurements.
Sample Exercise JSON Payload
{
"label": "Bicep Curl",
"posture": "standing",
"exerciseKey": "ex_742891k",
"description": "Keep your back straight and curl the weights towards your shoulders.",
"cameras": {
"front": {
"jointConfig": {
"Right Elbow": {}, /* each active joint has a key here */
"Right Shoulder": {}
},
"conditionConfig": [
/* Custom conditions place holder */
],
"distances": [
/* Custom distances place holder */
]
}
}
}Supported Joint Names
When an exercise is configured, the jointConfig keys and condition parameters reference specific tracking points on the human body. Below is the comprehensive list of supported joint identifiers recognized by the engine:
export enum JointName {
MODEL = 'Model',
HEAD = 'Head',
WAIST = 'Waist',
LEFT_SHOULDER_KNEE = 'Left Knee_Shoulder',
RIGHT_SHOULDER_KNEE = 'Right Knee_Shoulder',
LEFT_SHOULDER = 'Left Shoulder',
RIGHT_SHOULDER = 'Right Shoulder',
LEFT_ELBOW = 'Left Elbow',
RIGHT_ELBOW = 'Right Elbow',
LEFT_WRIST = 'Left Wrist',
RIGHT_WRIST = 'Right Wrist',
LEFT_HIP = 'Left Hip',
RIGHT_HIP = 'Right Hip',
LEFT_KNEE = 'Left Knee',
RIGHT_KNEE = 'Right Knee',
LEFT_ANKLE = 'Left Ankle',
RIGHT_ANKLE = 'Right Ankle'
}Camera Modes
The CameraMode defines the expected physical placement of the camera relative to the user. Validating the correct camera angle ensures the tracking engine can observe the required joints accurately.
front: The user faces the camera directly.left: The camera captures the user's left profile.right: The camera captures the user's right profile.
export type CameraMode = 'front' | 'left' | 'right';Supported Postures
The posture field dictates the starting position of the user before the engine begins tracking the movement.
export type PostureType = 'standing' | 'sitting' | 'sleeping1' | 'sleeping2';