# Fusion subscription with camera built from .svo not synced

**URL:** <https://community.stereolabs.com/t/fusion-subscription-with-camera-built-from-svo-not-synced/5042>\
**Category:** Python\
**Tags:** python\
**Created:** [April 18, 2024, 9:07pm UTC](https://community.stereolabs.com/t/fusion-subscription-with-camera-built-from-svo-not-synced/5042 "2024-04-18T21:07:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![frigusgulo](https://community.stereolabs.com/user_avatar/community.stereolabs.com/frigusgulo/32/2190_2.png) [@frigusgulo](https://community.stereolabs.com/u/frigusgulo)\
**Post date:** [April 18, 2024, 9:07pm UTC](https://community.stereolabs.com/t/fusion-subscription-with-camera-built-from-svo-not-synced/5042/1 "2024-04-18T21:07:22Z")

</div>

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.

```auto
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:

```auto
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:

```auto
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:

```auto
[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.

---

<div class="post-metadata">

**Author:** ![mattrouss](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mattrouss/32/2452_2.png) [@mattrouss](https://community.stereolabs.com/u/mattrouss)\
**Post date:** [April 22, 2024, 4:57pm UTC](https://community.stereolabs.com/t/fusion-subscription-with-camera-built-from-svo-not-synced/5042/2 "2024-04-22T16:57:47Z")

</div>

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](https://github.com/stereolabs/zed-sdk/blob/master/global%20localization/playback/python/gnss_replay.py#L111) ?

---

<div class="post-metadata">

**Author:** ![fdunbar](https://community.stereolabs.com/letter_avatar_proxy/v4/letter/f/b782af/32.png) [@fdunbar](https://community.stereolabs.com/u/fdunbar)\
**Post date:** [April 22, 2024, 5:03pm UTC](https://community.stereolabs.com/t/fusion-subscription-with-camera-built-from-svo-not-synced/5042/3 "2024-04-22T17:03:32Z")

</div>

@mattrouss It absolutely is the correct format:

```auto
        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.

---

<div class="post-metadata">

**Author:** ![mattrouss](https://community.stereolabs.com/user_avatar/community.stereolabs.com/mattrouss/32/2452_2.png) [@mattrouss](https://community.stereolabs.com/u/mattrouss)\
**Post date:** [April 25, 2024, 8:52am UTC](https://community.stereolabs.com/t/fusion-subscription-with-camera-built-from-svo-not-synced/5042/4 "2024-04-25T08:52:34Z")

</div>

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
