Hey there, I want to connect an MPU9250 to my Raspberry pi 5 and get the orientation angles (yaw, pitch,roll) but every library/example code i find online only gets the pitch and roll angles only , I tried calculating it on my own but the yaw angle is not correct while the pitch and roll are correct, however when I try connecting the same sensor to an arduino and run an example code it prints the correct values, there is also the problem of calibration when I use an arduino I don't need to calibrate anything, I also saw some stuff about an IIO driver for the mpu9250 but I don't understand it very well
My questions are:
1.Why does it work on arduino out of the box unlike the raspberry pi
2.how do I correctly calculate yaw angle
3.what is an IIO driver and why do I need it in order to get correct reading
4.How do I calibrate the sensor and why do I only need to calibrate it on the raspberry pi and not the arduino
5.What are sensor fusion algorithms like AHRS
I tried:
1.Calculating the yaw using quaternions
2.Calculating yaw using Rodrigue's formula
3.calculating yaw using arctan of gyro data
4.calculating yaw using arctan of magnetometer data
5.the mpu9250-jmdev library (this only provided the raw values)
6.the imusensor.MPU9250 library
7.a random library I found FaBo9Axis_MPU9250
8.enabling the IIO driver of the mpu9250 (might have done this incorrectly so if there is a tutorial for it that would be appreciated)
I am trying to learn so just answering one of my questions is already a great help and thanks in advance!
My questions are:
1.Why does it work on arduino out of the box unlike the raspberry pi
2.how do I correctly calculate yaw angle
3.what is an IIO driver and why do I need it in order to get correct reading
4.How do I calibrate the sensor and why do I only need to calibrate it on the raspberry pi and not the arduino
5.What are sensor fusion algorithms like AHRS
I tried:
1.Calculating the yaw using quaternions
2.Calculating yaw using Rodrigue's formula
3.calculating yaw using arctan of gyro data
4.calculating yaw using arctan of magnetometer data
5.the mpu9250-jmdev library (this only provided the raw values)
6.the imusensor.MPU9250 library
7.a random library I found FaBo9Axis_MPU9250
8.enabling the IIO driver of the mpu9250 (might have done this incorrectly so if there is a tutorial for it that would be appreciated)
I am trying to learn so just answering one of my questions is already a great help and thanks in advance!
Statistics: Posted by Ishiba — Wed Apr 02, 2025 3:46 pm