forked from WEARTHaptics/WEART-SDK-Cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
WeArtTrackingCalibration.h
40 lines (31 loc) · 1.05 KB
/
WeArtTrackingCalibration.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include "WeArtCommon.h"
#include "WeArtMessageListener.h"
#include <functional>
//! @brief Calibration status/result observer
class WeArtTrackingCalibration : public WeArtMessageListener {
public:
WeArtTrackingCalibration();
HandSide getCurrentHand() {
return currentHand;
}
CalibrationStatus getStatus() {
return status;
}
bool getResult() {
return result;
}
//! @brief Adds a callback for calibration status update
//! @param callback Callback called on calibration status update
void AddStatusCallback(std::function<void(HandSide, CalibrationStatus)> callback);
//! @brief Adds a callback for calibration result
//! @param callback Callback called when a calibration result is received
void AddResultCallback(std::function<void(HandSide, bool)> callback);
private:
void OnMessageReceived(WeArtMessage* message) override;
HandSide currentHand;
CalibrationStatus status;
bool result;
std::vector<std::function<void(HandSide, CalibrationStatus)>> statusCallbacks;
std::vector<std::function<void(HandSide, bool)>> resultCallbacks;
};