Changing return type of MeasurementBuilder.build
The MeasurementBuilder
interface is used by Orekit measurements generation feature. It is specialized for each measurement type. Its build
method returns a specific ObservedMeasurement<T>
(i.e Range
for RangeBuilder
, Phase
for PhaseBuilder
…).
Internally, all implementations work by creating first a dummy ObservedMeasurement<T>
, then call its estimateWithoutDerivatives
to build an EstimatedMeasurementBase<T>
, retrieve from this intermediate object the true measurement value and finally build another ObservedMeasurement<T>
with the correct value. This second ObservedMeasurement<T>
is then returned through a bunch of classes (AbstractScheduler
, then an internal step handler, then Generator
). At the end, it is passed to a GeneratedMeasurementSubscriber
).
I have a use case where the information present in the ObservedMeasurement<T>
is not sufficient; I would need to get the states of the spacecraft involved in the measurement, as they hold some additional states I need. I cannot just call again the propagators that are used by the Generator
because doing this stalls the generation (probably some kind of dead lock or infinite recursion as the propagator calls the measurements generator which then would call the propagator back). Setting up another propagator also seems a waste of resources since the states have already been computed during the measurement generation; they were just thrown away when building the second ObservedMeasurement<T>
from the EstimatedMeasurementBase<T>
.
This issue intends to change the API of MeasurementBuilder
and all the intermediate classes so the measurements that are built and returned to users are EstimatedMeasurementBase<T>
rather than ObservedMeasurement<T>
. It targets Orekit 13.0 milestone as it changes several public signatures. Partial backward compatibility is ensured as ObservedMeasurement<T>
can be retrieved from the EstimatedMeasurementBase<T>
using its getObservedMeasurement()
method. The returned EstimatedMeasurementBase<T>
contains much more information than ObservedMeasurement<T>
(states, participants...).