Use FLU as the main coordinate system instead of FRD

Corresponding to the IMU orientation in the new version
This commit is contained in:
Oleg Kalachev
2024-10-23 09:30:49 +03:00
parent f46460e53d
commit abcc9b96de
7 changed files with 27 additions and 32 deletions

View File

@@ -36,7 +36,7 @@ void applyAcc() {
if (!landed) return;
// calculate accelerometer correction
Vector up = attitude.rotate(Vector(0, 0, -1));
Vector up = attitude.rotate(Vector(0, 0, 1));
Vector correction = Vector::angularRatesBetweenVectors(acc, up) * dt * WEIGHT_ACC;
// apply correction
@@ -45,6 +45,6 @@ void applyAcc() {
}
void signalizeHorizontality() {
float angle = Vector::angleBetweenVectors(attitude.rotate(Vector(0, 0, -1)), Vector(0, 0, -1));
float angle = Vector::angleBetweenVectors(attitude.rotate(Vector(0, 0, 1)), Vector(0, 0, 1));
setLED(angle < radians(15));
}