Skip to content

Commit 40a5d72

Browse files
committed
rm unused argument
1 parent 154955a commit 40a5d72

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/DiscreteKalmanFilter.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const GYRO_OFFSET = 128.1f0
111111
const 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
116116
Apply 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
123123
Use 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)
126126
update!(kf, gyro_x, angle)
127127
```
128128
That 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)

src/balance_original.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function compute_pwm!(ctrl::BalanceController,
150150
ctrl.encoder_right_pulse += ctrl.pwm_right < 0 ? -encoder_count_right : encoder_count_right
151151

152152
# Get calibrated angles from Kalman filter
153-
accel_angle, gyro_x, gyro_z = compute_angles(ctrl.kf, ax, ay, az, gx, gy, gz)
153+
accel_angle, gyro_x, gyro_z = compute_angles(ax, ay, az, gx, gy, gz)
154154

155155
# Update Kalman filter
156156
update!(ctrl.kf, gyro_x, accel_angle)

0 commit comments

Comments
 (0)