@@ -111,7 +111,7 @@ const GYRO_OFFSET = 128.1f0
111111const GYRO_SCALE = 131.0f0
112112
113113"""
114- angle, gyro_x, gyro_z = compute_angles(kf, ax, ay, az, gx, gy, gz)
114+ angle, gyro_x, gyro_z = compute_angles(ax, ay, az, gx, gy, gz)
115115
116116Apply calibration to raw IMU readings and compute
117117- `angle`: Tilt angle from accelerometer (radians)
@@ -122,7 +122,7 @@ Applies calibration to gyro readings and computes angle from accelerometer.
122122
123123Use with Kalman filter like this:
124124```julia
125- angle, gyro_x, gyro_z = compute_angles(kf, ax, ay, az, gx, gy, gz)
125+ angle, gyro_x, gyro_z = compute_angles(ax, ay, az, gx, gy, gz)
126126update!(kf, gyro_x, angle)
127127```
128128That is, the gyro x reading is used as control input, and the angle computed from accelerometer as measurement.
@@ -133,7 +133,7 @@ That is, the gyro x reading is used as control input, and the angle computed fro
133133- `ax, ay, az`: Raw accelerometer readings (int16)
134134- `gx, gy, gz`: Raw gyroscope readings (int16)
135135"""
136- function compute_angles (kf :: IMUKalmanFilter , ax:: Integer , ay:: Integer , az:: Integer ,
136+ function compute_angles (ax:: Integer , ay:: Integer , az:: Integer ,
137137 gx:: Integer , gy:: Integer , gz:: Integer )
138138 # Calculate angle from accelerometer (radians to degrees)
139139 angle = atan (Float32 (ay), Float32 (az)) * (180.0f0 / pi )
0 commit comments