mahony
¶
AHRS library for CircuitPython Mahony Algorithm
Madgwick’s implementation of Mayhony’s AHRS algorithm. See: http:##www.x-io.co.uk/open-source-imu-and-ahrs-algorithms/
From the x-io website “Open-source resources available on this website are provided under the GNU General Public Licence unless an alternative licence is provided in source.”
Original Information Date Author Notes 29/09/2011 SOH Madgwick Initial release 02/10/2011 SOH Madgwick Optimised for reduced CPU load Algorithm paper: http:##ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=4608934&url=http%3A%2F%2Fieeexplore.ieee.org%2Fstamp%2Fstamp.jsp%3Ftp%3D%26arnumber%3D4608934
This version based upon AdaFruit AHRS https://github.com/adafruit/Adafruit_AHRS
- Author(s): Mark Komus
Implementation Notes¶
Hardware:
Any 9DOF sensor
Software and Dependencies:
- Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
-
class
gamblor21_ahrs.mahony.
Mahony
(Kp=0.5, Ki=0.0, sample_freq=100)¶ AHRS Mahony algorithm.
-
Ki
¶ The current Ki value (Integral gain).
-
Kp
¶ The current Kp value (Proportional gain).
-
compute_angles
()¶ Compute all the angles if there have been new samples (internal use)
-
pitch
¶ Current pitch (y-axis) value in radians/sec. (read-only)
-
roll
¶ Current roll (x-axis) value in radians/sec. (read-only)
-
sample_freq
¶ The current sample frequency value in Hertz.
-
update
(gx, gy, gz, ax, ay, az, mx, my, mz)¶ Call this function sample_freq times a second with values from your sensor The units of the accelerometer and magnetometer do not matter for this alogirthm The gryoscope must be in degrees/sec
Parameters: - gy, gz (gx,) – Gyroscope values in degrees/sec
- ay, az (ax,) – Accelerometer values
- my, mz (mx,) – Magnetometer values
-
update_IMU
(gx, gy, gz, ax, ay, az)¶ Called is was have no mag reading (internal use)
-
yaw
¶ Current yaw (z-axis) value in radians/sec. (read-only)
-