# "Ingest error occurred when ingesting GNSSData: INVALID TIMESTAMP"

**URL:** <https://community.stereolabs.com/t/ingest-error-occurred-when-ingesting-gnssdata-invalid-timestamp/2927>\
**Category:** C++\
**Created:** [June 29, 2023, 5:29am UTC](https://community.stereolabs.com/t/ingest-error-occurred-when-ingesting-gnssdata-invalid-timestamp/2927 "2023-06-29T05:29:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![multicore-manticore](https://community.stereolabs.com/user_avatar/community.stereolabs.com/multicore-manticore/32/1656_2.png) [@multicore-manticore](https://community.stereolabs.com/u/multicore-manticore)\
**Post date:** [June 29, 2023, 5:29am UTC](https://community.stereolabs.com/t/ingest-error-occurred-when-ingesting-gnssdata-invalid-timestamp/2927/1 "2023-06-29T05:29:26Z")

</div>

I am attempting to use GNSS input to improve SLAM accuracy, which appears to be supported by Fusion, but when I run the example geotracking program that ships with SDK 4.04, I get the error message quoted in the subject.

I appear to have gpsd functioning as required from the screenshots below, but require some help figuring out why sl fusion is not using the data correctly.

 ![Screenshot from 2023-06-29 17-18-28](https://community.stereolabs.com/uploads/default/original/2X/7/7ac7fcc8340999147f85a9f4e487bd2bc95e74ce.png)  
 ![Screenshot from 2023-06-29 17-24-37](https://community.stereolabs.com/uploads/default/original/2X/d/db2c1c8741d82c657029eb9d8cb250215d6d4a83.jpeg)

I am using the latest(4.04) SDK on an AGX Orin running jetpack 5.1-b147

---

<div class="post-metadata">

**Author:** ![TanguyHardelin](https://community.stereolabs.com/user_avatar/community.stereolabs.com/tanguyhardelin/32/1298_2.png) [@TanguyHardelin](https://community.stereolabs.com/u/TanguyHardelin)\
**Post date:** [June 29, 2023, 8:16am UTC](https://community.stereolabs.com/t/ingest-error-occurred-when-ingesting-gnssdata-invalid-timestamp/2927/2 "2023-06-29T08:16:12Z")

</div>

Hello @multicore-manticore ,  
Could you activate the verbose mode ([InitParameters Class Reference | API Reference | Stereolabs](https://www.stereolabs.com/docs/api/structsl_1_1InitParameters.html#a27c7dcfc144d4f5db148d8314decfae3)) in order to figure out what’s wrong ?  
Thanks,  
Tanguy

---

<div class="post-metadata">

**Author:** ![system](https://community.stereolabs.com/uploads/default/original/2X/7/703c26fe16845a046a5c896e226e5f728ea313a0.svg) [@system](https://community.stereolabs.com/u/system)\
**Post date:** [June 29, 2023, 8:16am UTC](https://community.stereolabs.com/t/ingest-error-occurred-when-ingesting-gnssdata-invalid-timestamp/2927/3 "2023-06-29T08:16:23Z")

</div>

Hello @multicore-manticore ,  
Could you activate the verbose mode (InitParameters Class Reference | API Reference | Stereolabs) in order to figure out what’s wrong ?  
Thanks,  
Tanguy

[Discourse post]

---

<div class="post-metadata">

**Author:** ![multicore-manticore](https://community.stereolabs.com/user_avatar/community.stereolabs.com/multicore-manticore/32/1656_2.png) [@multicore-manticore](https://community.stereolabs.com/u/multicore-manticore)\
**Post date:** [June 29, 2023, 11:02pm UTC](https://community.stereolabs.com/t/ingest-error-occurred-when-ingesting-gnssdata-invalid-timestamp/2927/4 "2023-06-29T23:02:46Z")

</div>

Could you please go into more detail on how to achieve that? I see in main.cpp that `init_params.sdk_verbose = 1;`  
is already set, but that does not seem to be working as intended. Is there more needed?

---

<div class="post-metadata">

**Author:** ![TanguyHardelin](https://community.stereolabs.com/user_avatar/community.stereolabs.com/tanguyhardelin/32/1298_2.png) [@TanguyHardelin](https://community.stereolabs.com/u/TanguyHardelin)\
**Post date:** [June 30, 2023, 9:31am UTC](https://community.stereolabs.com/t/ingest-error-occurred-when-ingesting-gnssdata-invalid-timestamp/2927/5 "2023-06-30T09:31:23Z")

</div>

Are your sure that `init_params.sdk_verbose` is set to `1` ? Normally it should activate verbose message like: `[ZED][WARNING] The timestamp of the data you are attempting to ingest for [GeoTracking] differs from the current synchronization timestamp. Please ensure you are using the correct timestamp units. Timestamp difference: <insert-here-the-number-of-ms> ms` ( this message could correspond to `INVALID_TIMESTAMP` error code ).

Moreover is this error continue to appear after the first `fusion.process()` call ?  
Regards,  
Tanguy

---

<div class="post-metadata">

**Author:** ![multicore-manticore](https://community.stereolabs.com/user_avatar/community.stereolabs.com/multicore-manticore/32/1656_2.png) [@multicore-manticore](https://community.stereolabs.com/u/multicore-manticore)\
**Post date:** [July 6, 2023, 2:19am UTC](https://community.stereolabs.com/t/ingest-error-occurred-when-ingesting-gnssdata-invalid-timestamp/2927/6 "2023-07-06T02:19:48Z")

</div>

Attached is a copy of main.cpp verifying that yes, `init_params.sdk_verbose` is set to `1`, plus a log from the build in case you notice something that I have missed which may explain why the verbose flag is being ignored.

Adding a debug after the fusion.process() call shows that yes, this issue persists indefinitely after the first call.

```auto
fruit@agx-1:/usr/local/zed/samples/geotracking/recording/cpp/build$ cmake ..
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for sgemm_
-- Looking for sgemm_ - not found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Found BLAS: /usr/lib/aarch64-linux-gnu/libopenblas.so  
CMake Warning (dev) at /usr/local/zed/zed-config.cmake:72 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed. Run "cmake
  --help-policy CMP0146" for policy details. Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  CMakeLists.txt:9 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found CUDA: /usr/local/cuda-11.4 (found suitable version "11.4", minimum required is "11.4") 
CMake Warning (dev) at CMakeLists.txt:10 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed. Run "cmake
  --help-policy CMP0146" for policy details. Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers. Use -Wno-dev to suppress it.

-- Found CUDA: /usr/local/cuda-11.4 (found version "11.4") 
-- Found GLUT: /usr/lib/aarch64-linux-gnu/libglut.so  
-- Found GLEW: /usr/include (found version "2.1.0") 
-- Found OpenGL: /usr/lib/aarch64-linux-gnu/libOpenGL.so   
-- Found GPS: /usr/local/include (found version "14.0") 
Found GPSD library
-- Configuring done (1.3s)
-- Generating done (0.0s)
-- Build files have been written to: /usr/local/zed/samples/geotracking/recording/cpp/build
fruit@agx-1:/usr/local/zed/samples/geotracking/recording/cpp/build$ make -j12
[25%] Building CXX object CMakeFiles/ZED_GNSS_recording.dir/src/gnss_reader/GPSDReader.cpp.o
[25%] Building CXX object CMakeFiles/ZED_GNSS_recording.dir/src/display/GLViewer.cpp.o
[62%] Building CXX object CMakeFiles/ZED_GNSS_recording.dir/src/display/GenericDisplay.cpp.o
[62%] Building CXX object CMakeFiles/ZED_GNSS_recording.dir/src/exporter/GNSSSaver.cpp.o
[62%] Building CXX object CMakeFiles/ZED_GNSS_recording.dir/src/exporter/TimestampUtils.cpp.o
[87%] Building CXX object CMakeFiles/ZED_GNSS_recording.dir/src/exporter/KMLExporter.cpp.o
[87%] Building CXX object CMakeFiles/ZED_GNSS_recording.dir/src/main.cpp.o
In file included from /usr/local/zed/samples/geotracking/recording/cpp/include/exporter/KMLExporter.h:7,
                 from /usr/local/zed/samples/geotracking/recording/cpp/src/exporter/KMLExporter.cpp:1:
/usr/local/zed/include/sl/Fusion.hpp:68:64: note: #pragma message: ~ FUSION SDK is distributed in Early Access ~
   68 | #pragma message("~ FUSION SDK is distributed in Early Access ~")
      | ^
In file included from /usr/local/zed/samples/geotracking/recording/cpp/include/gnss_reader/GPSDReader.hpp:5,
                 from /usr/local/zed/samples/geotracking/recording/cpp/src/gnss_reader/GPSDReader.cpp:1:
/usr/local/zed/include/sl/Fusion.hpp:68:64: note: #pragma message: ~ FUSION SDK is distributed in Early Access ~
   68 | #pragma message("~ FUSION SDK is distributed in Early Access ~")
      | ^
In file included from /usr/local/zed/samples/geotracking/recording/cpp/include/display/GenericDisplay.h:4,
                 from /usr/local/zed/samples/geotracking/recording/cpp/src/display/GenericDisplay.cpp:1:
/usr/local/zed/include/sl/Fusion.hpp:68:64: note: #pragma message: ~ FUSION SDK is distributed in Early Access ~
   68 | #pragma message("~ FUSION SDK is distributed in Early Access ~")
      | ^
In file included from /usr/local/zed/samples/geotracking/recording/cpp/include/exporter/GNSSSaver.h:6,
                 from /usr/local/zed/samples/geotracking/recording/cpp/src/exporter/GNSSSaver.cpp:1:
/usr/local/zed/include/sl/Fusion.hpp:68:64: note: #pragma message: ~ FUSION SDK is distributed in Early Access ~
   68 | #pragma message("~ FUSION SDK is distributed in Early Access ~")
      | ^
/usr/local/zed/samples/geotracking/recording/cpp/src/display/GLViewer.cpp:23:1: warning: ISO C++ forbids converting a string constant to ‘GLchar*’ {aka ‘char*’} [-Wwrite-strings]
   23 | "#version 330 core\n"
      | ^ ~~~~~~~~~~~~~~~~~~~~
   24 | "layout(location = 0) in vec3 in_Vertex;\n"
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   25 | "layout(location = 1) in vec3 in_Color;\n"
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   26 | "uniform mat4 u_mvpMatrix;\n"
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   27 | "out vec3 b_color;\n"
      | ~~~~~~~~~~~~~~~~~~~~~
   28 | "void main() {\n"
      | ~~~~~~~~~~~~~~~~~
   29 | " b_color = in_Color;\n"
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~
   30 | " gl_Position = u_mvpMatrix * vec4(in_Vertex, 1);\n"
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 | "}";
      | ~~~
/usr/local/zed/samples/geotracking/recording/cpp/src/display/GLViewer.cpp:34:1: warning: ISO C++ forbids converting a string constant to ‘GLchar*’ {aka ‘char*’} [-Wwrite-strings]
   34 | "#version 330 core\n"
      | ^ ~~~~~~~~~~~~~~~~~~~~
   35 | "in vec3 b_color;\n"
      | ~~~~~~~~~~~~~~~~~~~~
   36 | "layout(location = 0) out vec4 out_Color;\n"
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   37 | "void main() {\n"
      | ~~~~~~~~~~~~~~~~~
   38 | " out_Color = vec4(b_color, 1);\n"
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   39 | "}";
      | ~~~
In file included from /usr/local/zed/samples/geotracking/recording/cpp/src/main.cpp:29:
/usr/local/zed/include/sl/Fusion.hpp:68:64: note: #pragma message: ~ FUSION SDK is distributed in Early Access ~
   68 | #pragma message("~ FUSION SDK is distributed in Early Access ~")
      | ^
[100%] Linking CXX executable ZED_GNSS_recording
[100%] Built target ZED_GNSS_recording

```

[main.cpp](https://community.stereolabs.com/uploads/short-url/egV1LGDNZF1oew92zQNqvdxzS1e.cpp) (7.5 KB)

---

<div class="post-metadata">

**Author:** ![multicore-manticore](https://community.stereolabs.com/user_avatar/community.stereolabs.com/multicore-manticore/32/1656_2.png) [@multicore-manticore](https://community.stereolabs.com/u/multicore-manticore)\
**Post date:** [July 6, 2023, 10:43pm UTC](https://community.stereolabs.com/t/ingest-error-occurred-when-ingesting-gnssdata-invalid-timestamp/2927/7 "2023-07-06T22:43:15Z")

</div>

The recent update to SDK 4.0.5 seems to have resolved this issue

---

<div class="post-metadata">

**Author:** ![ShyamKrishna33](https://community.stereolabs.com/user_avatar/community.stereolabs.com/shyamkrishna33/32/3587_2.png) [@ShyamKrishna33](https://community.stereolabs.com/u/ShyamKrishna33)\
**Post date:** [October 15, 2024, 1:28pm UTC](https://community.stereolabs.com/t/ingest-error-occurred-when-ingesting-gnssdata-invalid-timestamp/2927/8 "2024-10-15T13:28:12Z")

</div>

![image](https://community.stereolabs.com/uploads/default/original/2X/0/00a773f21a2b6aef4822cacf054f0bcb6c8fe0c3.jpeg)  
I am getting the same issue, but i am using the latest ZED SDK 4.2. I verified the ros2 topics of /clock and /gps/fix and the timestamps are perfectly in sync. I am not sure where the issue is from.
