Acceleration is presumably relative to the current orientation.

This commit is contained in:
Andrzej Kapolka 2013-06-06 14:08:53 -07:00
parent 9afb1b3338
commit d87e165b06

View file

@ -260,7 +260,8 @@ void SerialInterface::readData(float deltaTime) {
} else {
// Use gravity reading to do sensor fusion on the pitch and roll estimation
estimatedRotation = safeMix(estimatedRotation,
rotationBetween(_gravity, _lastAcceleration) * estimatedRotation, 1.0f / SENSOR_FUSION_SAMPLES);
rotationBetween(estimatedRotation * _lastAcceleration, _gravity) * estimatedRotation,
1.0f / SENSOR_FUSION_SAMPLES);
}
}