Skip to content

[TASK] Expose measurement likelihoods from PDAF for IPDA integration #31

@jorgenfj

Description

@jorgenfj

Description of task

Currently, the IPDA filter recomputes measurement likelihoods (z_pred.pdf(z_k)) inside existence_prob_update().
However, these same likelihoods are already calculated internally in the PDAF during association weighting (get_weights()).

This causes duplicated computation and makes it harder to integrate IPDA and PDAF efficiently.


Proposed change

Extend the PDAF::Output struct and PDAF::step() to include a vector of measurement likelihoods for the gated measurements.

Example:

struct Output {
    Gauss_x x_;
    Gauss_x x_prediction;
    Gauss_z z_prediction;
    Gauss_xX x_updates;
    Arr_1Xb gated_measurements;
    Eigen::ArrayXd measurement_likelihoods;  // new field
};

In step(), compute and populate:

Eigen::ArrayXd z_likelihoods(inside_meas.cols());
for (int i = 0; i < inside_meas.cols(); ++i)
    z_likelihoods(i) = z_pred.pdf(inside_meas.col(i));

and include it in the returned output.


Benefits

  • Eliminates redundant likelihood computation inside IPDA.
  • Keeps likelihood generation within the PDAF, where it naturally belongs.
  • Simplifies the IPDA implementation (can use the existence_prob_update(likelihoods, ...) overload).
  • Improves performance and clarity.

Example integration

After this change, IPDA::step() could do:

auto [x_post, x_pred, z_pred, x_upd, gated_measurements, z_likelihoods] =
    PDAF::step(...);

double existence_probability_upd =
    IPDA::existence_prob_update(z_likelihoods, existence_prob_pred, config);

Suggested Workflow

No response

Specifications

No response

Contacts

No response

Code Quality

  • Every function in header files are documented (inputs/returns/exceptions)
  • The project has automated tests that cover MOST of the functions and branches in functions (pytest/gtest)
  • The code is documented on the wiki (provide link)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions