Skip to content

Commit

Permalink
wind_est_replay: report scale instead of inverse_scale
Browse files Browse the repository at this point in the history
The estimator internally estimates the scale inverse, but the interface
should be the scale as "airspeed_corrected = scale * airspeed"
  • Loading branch information
bresch committed May 24, 2024
1 parent 4f64acb commit ccbcbbe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/wind_estimator/python/wind_estimator_replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def run(logfile, use_gnss, scale_init):
if scale_init is None:
scale_init = 1.0

state = np.array([0.0, 0.0, scale_init])
# The estimator estimates the inverse scale factor to have a simpler measurement jacobian
inverse_scale_init = 1 / scale_init
state = np.array([0.0, 0.0, inverse_scale_init])
P = np.diag([1.0, 1.0, 1e-4])
wind_nsd = 1e-2
scale_nsd = 1e-4
Expand Down Expand Up @@ -118,7 +120,7 @@ def run(logfile, use_gnss, scale_init):

wind_est_n[i] = state[0]
wind_est_e[i] = state[1]
scale_est[i] = state[2]
scale_est[i] = 1 / state[2]

plt.figure(1)
ax1 = plt.subplot(2, 1, 1)
Expand Down

0 comments on commit ccbcbbe

Please sign in to comment.