Skip to content
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

Cannot call non-cost methods from predictedMeasure of MeasurementModel class #102

Open
isorrentino opened this issue Jun 29, 2023 · 1 comment

Comments

@isorrentino
Copy link

isorrentino commented Jun 29, 2023

Hi all,
I implemented a class that inherits from the MeasurementModel class, so I have my own implementation of the method predictedMeasure

virtual std::pair<bool, Data> predictedMeasure(const Eigen::Ref<const Eigen::MatrixXd>& cur_states) const = 0;
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

@xEnVrE
Copy link
Collaborator

xEnVrE commented Jul 6, 2023

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

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

No branches or pull requests

2 participants