@@ -52,7 +52,7 @@ def main():
52
52
if status != sl .ERROR_CODE .SUCCESS :
53
53
print ("[ZED][ERROR] Camera Open : " + repr (status )+ ". Exit program." )
54
54
exit ()
55
- # Enable positional tracking:
55
+ # Enable positional tracking:
56
56
positional_init = zed .enable_positional_tracking ()
57
57
if positional_init != sl .ERROR_CODE .SUCCESS :
58
58
print ("[ZED][ERROR] Can't start tracking of camera : " + repr (status )+ ". Exit program." )
@@ -86,15 +86,16 @@ def main():
86
86
# Enable positional tracking for Fusion object
87
87
positional_tracking_fusion_parameters = sl .PositionalTrackingFusionParameters ()
88
88
positional_tracking_fusion_parameters .enable_GNSS_fusion = True
89
- gnss_calibration_parameters = {
90
- "target_yaw_uncertainty" : 7e-3 ,
91
- "enable_translation_uncertainty_target" : False ,
92
- "target_translation_uncertainty" : 10e-2 ,
93
- "enable_reinitialization" : False ,
94
- "gnss_vio_reinit_threshold" : 5 ,
95
- "enable_rolling_calibration" : False
96
- }
97
- fusion .enable_positionnal_tracking ({"gnss_calibration_parameters" : gnss_calibration_parameters , "enable_GNSS_fusion" : True })
89
+ gnss_calibration_parameters = sl .GNSSCalibrationParameters ()
90
+ gnss_calibration_parameters .target_yaw_uncertainty = 7e-3
91
+ gnss_calibration_parameters .enable_translation_uncertainty_target = False
92
+ gnss_calibration_parameters .target_translation_uncertainty = 15e-2
93
+ gnss_calibration_parameters .enable_reinitialization = False
94
+ gnss_calibration_parameters .gnss_vio_reinit_threshold = 5
95
+ gnss_calibration_parameters .enable_rolling_calibration = False
96
+ positional_tracking_fusion_parameters .gnss_calibration_parameters = gnss_calibration_parameters
97
+
98
+ fusion .enable_positionnal_tracking (positional_tracking_fusion_parameters )
98
99
99
100
# Setup viewer:
100
101
py_translation = sl .Translation ()
@@ -129,7 +130,9 @@ def main():
129
130
"altitude" : altitude ,
130
131
}
131
132
export .saveKMLData ("raw_gnss.kml" , coordinates )
132
- if ingest_error != sl .FUSION_ERROR_CODE .SUCCESS :
133
+ # Fusion is asynchronous and needs synchronization. Sometime GNSSData comes before camera data raising "NO_NEW_DATA_AVAILABLE" error
134
+ # This does not necessary means that fusion doesn't work but that no camera data were presents for the gnss timestamp when you ingested the data.
135
+ if ingest_error != sl .FUSION_ERROR_CODE .SUCCESS and ingest_error != sl .FUSION_ERROR_CODE .NO_NEW_DATA_AVAILABLE :
133
136
print ("Ingest error occurred when ingesting GNSSData: " ,ingest_error )
134
137
# get the fused position
135
138
if fusion .process () == sl .FUSION_ERROR_CODE .SUCCESS :
@@ -151,13 +154,14 @@ def main():
151
154
viewer .updateGeoPoseData (current_geopose , zed .get_timestamp (sl .TIME_REFERENCE .CURRENT ).data_ns / 1000 )
152
155
_ , yaw_std , position_std = fusion .get_current_gnss_calibration_std ()
153
156
if yaw_std != - 1 :
154
- print ("GNSS State : " ,current_geopose_satus ," : calibration uncertainty yaw_std " ,yaw_std ,"position_std" ,position_std [0 ],"," ,position_std [1 ],"," ,position_std [2 ])
157
+ print ("GNSS State : " ,current_geopose_satus ," : calibration uncertainty yaw_std " ,yaw_std ,"position_std" ,position_std [0 ],"," ,position_std [1 ],"," ,position_std [2 ], end = ' \r ' )
155
158
else :
156
159
"""
157
160
GNSS coordinate system to ZED coordinate system is not initialize yet
158
161
The initialisation between the coordinates system is basicaly an optimization problem that
159
162
Try to fit the ZED computed path with the GNSS computed path. In order to do it just move
160
- your system by the distance you specified in positional_tracking_fusion_parameters.gnss_initialisation_distance
163
+ your system and wait that uncertainty come bellow uncertainty threshold you set up in your
164
+ initialization parameters.
161
165
"""
162
166
fusion .close ()
163
167
zed .close ()
0 commit comments