Skip to content

Commit 7ab6521

Browse files
committed
bayes filter
1 parent 3e0fd16 commit 7ab6521

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

MyCode/Bayes Filter/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Bayes Filter
2+
3+
[Ref. 1](#reference)
4+
5+
### Reference
6+
7+
1. Bayes Filter Youtube (https://www.youtube.com/watch?v=6uEgLv1Mr2s)
8+
2. The Two Stages of Bayes Filtering (https://www.youtube.com/watch?v=Qa8YMP9dQYo)

MyCode/Kalman Filter/1_test.py

Whitespace-only changes.

MyCode/Particle_Filter/1D.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,18 @@
22
import matplotlib.pyplot as plt
33
from numpy.polynomial import Chebyshev as T
44
from utils import create_toy_data
5+
from skylynx.utils import cli_args
56

67
if __name__ == "__main__":
8+
# argparse
9+
cli_params = dict(
10+
DT=5,
11+
)
12+
13+
args = cli_args(cli_params)
14+
715
velocity = 1 # m/s
8-
DT = 5 # sec
16+
DT = int(args['DT']) # sec
917
start_pos = 0 # meters
1018
time = 0.0
1119

@@ -53,19 +61,20 @@
5361
ax.fill_between(lx, ly - std, ly + std,
5462
color="gray", label="std.", alpha=0.5)
5563

56-
# noise within std
57-
58-
ax.scatter(lx, y_sine_noise, c='b', marker='*', lw=0.5)
59-
6064
# Plot plane route
6165
ax.axhline(y=plane_height, xmin=0, xmax=1,
6266
c='r', ls='--', lw=1)
6367
# plane current pos
6468
ax.scatter(pos, plane_height, c='r', lw=3, marker='>')
6569

6670
# distance to current height
71+
ax.scatter(pos, ly[pos], c='k', lw=2)
72+
73+
# noise within std
74+
ax.scatter(lx, y_sine_noise, c='b', marker='*', lw=0.5, alpha=0.5)
6775

68-
ax.scatter(pos, ly[pos], c='k', lw=3)
76+
# current noisy distance sample
77+
ax.scatter(pos, y_sine_noise[pos], c='k', marker='*', lw=0.5)
6978

7079
# settings
7180
ax.grid(True)

0 commit comments

Comments
 (0)