Home        Store        Learn        Blog

Extract acceleration information

Hi, i konw we can get information from PIX by python. And i have get some information,such as pitch,pitchspeed.I want to know can we get acceleration and angular acceleration information in three directions.If so,what is the type in the code?
master.recv_match(type='ATTITUDE', blocking=True).to_dict()

Hi @Richard1,
I believe you’re after SCALED_IMU2, as covered here:

SCALED_IMU2 includes linear acceleration and angular velocity - I don’t believe angular acceleration gets measured (since gyroscopes directly measure rotational velocity, not acceleration).

I try your code,i find that the result have nine sets of parameters,xacc,yacc,zacc,xgyro,ygyro,zgyro,xmag,ymag,zmag.
I compare the result between this and type=attitude,i find pitchspeed,rollspeed and yawspeed are different from any of the above nine groups.
So which are linear accleration,which are angular velocity?And what are their units?

The descriptions and units are provided in the mavlink docs:

I’m unsure why the gyro measurements are different from the attitude speeds (outside of the factor of 1000 from the mrad/s vs rad/s units difference), so I’ve asked internally for ideas. I checked the ArduPilot code and it seems like ATTITUDE is populated using the AHRS, whereas SCALED_IMU2 is populated from the INS, but I’m unsure whether those are expected to be significantly different, and if so why.


I plotted 1000x ATTITUDE.<rot>speed against the SCALED_IMU2.<axis>gyro values and they do at least seem to track each other reasonably well. My data collection was on my desk after several hours of being stationary, so I likely need to calibrate my sensors and move the ROV around a bit for the estimates to be better aligned. I expect the main difference here is that the EKF (Kalman Filter) is compensating for the gyroscope drift, which is why the ATTITUDE measurements all start at zero, whereas the x and z gyro measurements start offset.

1 Like

Well,i know information about angular velocity. But the data about xacc confuse me. Because the data is always changing when pix is fixed.
CDCP2538B$C{6QC9M0ICIG

All sensor measurements have some level of noise, and accelerometers are no different. Once again it’s helpful to plot the data while moving the ROV (or at least moving the flight controller) to get a sense of the scale of the readings and their variations due to noise compared to those due to actual movement: