Record Measurement
Init
To make a measurement first you need to obtain a NotchWorkout
object. You need for this a skeleton and a workout descriptor. See skeleton & workout loading in the utils.
The default configuration for the chest and the skeleton can be found in the tutorial application after you have a valid licence code by buying one of our kit.
Init workout
Workout is the measurement setting for tracking pre-set motion or group of motions (e.g. baseball swing, punching drill, shoulder mobility test). Workout is the core element of Notch-compatible app architecture.
let workout = NotchWorkout.from(
name: "The name of the measurement",
skeleton: NotchSkeleton.from(
configJsonString: stringSkeletonJson),
configString: workoutJson)
Then you can:
- Either call
NotchService.initWithWorkout(...)
with the created workout - Call with channel setting if its possible that more than one Notch networks are around:
NotchService.initWithChannelAndWorkout(...)
.
Wait until succeess, progress can be showed based on the progress callbacks parameter. After connection your devices are tight to the bones they will measure.
Steady
Steady phase is a brief sensor alignment procedure user must perform at the very beginning of the recording session. During steady phase user must stand with the arms straightened and legs shoulder-width for about 2 seconds. Once steady phase is complete user can perform as many recordings as necessary until they remove or move the Notch sensors.
Notches store their previous steady information in the NotchDevice
object. Please make sure you either start from the very same pose and placement every time or the data could be corrupted and the visualisation might fail to render correctly.
We highly suggest you to refresh the steady pose before each measurement.
- Call
NotchService.configureSteady(...)
.- To color the notches you should pass true to the
isShowingColors
parameter. - The user has to attach the notches to his/her body according to the specified colors.
- To color the notches you should pass true to the
- Call
NotchService..steady(...)
and wait for the result.- The user has to stay in the steady pose still until the ‘success’ or ‘failure’ callback is called.
- Upon success call
NotchService.getSteadyData(...)
to verify the results
Capture
You have various options to start a capture:
- Time capture:
Before the start you configure how long this measurement will take. After the specified timeout has reached all the notches will be stopped.- There is no real time feedback.
- Can be configured to work as a remote (device disconnection will not interrupt your current measurement)
- Stopwatch capture:
After you have started your measurement you can stop it any time.- There is no real time feedback.
- Real time capture:
After the start you receive periodically the recorded and processed measurement data. If the notches reach out of sight the operation stops.- This can be done with a maximum of 3 notches.
After option 1 & 2 you receive a NotchMeasurement
on success which contains useful information about the latest measurement.
See more at download
Timed capture
- Call
NotchService.configureTimedCapture(...)
and wait for the success callback. - Call
NotchService.timedCapture(...)
, the success/failure callbacks are called after the timer ends. - Do your measurement
Remote timed capture
- Call
NotchService.configureTimedCapture(...)
and wait for the success callback. - Call
NotchService.remoteCapture(...)
, the success/failure callbacks are called immediately. - Do your measurement
Upon success you get a NotchMeasurement
object of the calculated final state. If something goes wrong (for example a Notch turned off) this measurement file will contain bad information.
Capture with stopwatch
- Call
NotchService.configureCapture(...)
and wait for the success callback. - Call
NotchService.capture(...)
, the success/failure callbacks are called after start. - Do your measurement
- Stop the measurement by calling
NotchService.stop(...)
.
Real time
During a real time capture the notches send a NotchVisualiserData
object of the current state.
The process is same as for the stopwatch capture however you should not call stop at the end. Rather simply cancel the measurmenet to finish it.
In the progress callback of the ‘capture’ call of the service the ‘NotchProgress’ object’s ‘realtimeData’ field is the current timeframe’s visualiser data.
Download a measurement
Great, by now you should know how to properly create a measurement. In order to download them store the NotchMeasurement
from the success block of the capture or the stop operation.
Immediate download
With the newly acquired object start the download:
- Call the
download
operation with your desired target url - Wait for the success
Later download
The recorded measurement contains various information about the workout. In order to properly save the data later you should serialize the result to file.
Save measurement information
- Call the
serializeMeasurement
operation with your desired target url - Save this url somewhere for later use
Load measurement information
- Call the
deserializeMeasurement
operation with your desired source url - Make sure all of the notches you made the measurement with are turned on
- Use the loaded object to download the measurements from the devices. See immediate download
Check the results
By acquiring the NotchMeasurement
object of your recording you can check whether any of the sensors have become corrupted. For this, load the getStatus()
method of the measurement and check its values whether contains the phrase: Sensor Test
.
If so, we highly suggest you to make a new sensor test in order to calibrate the offsets of your sensors. Check NotchService.getSensorTestData(...)
.