Differences between acceleration data and getting correct data via Mavsdk


I am trying to get filtered (not raw) acceleration data at about 100 hz with latency preferably no more than 5 ms. There are some uORB messages. I understand that estimator_local_position and vehicle_local_acceleration are not appropriate. On the other hand, other options seem usable. Frequencies are not same but when I examined logs it seems that vehicle_acceleration has some latency compared to sensor_accel and sensor_combined.

  1. Is that delay due to EKF bias correction?

  2. Which acceleration data is used in control loops?

  3. How can I get the acceleration data that is used in control loops via Mavlink/Mavsdk?

I searched for the answers but I couldn’t clarify. Thanks for the answers.

@bresch you might know the answers. Could you please help? Thanks in advance.

Hi @acnrk ,

  • estimator_local_position.ax is the derivative of the estimated North-East velocity (in value in the local frame)
  • sensor_accel is the raw accel data in the sensor frame (can be different from the body frame, defined by the sensor rotation)
  • sensor_combined contains the value in body frame from the primary sensors (highest priority), calibrated (from user calibration, not using the estimated bias from the EKF, and downsampled by averaging to ~250Hz. This is the data used by EKF2
  • vehicle_acceleration is the accel data rotated in body frame. calibrated, compensated using the bias estimated by EKF2 and filtered using IMU_ACCEL_CUTOFF

In PX4 we only need the acceleration for the velocity control loop that runs in the local frame. There we use the derivative of the local position estimate.
For a fast control loop in body-frame, you should use vehicle_acceleration as this is high rate data with everything calibrated, compensated and filtered.

I hope it helped