Skip to content

Commit 70f5748

Browse files
committed
plot rng dot std dev and tune range finder noise parameters
1 parent 49ea19a commit 70f5748

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

range_finder_kinematic_consistency/range_finder_consistency_check_replay.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,28 @@ def run(logfile):
4545
(t, rng, vz, vz_var) = getAllData(logfile)
4646

4747
rng_kin = RangeFinderConsistencyCheck()
48-
rng_kin._vel_bottom_gate = 0.2
48+
rng_kin._vel_bottom_gate = 1.0
4949

5050
n = len(t)
5151
inn = [0.0]
5252
rng_var = [0.0]
5353
test_ratio = [0.0]
5454
signed_test_ratio_lpf = [0.0]
55+
vel_bottom_var = [0.0]
5556
is_consistent = [False]
5657

5758
for k in range(1, n):
58-
rng_var.append(0.1**2 + (0.05*rng[k])**2)
59+
rng_var.append(0.01**2 + (0.01*rng[k])**2)
5960
rng_kin.update(rng[k], rng_var[k], vz[k], vz_var[k], t[k]*1e6)
6061
inn.append(rng_kin.getInnov())
6162
test_ratio.append(rng_kin._vel_bottom_test_ratio)
6263
signed_test_ratio_lpf.append(rng_kin.getSignedTestRatioLpf())
6364
is_consistent.append(rng_kin.isKinematicallyConsistent())
65+
vel_bottom_var.append(rng_kin._vel_bottom_innov_var - rng_var[k])
6466

65-
plotData(t, rng, rng_var, is_consistent, vz, inn, test_ratio, signed_test_ratio_lpf)
67+
plotData(t, rng, rng_var, is_consistent, vz, inn, test_ratio, signed_test_ratio_lpf, vel_bottom_var)
6668

67-
def plotData(t, rng, rng_var, is_consistent, vz, inn, test_ratio, signed_test_ratio_lpf):
69+
def plotData(t, rng, rng_var, is_consistent, vz, inn, test_ratio, signed_test_ratio_lpf, vel_bottom_var):
6870
n_plots = 4
6971
ax1 = plt.subplot(n_plots, 1, 1)
7072
ax1.plot(t, rng)
@@ -82,7 +84,10 @@ def plotData(t, rng, rng_var, is_consistent, vz, inn, test_ratio, signed_test_ra
8284

8385
ax3 = plt.subplot(n_plots, 1, 3, sharex=ax1)
8486
ax3.plot(t, vz)
85-
ax3.plot(t, vz+inn)
87+
rng_dot = vz+inn
88+
ax3.plot(t, rng_dot)
89+
ax3.plot(t, rng_dot+np.sqrt(vel_bottom_var), 'r--')
90+
ax3.plot(t, rng_dot-np.sqrt(vel_bottom_var), 'r--')
8691
ax3.set_ylim(-5, 5)
8792
ax3.legend(["vz", "rng_dot"])
8893

0 commit comments

Comments
 (0)