-
Notifications
You must be signed in to change notification settings - Fork 138
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
JPDA and SystematicResampler Fixes #152
Conversation
Particles are sorted by weight before calculating the cumulative sum array. Thus when particles are resampled, they are drawn from the ordered distribution, rather than randomly.
The prediction and measurement prediction for every hypothesis in the multihypothesis were originally set as for the missed detection state. This causes spurious results at the update step if the measurements in the multihypothesis are asynchronous (e.g. grouped by a time-windowing feeder class), and the sensor platform is moving. In this case, the updated state is calculated using the sensor's translation offset at the missed detection timestamp (i.e. the latest timestamp in the window), but for a position measurement taken at the measurement timestamp (which may be earlier in the window). This fix attaches the prediction/measurement prediction calculated for the measurement to the relevant SingleHypothesis, such that the update is calculated using the correct sensor offset for the measurement timestamp.
accidental commit
Accidental commit
Particles are sorted before calculating the cumulative sum array. Thus when particles are resampled, they are drawn from the ordered distribution, rather than randomly.
The prediction and measurement prediction were originally set for every hypothesis in the multihypothesis as for the missed detection state. This causes spurious results at the update step if the measurements in the multihypothesis are asynchronous (e.g. grouped by a time-windowing feeder class), and the sensor platform is moving. In this case, the updated state is calculated using the sensor's translation offset at the missed detection timestamp (i.e. the latest timestamp in the window), but for a position measurement taken at the measurement timestamp (which may be earlier in the window). This fix attaches the prediction/measurement prediction calculated for the measurement to the relevant SingleHypothesis, such that the update is calculated using the correct sensor offset for the measurement timestamp.
@@ -24,6 +24,7 @@ def resample(self, particles): | |||
|
|||
n_particles = len(particles) | |||
weight = Probability(1/n_particles) | |||
particles = sorted(particles, key=lambda x: x.weight, reverse=False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to use attrgetter
for the key.
pro_detect_assoc = Probability.sum( | ||
joint_hypothesis.probability | ||
for joint_hypothesis in joint_hypotheses | ||
if joint_hypothesis. | ||
hypotheses[track].measurement is detection) | ||
hypotheses[track].measurement is hypothesis.measurement) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indentation need removing to fix a flake8 error.
measurement_prediction, | ||
hypothesis.prediction, | ||
hypothesis.measurement, | ||
measurement_prediction=hypothesis.measurement_prediction, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is raising a flake8 error also. Easiest fix would be to change arguments to positional rather keyword arguments as the variables have good descriptive names (noting you'll need to switch probability and measurement_prediction arguments around).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may no longer be an issue following #166.
Could I ask for someone to review this please? (Ignore Flake8 issues, as these will be fixed on merge) |
Quick question. Is it all commits, or just the latest one we're looking at? |
The net change of all the commits. |
Closed as will resolved with #193 |
Minor fixes for issues arising when JPDA measurements arrive asynchronously. Descriptions in individual commits.