Change C++ code style: put curly brace on the same line

This commit is contained in:
Oleg Kalachev
2023-12-29 18:56:25 +03:00
parent 645b148564
commit d2296fea76
19 changed files with 65 additions and 130 deletions

View File

@@ -9,22 +9,19 @@
#define ONE_G 9.807f
#define WEIGHT_ACC 0.5f
void estimate()
{
void estimate() {
applyGyro();
applyAcc();
signalizeHorizontality();
}
void applyGyro()
{
void applyGyro() {
// applying gyro
attitude *= Quaternion::fromAngularRates(rates * dt);
attitude.normalize();
}
void applyAcc()
{
void applyAcc() {
// test should we apply accelerometer gravity correction
float accNorm = acc.norm();
bool landed = !motorsActive() && abs(accNorm - ONE_G) < ONE_G * 0.1f;
@@ -40,8 +37,7 @@ void applyAcc()
attitude.normalize();
}
void signalizeHorizontality()
{
void signalizeHorizontality() {
float angle = Vector::angleBetweenVectors(attitude.rotate(Vector(0, 0, -1)), Vector(0, 0, -1));
setLED(angle < 15 * DEG_TO_RAD);
}