mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 01:41:36 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user