Skip to content

Minor issues: unused variables B/M/z, and observed flag not saved in freeze() #143

Description

@chenglibo123

Hi, thank you for the great OC‑SORT implementation!

While studying the C++ code, I noticed a few minor points that might be worth clarifying or improving:

  1. Unused matrices B and M
    In KalmanFilterNew, both B and M are defined, initialized, and saved/restored in freeze()/unfreeze(), but they are never used in any actual computation (no control input, noise uncorrelated). If they are kept for completeness, a brief comment would be helpful; otherwise they could be removed to reduce clutter.

  2. Unused member variable z (last observation)
    z is assigned and saved/restored, but it never participates in filter calculations (the innovation uses the passed pointer *z_ directly). It seems to serve only as an archive. Consider removing it or adding a comment explaining its purpose.

  3. observed flag not saved in freeze()
    The observed boolean is not backed up in attr_saved during freeze(). For completeness and to make unfreeze() self‑contained, adding attr_saved.observed = observed; in freeze() and restoring it in unfreeze() would be nice (even though update() sets it to true right after unfreeze() – it doesn't hurt).

None of these affect algorithm correctness, but addressing them would make the code cleaner.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions