sl.GNSSData has 0 value for sl.GNSSData.altitude_std

Zed python sdk version 4.1, ubuntu 22

I am getting a strange bug where upon instantiating a sl.GNSSData object, my respective spatial std’s are 0. This is resulting in the fusion status “GNSS DATA COVARIANCE MUST VARY”

>>> covariance
[10.439361, 0.0, 0.0, 0.0, 10.439361, 0.0, 0.0, 0.0, 33.965584]
>>> lat
44.12345
>>> lon
-123.12345
>>> elevation
313.631
>>> timestamp_seconds
1710961303.0
import pyzed.sl as sl
ts_sl = sl.Timestamp()
ts_sl.set_microseconds(int(1000000*timestamp_seconds))
gnss_data = sl.GNSSData()
gnss_data.set_coordinates(lat, lon, elevation, in_radian=False)
gnss_data.position_covariances = covariance
gnss_data.ts = ts_sl
>>> gnss_data.latitude_std
0.0
>>> gnss_data.longitude_std
0.0
>>> gnss_data.altitude_std
0.0

I suspect this is an issue with the SDK, but not sure. Any help/suggestions would be greatly apreciated

Hello @fdunbar,
Indeed the covariance ingested to SDK must vary between ingest. This a sanity check for avoiding bad data ingestion. You should not ingest the same GNSS covariance in SDK. Regarding the standard deviation it is an input provided by user. We do not modify it inside the SDK.

I hope this help,
Regards

@TanguyHardelin (posting from a seperate acct)
@mattrouss

Attached are my logs/code for my GNSS ingestion routine:

Code:

        if isinstance(timestamp,str):
            timestamp = datetime.datetime.fromisoformat(timestamp)

        ts_sl = sl.Timestamp()
        if isinstance(timestamp,int):
            ts_sl.set_milliseconds(timestamp)
        else:
            ts_sl.set_microseconds(int(1000000*timestamp.timestamp()))
       
   
        gnss_data = sl.GNSSData()
        gnss_data.set_coordinates(lat, lon, elevation, in_radian=False)
        gnss_data.position_covariances = covariance
        gnss_data.ts = ts_sl

        # gnss data logging
        logger.info(
            f"GNSS Data: Latitude: {lat}, Longitude: {lon}, Elevation: {elevation}, Timestamp: {ts_sl.get_milliseconds()} [ms], Covariance: {covariance}"
        )
        status = self.fusion.ingest_gnss_data(gnss_data)
        
        return status

Logs:

INFO:timbertrack.core.fusion:Fusion Subscribed to camera: 47733007 SUCCESS
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Current: 1713549179 [s]
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Image: 1710961301 [s]
INFO:timbertrack.core.svo_gpx_processing:GPS Measurement: timestamp=1710961301504 time_delta=0 lat=44.xxxxxx lon=-123.xxxxxx elevation=313.364 covariance=[11.22812905703064, 0.42437592723848727, 0.02561911651898341, 0.057932630183087586, 10.391062680255343, 0.17947463007195108, 0.1293140111258806, 0.05105428597526507, 32.64031175070211]
INFO:timbertrack.core.fusion:GNSS Data: Latitude: 44.xxxxxx, Longitude: -123.xxxxxx, Elevation: 313.364, Timestamp: 1710961301504 [ms], Covariance: [11.22812905703064, 0.42437592723848727, 0.02561911651898341, 0.057932630183087586, 10.391062680255343, 0.17947463007195108, 0.1293140111258806, 0.05105428597526507, 32.64031175070211]
INFO:timbertrack.core.svo_gpx_processing:GPS Ingest Status: INVALID TIMESTAMP : INVALID_TIMESTAMP
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Current: 1713549286 [s]
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Image: 1710961301 [s]
INFO:timbertrack.core.svo_gpx_processing:GPS Measurement: timestamp=1710961301737 time_delta=0 lat=44.xxxxxx lon=-123.xxxxxx elevation=313.364 covariance=[10.626862270043835, 0.4372344519381446, 0.7089712228377447, 0.9433748417486971, 10.832098556297966, 0.341424077866856, 0.5522321235322484, 0.9324716457682732, 33.05489464001797]
INFO:timbertrack.core.fusion:GNSS Data: Latitude: 44.6600692, Longitude: -123.4037362, Elevation: 313.364, Timestamp: 1710961301737 [ms], Covariance: [10.626862270043835, 0.4372344519381446, 0.7089712228377447, 0.9433748417486971, 10.832098556297966, 0.341424077866856, 0.5522321235322484, 0.9324716457682732, 33.05489464001797]
INFO:timbertrack.core.svo_gpx_processing:GPS Ingest Status: GNSS DATA COVARIANCE MUST VARY : GNSS_DATA_NEED_FIX
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Current: 1713549328 [s]
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Image: 1710961301 [s]
INFO:timbertrack.core.svo_gpx_processing:GPS Measurement: timestamp=1710961301971 time_delta=0 lat=44.6600681 lon=-123.4037415 elevation=313.562 covariance=[11.204028873223834, 0.22990711128466512, 0.5231185122598605, 0.8985356033016766, 10.799288308768862, 0.18584352665920434, 0.2352681084830951, 0.8209020775294035, 33.5800654066645]
INFO:timbertrack.core.fusion:GNSS Data: Latitude: 44.6600681, Longitude: -123.4037415, Elevation: 313.562, Timestamp: 1710961301971 [ms], Covariance: [11.204028873223834, 0.22990711128466512, 0.5231185122598605, 0.8985356033016766, 10.799288308768862, 0.18584352665920434, 0.2352681084830951, 0.8209020775294035, 33.5800654066645]
INFO:timbertrack.core.svo_gpx_processing:GPS Ingest Status: GNSS DATA COVARIANCE MUST VARY : GNSS_DATA_NEED_FIX
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Current: 1713549337 [s]
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Image: 1710961302 [s]
INFO:timbertrack.core.svo_gpx_processing:GPS Measurement: timestamp=1710961302204 time_delta=0 lat=44.xxxxxx lon=-123.xxxxxx elevation=313.631 covariance=[11.436789435704272, 0.12029160922994298, 0.03498586959232097, 0.1490340280594069, 11.424010895569356, 0.17219095068277113, 0.8614886863560002, 0.17955815453813528, 34.62467422651605]
INFO:timbertrack.core.fusion:GNSS Data: Latitude: 44.6600668, Longitude: -123.4037492, Elevation: 313.631, Timestamp: 1710961302204 [ms], Covariance: [11.436789435704272, 0.12029160922994298, 0.03498586959232097, 0.1490340280594069, 11.424010895569356, 0.17219095068277113, 0.8614886863560002, 0.17955815453813528, 34.62467422651605]
INFO:timbertrack.core.svo_gpx_processing:GPS Ingest Status: GNSS DATA COVARIANCE MUST VARY : GNSS_DATA_NEED_FIX
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Current: 1713549348 [s]
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Image: 1710961302 [s]
INFO:timbertrack.core.svo_gpx_processing:GPS Measurement: timestamp=1710961302437 time_delta=0 lat=44.xxxxxx lon=-123.xxxxxx elevation=313.631 covariance=[10.543358475101742, 0.5852470149770544, 0.3779800917273948, 0.12954841319296695, 11.39241991793664, 0.1381420609352303, 0.13456162474786326, 0.3130939087794411, 34.52119812362232]
INFO:timbertrack.core.fusion:GNSS Data: Latitude: 44.xxxxxx, Longitude: -123.xxxxxx, Elevation: 313.631, Timestamp: 1710961302437 [ms], Covariance: [10.543358475101742, 0.5852470149770544, 0.3779800917273948, 0.12954841319296695, 11.39241991793664, 0.1381420609352303, 0.13456162474786326, 0.3130939087794411, 34.52119812362232]
INFO:timbertrack.core.svo_gpx_processing:GPS Ingest Status: GNSS DATA COVARIANCE MUST VARY : GNSS_DATA_NEED_FIX
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Current: 1713549357 [s]
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Image: 1710961302 [s]
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Current: 1713549357 [s]
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Image: 1710961302 [s]
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Current: 1713549358 [s]
INFO:timbertrack.core.svo_gpx_processing:Camera Timestamp Image: 1710961303 [s]
INFO:timbertrack.core.svo_gpx_processing:GPS Measurement: timestamp=1710961303104 time_delta=0 lat=44.xxxxxx lon=-123.xxxxxx elevation=313.752 covariance=[11.244546691317849, 0.2935736226496448, 0.9952390570072722, 0.17936602423050318, 10.745176229804219, 0.5375137099587735, 0.9125033234655663, 0.6979525413240174, 34.343475751669956]
INFO:timbertrack.core.fusion:GNSS Data: Latitude: 44.xxxxxxx, Longitude: -123.xxxxxx, Elevation: 313.752, Timestamp: 1710961303104 [ms], Covariance: [11.244546691317849, 0.2935736226496448, 0.9952390570072722, 0.17936602423050318, 10.745176229804219, 0.5375137099587735, 0.9125033234655663, 0.6979525413240174, 34.343475751669956]
INFO:timbertrack.core.svo_gpx_processing:GPS Ingest Status: GNSS DATA COVARIANCE MUST VARY : GNSS_DATA_NEED_FIX

You can see here that my covariances are not identical, though they are fairly similar.

Try setting the fix_type within the sl.GNSSData. If your GNSS data covariance is indeed varying, then setting the fix_type might fix your issue and ingestion will be successful. I was having similar issues with C++. I’m not certain but I think there’s a bug in ZEDSDK that returns the wrong ingest error code when printing it using the sl::toString method, which can be misleading.

I made a pose about it here. After getting GNSS fusion to work with my camera, I was also having issues with the heading of the camera’s GeoPose being connected to the wrong axis of the camera.

2 Likes

@ClayJay3 Setting “fix_type” with the python SDK does not seem to be an option.

You are correct, I totally missed that. Python doesn’t require setting the fix type or GNSS status.