Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding an example showing inverse-time dynamics method to deal with OOSM #940

Merged
merged 5 commits into from
Apr 12, 2024

Conversation

A-acuto
Copy link
Contributor

@A-acuto A-acuto commented Jan 19, 2024

Thir PR adds an example that shows how to implement Algorithm C [1, 2] to deal with out of sequence measurements.
As other examples (see PR #939 and PR #915 ) we explain how to treat OOSM, in this specific case we employ a time-inverse dynamics method to create pseudo-measurements at "correct timestamp" from the delayed detections.

[1] Y. Bar-Shalom, M. Mallick, H. Chen, R. Washburn, 2002, One-step solution for the general out-of-sequence measurement problem in tracking, Proceedings of the 2002 IEEE Aerospace Conference.
[2] S. R. Maskell, R. G. Everitt, R. Wright, M. Briers, 2005, Multi-target out-of-sequence data association: Tracking using graphical models, Information Fusion.

Copy link
Contributor

@spike-dstl spike-dstl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly grammatical changes. Please also see comment on line 352 for a suggested change to help present the results more effectively.

docs/examples/example_oosm_algorithm.py Outdated Show resolved Hide resolved
Comment on lines 16 to 21
# multiple approaches on how to deal with OOS measurements,
# spanning from simply ignoring them, assuming that the fraction
# of these is small and it will not, significally, impact the quality of the
# tracking, iterate over last $\math{\ell}$ measurements with
# a fixed lag (see what it is called Algorithm A and B in [#]_ and
# [#]_, see also the previous examples) or, like in this example,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# multiple approaches on how to deal with OOS measurements,
# spanning from simply ignoring them, assuming that the fraction
# of these is small and it will not, significally, impact the quality of the
# tracking, iterate over last $\math{\ell}$ measurements with
# a fixed lag (see what it is called Algorithm A and B in [#]_ and
# [#]_, see also the previous examples) or, like in this example,
# multiple approaches on how to deal with OOS measurements.
# These approaches include simply ignoring the presence of
# OOSM (assuming that the fraction of OOSM is small and it will
# not significantly impact the tracking performance). Another
# approach iterates over last $\math{\ell}$ measurements with
# a fixed lag (see what it is called Algorithm A and B in [#]_ and
# [#]_ (see the previous examples). In this example,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fill in the reference numbers in the text above

# you can include any OOSM and re-process the measurement using
# inverse-time dynamics creating pseudo-measurements.
# This approach is called in literature as Algorithm C
# (from [#]_, [#]_) and it will be refered as such later on.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reference numbers

Comment on lines 26 to 27
# To explain how does it work let's consider a single target scenario,
# this algorithm deals with the presence of delayed measurements by
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# To explain how does it work let's consider a single target scenario,
# this algorithm deals with the presence of delayed measurements by
# To explain how it works, we consider a single target scenario.
# This algorithm deals with the presence of delayed measurements by

# and with some level of clutter, at specific timesteps we insert a
# delay in one of the sensor scan and we employ Algorithm C to
# process in the correct way the chain of measurements.
# To visualise the benefit of the algorithm we, also, include a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# To visualise the benefit of the algorithm we, also, include a
# To visualise the benefit of the algorithm, we also include a

# -------------------------------------------------------------------
# We can now run the tracker and generate the tracks.
# By looping over the scans we can spot any OOS measurement and apply the algorithm.
# When we encounter a delayed measurement, at time $\math{\tau}$, we make use of both
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# When we encounter a delayed measurement, at time $\math{\tau}$, we make use of both
# When we encounter a delayed measurement, at time :math:`\tau`, we make use of both

Comment on lines 251 to 252
# target, then we use the transition model with time-inverse dynamics ($t_{k} - \math{\tau}$)
# to trace back where the target was in the scan-timestamp ($t$). With this pseudo-location, which is an
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# target, then we use the transition model with time-inverse dynamics ($t_{k} - \math{\tau}$)
# to trace back where the target was in the scan-timestamp ($t$). With this pseudo-location, which is an
# target, then we use the transition model with time-inverse dynamics (:math:`t_{k} - \tau`)
# to trace back where the target was in the scan-timestamp :math:`t`. With this pseudo-location, which is an

# inverse function at $\math{\tau}$ to obtain a predicted Cartesian location of the
# target, then we use the transition model with time-inverse dynamics ($t_{k} - \math{\tau}$)
# to trace back where the target was in the scan-timestamp ($t$). With this pseudo-location, which is an
# approximation, we can compute the pseudo-measurement usign the measurement model.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# approximation, we can compute the pseudo-measurement usign the measurement model.
# approximation, we can compute the pseudo-measurement using the measurement model.

# target, then we use the transition model with time-inverse dynamics ($t_{k} - \math{\tau}$)
# to trace back where the target was in the scan-timestamp ($t$). With this pseudo-location, which is an
# approximation, we can compute the pseudo-measurement usign the measurement model.
# In this way now we have a pseudo-measurement at $t$ and we can keep the time-chain and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# In this way now we have a pseudo-measurement at $t$ and we can keep the time-chain and
# In this way now we have a pseudo-measurement at :math:`t` and we can keep the time-chain and

# ------------------------------------------------------------------------
# We have obtained the final tracks from the detections and we have two sets of
# tracks, one with OOSM and one without. We now can visualise the results
# and evaluate the track-to-truh accuracy using the OSPA metric tool.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# and evaluate the track-to-truh accuracy using the OSPA metric tool.
# and evaluate the track-to-track accuracy using the OSPA metric tool.

Copy link
Contributor

@nperree-dstl nperree-dstl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some suggestions to improve grammar and readability but otherwise looks good!

docs/examples/example_oosm_algorithm.py Outdated Show resolved Hide resolved
docs/examples/example_oosm_algorithm.py Outdated Show resolved Hide resolved
Comment on lines +338 to +347
from stonesoup.plotter import AnimatedPlotterly
plotter = AnimatedPlotterly(timesteps=timestamps)
plotter.plot_ground_truths(truths, [0, 2])
plotter.plot_measurements(scan_s1, [0, 2], measurements_label='scan1', measurement_model=sensor_1_mm)
plotter.plot_measurements(scan_s2, [0, 2], measurements_label='scan2', measurement_model=sensor_1_mm)
plotter.plot_tracks(oosm_tracks, [0, 2], track_label='OOSM Tracks',
line= dict(color='orange'))
plotter.plot_tracks(noOsm_tracks, [0, 2], track_label='no-OOSM Tracks',
line= dict(color='red'))
plotter.fig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TrueDetections plotted in your output (blue points) look pretty noisy and a long way from the ground truth towards the end of the simulation. Ignore me if that's intentional, but might be worth adjusting the noise in your measurement model if not.

@sdhiscocks sdhiscocks merged commit 2f09e4f into dstl:main Apr 12, 2024
6 checks passed
@A-acuto A-acuto deleted the algorithm_c_oosm branch May 30, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants