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

Issue with track fusion using Particle Filters #854

Closed
A-acuto opened this issue Sep 12, 2023 · 1 comment
Closed

Issue with track fusion using Particle Filters #854

A-acuto opened this issue Sep 12, 2023 · 1 comment

Comments

@A-acuto
Copy link
Contributor

A-acuto commented Sep 12, 2023

Hello, I've been trying to set up a comparison code using track fusion algorithm between Kalman and particle filters.
The track fusion seems working fine using the tracks obtained with the Kalman filter, but in the case of Particle filter there is an incompatibility issue between the Gaussian detections and the ParticleStateUpdate, in particular using Tracks2GaussianDetectionFeeder I got this error from types/detection :

super().__init__(state_vector, *args, **kwargs)
TypeError: __init__() missing 1 required positional argument: 'covar'

Example using the kalman filter: here
Example using the Particle filter: here

Thanks for any input on this issue

@sdhiscocks
Copy link
Member

Tracks2GaussianDetectionFeeder is designed for Gaussian based states only, as well as Chernoff Updater being used. Another approach, not currently implemented would be need to fuse ParticleState.

With small modification, it would be possible to take the ParticleState mean and covariance and assume the ParticleState is representing a GaussianState. We could make change to support that.

diff --git a/stonesoup/feeder/track.py b/stonesoup/feeder/track.py
index a157f4d5..37f2aebe 100644
--- a/stonesoup/feeder/track.py
+++ b/stonesoup/feeder/track.py
@@ -27,6 +27,8 @@ class Tracks2GaussianDetectionFeeder(DetectionFeeder):
                 detections.add(
                     GaussianDetection.from_state(
                         track.state,
+                        state_vector=track.mean,
+                        covar=track.covar,
                         measurement_model=LinearGaussian(
                             dim, list(range(dim)), np.asarray(track.covar)),
                         metadata=metadata,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants