MeasurementBuilder.build method not working as expected

Hello,

On Orekit version 12 the signature for the build method has changed from:
build(SpacecraftState state)
to
build(AbsoluteDate date, Map <ObservableSatellite, OrekitStepInterpolator interpolators>

Since then, I have not been able to use this method because it returns the following error:
AttributeError: 'super' object has no attribute 'build'.
Which makes me believe there is a problem with the Python Wrapper.

An example follows:

from org.orekit.estimation import measurements
from org.orekit.estimation.measurements import generation

position_builder = generation.PositionBuilder(None, 1.0, 1.0, measurements.ObservableSatellite(0))
position_builder.build(spacecraft_state)

Additionally, this MR mentioned the restoring of the measurement builder API, but it doesn’t look to have solved the issue in Orekit 12.1. Shall I expect the SpacecraftState API to return soon?

Thank you in advance,

Hi,

The API has been restored, but it’s the python wrapper so some casting is needed. I’m guessing AbstractMeasurementBuilder is the right one?

Cheers,
Romain.

1 Like

Hi!

Apparently you should cast to the abstract class MeasurementBuilder. The following example should run:

from org.orekit.estimation import measurements
from org.orekit.estimation.measurements import generation

position_builder = generation.PositionBuilder(None, 1.0, 1.0, measurements.ObservableSatellite(0))
position = generation.MeasurementBuilder.cast_(position_builder)
position_builder.build(spacecraft_state.getDate(), spacecraft_state)

I am using the Python wrapper for version 12.1.1, so the signature of the build method is build(AbsoluteDate date, SpacecraftState[] states).

Regards,
André

3 Likes

It solved the issue, thanks!