Showing the changes to interface/src/SerialInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -260,7 +260,8 @@ void SerialInterface::readData(float deltaTime) { · 259 unmodified lines | ||
| 260 | 260 | } else { |
| 261 | 261 | // Use gravity reading to do sensor fusion on the pitch and roll estimation |
| 262 | 262 | estimatedRotation = safeMix(estimatedRotation, |
| 263 | − rotationBetween(_gravity, _lastAcceleration) * estimatedRotation, 1.0f / SENSOR_FUSION_SAMPLES); | |
| 263 | + rotationBetween(estimatedRotation * _lastAcceleration, _gravity) * estimatedRotation, | |
| 264 | + 1.0f / SENSOR_FUSION_SAMPLES); | |
| 264 | 265 | } |
| 265 | 266 | } |
| 266 | 267 | |