Skip to content

Commit

Permalink
Merge pull request #665 from dstl/optimized_SM_tutorial
Browse files Browse the repository at this point in the history
Add optimized sensor management tutorial
  • Loading branch information
sdhiscocks authored Aug 11, 2022
2 parents 0c08afe + b30cf04 commit 3d368a8
Show file tree
Hide file tree
Showing 4 changed files with 698 additions and 29 deletions.
17 changes: 8 additions & 9 deletions docs/tutorials/sensormanagement/01_SingleSensorManagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
sensorA = RadarRotatingBearingRange(
position_mapping=(0, 2),
noise_covar=np.array([[np.radians(0.5) ** 2, 0],
[0, 0.75 ** 2]]),
[0, 1 ** 2]]),
ndim_state=4,
position=np.array([[10], [0]]),
rpm=60,
Expand All @@ -196,7 +196,7 @@
sensorB = RadarRotatingBearingRange(
position_mapping=(0, 2),
noise_covar=np.array([[np.radians(0.5) ** 2, 0],
[0, 0.75 ** 2]]),
[0, 1 ** 2]]),
ndim_state=4,
position=np.array([[10], [0]]),
rpm=60,
Expand Down Expand Up @@ -232,14 +232,13 @@
from stonesoup.types.state import GaussianState

priors = []
xdirection=1.5
ydirection=1.5

xdirection = 1.2
ydirection = 1.2
for j in range(0, ntruths):
priors.append(
GaussianState([[0], [xdirection], [yps[j]+0.5], [ydirection]], np.diag([1.5, 0.25, 1.5, 0.25] + np.random.normal(0, 5e-4, 4)),
timestamp=start_time))
xdirection*=-1
priors.append(GaussianState([[0], [xdirection], [yps[j]+0.1], [ydirection]],
np.diag([0.5, 0.5, 0.5, 0.5]+np.random.normal(0,5e-4,4)),
timestamp=start_time))
xdirection *= -1
if j % 2 == 0:
ydirection *= -1

Expand Down
13 changes: 7 additions & 6 deletions docs/tutorials/sensormanagement/02_MultiSensorManagement.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
sensor = RadarRotatingBearingRange(
position_mapping=(0, 2),
noise_covar=np.array([[np.radians(0.5) ** 2, 0],
[0, 0.75 ** 2]]),
[0, 1 ** 2]]),
ndim_state=4,
position=np.array([[10], [n * 50]]),
rpm=60,
Expand All @@ -156,7 +156,7 @@
sensor = RadarRotatingBearingRange(
position_mapping=(0, 2),
noise_covar=np.array([[np.radians(0.5) ** 2, 0],
[0, 0.75 ** 2]]),
[0, 1 ** 2]]),
ndim_state=4,
position=np.array([[10], [n * 50]]),
rpm=60,
Expand Down Expand Up @@ -194,15 +194,16 @@
from stonesoup.types.state import GaussianState

priors = []
xdirection = 1.5
ydirection = 1.5
xdirection = 1.2
ydirection = 1.2
for j in range(0, ntruths):
priors.append(GaussianState([[0], [xdirection], [yps[j]+0.5], [ydirection]],
np.diag([1.5, 0.25, 1.5, 0.25]+np.random.normal(0,5e-4,4)),
priors.append(GaussianState([[0], [xdirection], [yps[j]+0.1], [ydirection]],
np.diag([0.5, 0.5, 0.5, 0.5]+np.random.normal(0,5e-4,4)),
timestamp=start_time))
xdirection *= -1
if j % 2 == 0:
ydirection *= -1

# %%
# Initialise the tracks by creating an empty list and appending the priors generated. This needs to be done
# separately for both sensor manager methods as they will generate different sets of tracks.
Expand Down
Loading

0 comments on commit 3d368a8

Please sign in to comment.