FeatureBase::setMeasurement existing factors
Currently, anyone can call FeatureBase::setMeasurement()
, FeatureBase::setMeasurementCovariance()
or FeatureBase::setMeasurementInformation()
in a feature that has some child factors.
Factors take the measurement and information in creation time, so they won't be updated. This is misleading.
Changing the measurement of a feature is a non-sense action... We could avoid it if the feature has already any factor or at least raising a warning.
Otherwise we could implement the update of measurements and covariance. This could be done by just adding the setters in FactorBase
. They can be virtual to allow derived factors to override if some precomputations related with the measurements have to be performed. Maybe a pure virtual updatedMeasurement()
that forces the developer to explicitly implement if something has to be done if measurement changed (most of them would be empty). Maybe it is too extreme just for a few cases..
Summarizing the alternatives...
Avoid measurement update:
- A. Assert (failure)
- B. warning ("Factor XXX measurement didn't update the measurement").
Implement the measurement update:
- C. setters in
FactorBase
and pure virtualupdatedMeasurement()
- D. virtual setters in
FactorBase