Casting EstimatedMeasurementBase fails in Orekit 13

Hi, I am not sure this is a bug or there has been a change in the way Orekit works for version 13. This is a part of a measurement generation function I was using before (orekit 12.2):

# --- Retrieve and Store Raw Measurements for this pass ---
orekit_measurements_java = subscriber.getGeneratedMeasurements()
orekit_measurements_py = list(orekit_measurements_java) # Convert Java List to Python list
orekit_ob_measurements = [ObservedMeasurement.cast_(meas_py) for meas_py in orekit_measurements_py]

This worked fine before, it did the casting, and those measurements could then be added to an estimator no problem. Now I get this error in the .cast_() method call:

Traceback (most recent call last):
  File "<string>", line 4, in <module>
  File "<string>", line 4, in <listcomp>
TypeError: org.orekit.estimation.measurements.EstimatedMeasurementBase@77ea762f

I tried casting to ComparableMeasurement, which works, but then that can’t be used to add in the estimator (I guess it is not compatible). Should I change the strategy to deal with the fact meas_py are Java Objects? (and not just the EstimatedMeasurementBase Orekit class).

This is a change in Orekit, which is described in the upgrading instructions. It corresponds to issue 1350. So I think you should cast to EstimatedMeasurementBase, and from this call getObservedMeasurement() to get something you can use in an estimator.

That works! Thanks Luc, I should have that instructions page open all the time just in case.