mirror of
https://github.com/SlimeVR/SlimeVR-Tracker-ESP.git
synced 2026-04-06 02:01:57 +02:00
* Clean up sensorbuilder * Join namespaces declarations * Formatting * Change around defines * Add missing include * Change primary/secondary logic to booleans * Formatting * Undo defines changes * Fix messed up code * Fix some compiler warnings * Formatting * Update src/sensorinterface/i2cimpl.h Co-authored-by: unlogisch04 <98281608+unlogisch04@users.noreply.github.com> * Send BMI firmware to progmem * Formattign * Rework getRegisterInterface logic
36 lines
759 B
C++
36 lines
759 B
C++
#include "SensorFusionRestDetect.h"
|
|
|
|
namespace SlimeVR::Sensors {
|
|
#if !SENSOR_FUSION_WITH_RESTDETECT
|
|
void SensorFusionRestDetect::updateAcc(
|
|
const sensor_real_t Axyz[3],
|
|
sensor_real_t deltat
|
|
) {
|
|
if (deltat < 0) {
|
|
deltat = accTs;
|
|
}
|
|
restDetection.updateAcc(deltat, Axyz);
|
|
SensorFusion::updateAcc(Axyz, deltat);
|
|
}
|
|
|
|
void SensorFusionRestDetect::updateGyro(
|
|
const sensor_real_t Gxyz[3],
|
|
sensor_real_t deltat
|
|
) {
|
|
if (deltat < 0) {
|
|
deltat = gyrTs;
|
|
}
|
|
restDetection.updateGyr(Gxyz);
|
|
SensorFusion::updateGyro(Gxyz, deltat);
|
|
}
|
|
#endif
|
|
|
|
bool SensorFusionRestDetect::getRestDetected() {
|
|
#if !SENSOR_FUSION_WITH_RESTDETECT
|
|
return restDetection.getRestDetected();
|
|
#elif SENSOR_USE_VQF
|
|
return vqf.getRestDetected();
|
|
#endif
|
|
}
|
|
} // namespace SlimeVR::Sensors
|