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

Avoid (or not) default implementation of method `MeasurementModel::getNoiseCovarianceMatrix`

Open xEnVrE opened this issue 6 years ago • 1 comments

At the moment, there is a default implementation of the virtual method MeasurementModel::getNoiseCovarianceMatrix() const

https://github.com/robotology/bayes-filters-lib/blob/b178460f9a475e4da33c6e849536d9d3a9df5e33/src/BayesFilters/src/MeasurementModel.cpp#L20-L23

If a user implements that method, in a inheriting class, without using the keywords const and override, the internal machinery of the library will silently call the default method possibly causing erroneous behaviors. Should we change this to something different, e.g. throwing an exception in the default implementation?

@claudiofantacci

xEnVrE avatar May 24 '19 15:05 xEnVrE

I don't like this as well. We should just throw an exception here and in similar contexts.

claudiofantacci avatar May 27 '19 08:05 claudiofantacci