diff options
author | HampusM <hampus@hampusmat.com> | 2021-12-27 13:40:45 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2021-12-27 13:40:45 +0100 |
commit | 3d57d0e836a7ee6512dc04ebd46b1e0eff97b5c9 (patch) | |
tree | dd212bd3624681bc876c9b3c01bc5f1d22771fc4 | |
parent | e5b34cbb3d6764cc9a7d3e6d4c27da468f16246f (diff) |
refactor: delete useless sensor var _accel_z
-rw-r--r-- | src/sensor.cpp | 3 | ||||
-rw-r--r-- | src/sensor.hpp | 2 |
2 files changed, 1 insertions, 4 deletions
diff --git a/src/sensor.cpp b/src/sensor.cpp index 23edc17..9d4157e 100644 --- a/src/sensor.cpp +++ b/src/sensor.cpp @@ -66,7 +66,6 @@ void Sensor::reset() _accel_x = 0; _accel_y = 0; - _accel_z = 0; _pitch = 0; _roll = 0; @@ -135,8 +134,6 @@ bool Sensor::read() _accel_y = atan(-1.0 * _accel_raw_x / sqrt(accel_y_pow_two + accel_z_pow_two)) * RAD_TO_DEGREES; - _accel_z = - atan(_accel_raw_z / sqrt(accel_x_pow_two + accel_y_pow_two)) * RAD_TO_DEGREES; // Convert raw Gyro to degrees/s _gyro_raw_x *= _ang_rate_to_dps; diff --git a/src/sensor.hpp b/src/sensor.hpp index 07b8f95..72ff396 100644 --- a/src/sensor.hpp +++ b/src/sensor.hpp @@ -171,7 +171,7 @@ private: float _accel_to_g_force; float _accel_raw_x, _accel_raw_y, _accel_raw_z; - float _accel_x, _accel_y, _accel_z; + float _accel_x, _accel_y; uint8_t _gyro_sensitivity; float _ang_rate_to_dps; |