sensor_combined: replace accel & gyro integral with value, use float for dt

Reason: the value is easier to read & handle (for example plotting). In
most places the value is needed, not the integral.

Note that this breaks the replay format for sdlog2 replay
This commit is contained in:
Beat Küng
2016-07-07 11:35:50 +02:00
committed by Lorenz Meier
parent 8e136779ec
commit 9c73eae941
19 changed files with 154 additions and 202 deletions
@@ -67,11 +67,7 @@ void TerrainEstimator::predict(float dt, const struct vehicle_attitude_s *attitu
{
if (attitude->R_valid) {
matrix::Matrix<float, 3, 3> R_att(attitude->R);
matrix::Vector<float, 3> a;
float accel_dt = sensor->accelerometer_integral_dt / 1.e6f;
a(0) = sensor->accelerometer_integral_m_s[0] / accel_dt;
a(1) = sensor->accelerometer_integral_m_s[1] / accel_dt;
a(2) = sensor->accelerometer_integral_m_s[2] / accel_dt;
matrix::Vector<float, 3> a(sensor->accelerometer_m_s2);
matrix::Vector<float, 3> u;
u = R_att * a;
_u_z = u(2) + 9.81f; // compensate for gravity