IMU, MCU and Gyroscope


Hi Everyone,

I saw that the explanation plate contains various sensors like gyro, imu, accelerometer, and magnetometer. I’ve looked at the Imu.py code and the imu_controller.py code. but just can’t understand it. I’m struggling with (self) and keep getting the error ‘Object has no attributes’. Can somebody help me to print the coordinates given by the gyro or explain to me the error and self?

Thanks in advance

Hi @JohnnyZhu, have you tried the example here: https://github.com/pi-top/pi-top-Python-SDK/blob/master/examples/pma/imu.py

I have a similar problem. I want to use the imu as a compass. I understand how to get bearing information from an IMU, I write code for my INAV model airdplane and quadcopter projects.
The bearing I get is wrong, not just off by a few degrees, and not 45, 90, 180, or 270 degrees off.
The internal IMU fails to function properly. Is there a design issue with noise ? I may need to use an external serial GPS w/Compass. The RPI sense board has a similar issue. If you are using the same IMU as featured on that board then it won’t work for most people. My code uses a combination of compass bearing, wifi access point signal strength, Infra Red LED Beacons and wheel odometery for dead reckoning. GPS will not work indoors. A serial GPS w/Compass would be overkill. I would like to use the internal IMU.