mirror of
https://github.com/okalachev/flix.git
synced 2026-02-18 08:02:36 +00:00
Use FLU as the main coordinate system instead of FRD
Corresponding to the IMU orientation in the new version
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user