bayes-filters-lib icon indicating copy to clipboard operation
bayes-filters-lib copied to clipboard

Cannot call non-cost methods from `predictedMeasure` of `MeasurementModel` class

Open isorrentino opened this issue 2 years ago • 1 comments

Hi all, I implemented a class that inherits from the MeasurementModel class, so I have my own implementation of the method predictedMeasure https://github.com/robotology/bayes-filters-lib/blob/6dd9c397cfc2615819bb1cb3431cf931dddf3cf8/src/BayesFilters/include/BayesFilters/MeasurementModel.h#L38 but I cannot call non-cost methods inside being the method predictedMeasure const. I don't find a solution to this problem and I'm opening this issue to ask if it is possible to make the method predictedMeasure non-const, or if anyone has a different solution. Thank you.

cc @xEnVrE

isorrentino avatar Jun 29 '23 11:06 isorrentino

Hi @isorrentino,

thanks for pointing this out.

The original idea behind this choice is that the predictedMeasure method should evaluate, more or less like a pure function, the value of the measurement function $h(x)$ given the state $x$ without side effects.

Can you better describe the use case such that we can maybe find an alternative solution? Thank you

xEnVrE avatar Jul 06 '23 07:07 xEnVrE