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:
-
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.
-
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.
-
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.
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:
Unused matrices
BandMIn
KalmanFilterNew, bothBandMare defined, initialized, and saved/restored infreeze()/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.Unused member variable
z(last observation)zis 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.observedflag not saved infreeze()The
observedboolean is not backed up inattr_savedduringfreeze(). For completeness and to makeunfreeze()self‑contained, addingattr_saved.observed = observed;infreeze()and restoring it inunfreeze()would be nice (even thoughupdate()sets it totrueright afterunfreeze()– it doesn't hurt).None of these affect algorithm correctness, but addressing them would make the code cleaner.