dstl / Stone-Soup

A software project to provide the target tracking community with a framework for the development and testing of tracking algorithms.
https://stonesoup.rtfd.io
MIT License
384 stars 126 forks source link

Plot moving sensors/platform with Plotterly using plot_sensors #863

Closed A-acuto closed 7 months ago

A-acuto commented 9 months ago

Hi while writing the example presented in #862 I tried to plot the sensor movements, in particular for a MovingPlatform. Passing the platform location, or the platform detection generator, the plot_sensors only access the position key which is only one state of the many available.

And if recording the last iteration from the platform, which contains all the previous states, it is not possible (or at least I failed to make it work) to loop over the various movement_controller states because the function will try to access the key position which is not available on GaussianStates. Any idea on how to fix? here is an example Gist showing the issue

gawebb-dstl commented 7 months ago

Try this:

plotter.plot_ground_truths(sensor2_platform, mapping=[0, 2],
                           marker=dict(color='gold', symbol='cross', size=15),
                           truths_label='Moving Platform')
A-acuto commented 7 months ago

In the latest commit in #862 I employ the solution proposed by @gawebb-dstl . I am satisfied with the result and I can close the issue.