mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-06 06:43:21 +08:00
ekf2: correct control state message for 3D acc bias
This commit is contained in:
committed by
Lorenz Meier
parent
6ef2e4c9b2
commit
7f1632d65b
@@ -560,11 +560,11 @@ void Ekf2::task_main()
|
||||
// Acceleration data
|
||||
matrix::Vector<float, 3> acceleration = {&sensors.accelerometer_m_s2[0]};
|
||||
|
||||
float accel_bias = 0.0f;
|
||||
_ekf.get_accel_bias(&accel_bias);
|
||||
ctrl_state.x_acc = acceleration(0);
|
||||
ctrl_state.y_acc = acceleration(1);
|
||||
ctrl_state.z_acc = acceleration(2) - accel_bias;
|
||||
float accel_bias[3];
|
||||
_ekf.get_accel_bias(accel_bias);
|
||||
ctrl_state.x_acc = acceleration(0) - accel_bias[0];
|
||||
ctrl_state.y_acc = acceleration(1) - accel_bias[1];
|
||||
ctrl_state.z_acc = acceleration(2) - accel_bias[2];
|
||||
|
||||
// compute lowpass filtered horizontal acceleration
|
||||
acceleration = R_to_body.transpose() * acceleration;
|
||||
|
||||
Reference in New Issue
Block a user