Skip to content

Commit ffb1050

Browse files
committed
make format
1 parent f7bb518 commit ffb1050

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/modules/baro_thrust_estimator/BaroThrustEstimator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void BaroThrustEstimator::Run()
182182

183183
// Compute upward linear acceleration and CF residual
184184
const float accel_up = BaroThrustCfRls::computeAccelUp(
185-
matrix::Vector3f{accel.xyz}, matrix::Quatf{att.q});
185+
matrix::Vector3f{accel.xyz}, matrix::Quatf{att.q});
186186

187187
const float residual = _estimator.updateCf(air_data.baro_alt_meter, accel_up, dt);
188188

src/modules/baro_thrust_estimator/baro_thrust_cf_rls.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void BaroThrustCfRls::reset()
5151
}
5252

5353
float BaroThrustCfRls::computeAccelUp(const matrix::Vector3f &accel_body,
54-
const matrix::Quatf &attitude)
54+
const matrix::Quatf &attitude)
5555
{
5656
// Rotate body-frame specific force to NED, extract Z component
5757
const float specific_force_ned_z = (attitude.rotateVector(accel_body))(2);
@@ -186,8 +186,8 @@ void BaroThrustCfRls::RlsEstimator::update(float residual, float thrust, float d
186186
const float e = residual - (theta[0] * phi[0] + theta[1] * phi[1]);
187187

188188
const float Pphi[2] = {
189-
P[0][0] * phi[0] + P[0][1] * phi[1],
190-
P[1][0] * phi[0] + P[1][1] * phi[1]
189+
P[0][0] *phi[0] + P[0][1] *phi[1],
190+
P[1][0] *phi[0] + P[1][1] *phi[1]
191191
};
192192

193193
const float phiPphi = phi[0] * Pphi[0] + phi[1] * Pphi[1];

src/modules/baro_thrust_estimator/baro_thrust_cf_rls.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
#include <cmath>
8383
#include <float.h>
8484

85-
class BaroThrustCfRls {
85+
class BaroThrustCfRls
86+
{
8687
public:
8788
// --- RLS tuning ---
8889
static constexpr float RLS_LAMBDA = 0.998f; ///< forgetting factor (1.0 = never forget, lower = adapt faster)
@@ -109,8 +110,8 @@ class BaroThrustCfRls {
109110
* P is the 2x2 parameter covariance matrix.
110111
*/
111112
struct RlsEstimator {
112-
float theta[2]{}; ///< [K, bias] parameter estimates
113-
float P[2][2]{}; ///< 2x2 parameter covariance
113+
float theta[2] {}; ///< [K, bias] parameter estimates
114+
float P[2][2] {}; ///< 2x2 parameter covariance
114115
float error_var{ERROR_VAR_INIT}; ///< exponentially-weighted prediction error variance
115116

116117
void reset(float p_init);

src/modules/baro_thrust_estimator/baro_thrust_cf_rls_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ TEST_F(BaroThrustCfRlsTest, AccelUpAscending)
8484
TEST_F(BaroThrustCfRlsTest, AccelUpTilted45Hover)
8585
{
8686
const float theta = 45.f * 3.14159265f / 180.f;
87-
const Vector3f accel_body{CONSTANTS_ONE_G *sinf(theta), 0.f, -CONSTANTS_ONE_G *cosf(theta)};
87+
const Vector3f accel_body{CONSTANTS_ONE_G * sinf(theta), 0.f, -CONSTANTS_ONE_G * cosf(theta)};
8888
const Quatf attitude{Eulerf{0.f, theta, 0.f}};
8989

9090
const float accel_up = BaroThrustCfRls::computeAccelUp(accel_body, attitude);

0 commit comments

Comments
 (0)