Fusion subscription with camera built from .svo not synced

Zed sdk version 4.1
Errors occur on both Zed Box orin with L4T 35.3 and on Ubuntu 22

I am attempting to perform fused pose / GNSS integration with a dataset comprising of a .SVO file and recorded GNSS data.

When I build the zed camera from the .SVO file and subscribe the fusion object to it, it appears that the fusion object is using the systems current timestamp and not the timestamp from the .SVO file.

camera = Camera(source=svo_path,zed_config=self.zed_config)
camera.start_publishing()
dummygps = DummyGPSServer(gps_path)

fusion = Fusion(self.zed_config)
fusion.subscribe(camera)

Checking Fusion process metrics:

fusion.fusion.get_process_metrics()
(SUCCESS, <pyzed.sl.FusionMetrics object at 0xfffee57e34e0>)
special variables
function variables
0:
SUCCESS
1:
<pyzed.sl.FusionMetrics object at 0xfffee57e34e0>
special variables
function variables
camera_individual_stats:
{}
mean_camera_fused:
0.0
mean_stdev_between_camera:
0.0
len():
2

Running the image capture sequence:

image = camera.capture()
gps_measurement = dummygps.get_measurement(image.timestamp,tolerance=.5)
>>> image.timestamp
datetime.datetime(2024, 3, 20, 13, 1, 41)
>>> gps_measurement.timestamp()
datetime.datetime(2024, 3, 20, 13, 1, 41)
ingest_status = fusion.add_gps_measurement(**dict(gps_measurement))
>>ingest_status
INVALID TIMESTAMP

Terminal output:

[2024-04-18 20:57:04 UTC][ZED][WARNING] The timestamp of the GNSS data you are attempting to ingest for [GeoTracking]  is different from the camera timestamp. Timestamp difference: 1564317192 ms.

Additionally, when I try to retrive measurements/Images from the fusion it does not return anything.

Hi @frigusgulo,

Can you please check that you have set correctly the ts field in GNSSData, as done here in the sample: zed-sdk/global localization/playback/python/gnss_replay.py at master · stereolabs/zed-sdk · GitHub ?

@mattrouss It absolutely is the correct format:

        gnss_data = sl.GNSSData()
        gnss_data.set_coordinates(lat, lon, elevation, in_radian=False)
        gnss_data.position_covariances = covariance
        assert isinstance(ts_sl,sl.Timestamp), f"Timestamp is not of type sl.Timestamp: {ts_sl}"
        gnss_data.ts = ts_sl
        gnss_data.altitude_std = np.sqrt(covariance[8])
        gnss_data.latitude_std = np.sqrt(covariance[0])
        gnss_data.longitude_std = np.sqrt(covariance[4])
        status = self.fusion.ingest_gnss_data(gnss_data)

By the way I can not find documentation on “sl.GNSS_MODE” or how to use it to migrate my code to the current SDK version.

The GNSS_MODE and GNSS_FUSION_STATUS are indeed missing in Python documentation, we are fixing this. You can consider the enum values in the C++ API to be equivalent, this can help you get around