Hello, I am trying to fetch the Roll, Pitch and Yaw values from the Altimu-10 v5 for an orientation related project, I have tried to do this using the MadgwickAHRS library but it keeps giving me values that keeps changing on the serial monitor.
This is my code, can you please help me out?
I am not familiar with the MadgwickAHRS library you are using, but a good starting point might be to look at the different sensors on the AltIMU individually using the example programs from our libraries, and try to get to a point where each of those look reasonable first.
Keep in mind that some amount of variation in the output should be expected, since there will be noise in the sensor outputs, but one common cause of major inaccuracy in an AHRS system like this is an inadequately calibrated magnetometer which will cause the yaw readings to drift. I am not sure what kind of calibration parameters the MadgwickAHRS library expects or how you are intended to determine them, but it is particularly important to calibrate magnetometers because their readings can be distorted enough to make their uncalibrated measurements more or less useless.
Here are some links to threads with discussions about how you could go about calibrating magnetometers, though please note that they do not all refer the same hardware, programs, or libraries: