stereolabs / zed-sdk

⚡️The spatial perception framework for rapidly building smart robots and spaces
https://stereolabs.com
MIT License
822 stars 466 forks source link

Timestamp error of sensors data #567

Closed nathanlau98 closed 1 year ago

nathanlau98 commented 1 year ago

Preliminary Checks

Description

Hi, I am using ZED 2i camera and zed sdk to get image and imu data. However, when I want to synchronize the timestamp of two types of data, I find that using the interface zed.getSensorsData(sensors_data, sl::TIME_REFERENCE::CURRENT), the value of sensors_data.imu.timestamp is totally wrong, which means the timestamp can be randomly smaller or bigger than the timestamp before. And I try to use sl::TIME_REFERENCE::IMAGE and the result is same. Addtionally I try the tutorial 7 code, in 5 seconds I only get several output and the result seems not correct. I also use ZED Sensor Viewer and get correct data and timestamps. So I think there are something wrong about the interface

Steps to Reproduce

    while (loop++ < 200) {
        zed.getSensorsData(sensors_data, sl::TIME_REFERENCE::CURRENT);
        std::cout << "sensor_data timestamp: " << sensors_data.imu.timestamp << "   loop: " << loop << std::endl;
    }

Expected Result

increasing timestamp

Actual Result

sensor_data timestamp: 4326999519641206167 loop: 1 sensor_data timestamp: 4326816545444461980 loop: 2 sensor_data timestamp: 4326816545444461980 loop: 3 sensor_data timestamp: 4326816545444461980 loop: 4 sensor_data timestamp: 4327005347911826837 loop: 5 sensor_data timestamp: 4327005347911826837 loop: 6 sensor_data timestamp: 4327005347911826837 loop: 7 sensor_data timestamp: 4327005347911826837 loop: 8 sensor_data timestamp: 4327005347911826837 loop: 9 sensor_data timestamp: 4327005347911826837 loop: 10 sensor_data timestamp: 4326549587457211813 loop: 11 sensor_data timestamp: 4326549587457211813 loop: 12 sensor_data timestamp: 4327011876262116758 loop: 13 sensor_data timestamp: 4327011876262116758 loop: 14 sensor_data timestamp: 4327011876262116758 loop: 15 sensor_data timestamp: 4327011876262116758 loop: 16 sensor_data timestamp: 4327011876262116758 loop: 17 sensor_data timestamp: 4326559272608464293 loop: 18 sensor_data timestamp: 4326559272608464293 loop: 19 sensor_data timestamp: 4327016519121763734 loop: 20 sensor_data timestamp: 4327016519121763734 loop: 21 sensor_data timestamp: 4327016519121763734 loop: 22 sensor_data timestamp: 4327016519121763734 loop: 23 sensor_data timestamp: 4326557473017167268 loop: 24 sensor_data timestamp: 4326557473017167268 loop: 25 sensor_data timestamp: 4326557473017167268 loop: 26 sensor_data timestamp: 4326183467265031599 loop: 27 sensor_data timestamp: 4326183467265031599 loop: 28 sensor_data timestamp: 4326183467265031599 loop: 29 sensor_data timestamp: 4326574781735370148 loop: 30 sensor_data timestamp: 4326574781735370148 loop: 31 sensor_data timestamp: 4326574781735370148 loop: 32 sensor_data timestamp: 4326189201046371758 loop: 33 sensor_data timestamp: 4326189201046371758 loop: 34 sensor_data timestamp: 4326441203957497256 loop: 35 sensor_data timestamp: 4326441203957497256 loop: 36 sensor_data timestamp: 4326121100044926386 loop: 37 sensor_data timestamp: 4326121100044926386 loop: 38 sensor_data timestamp: 4326121100044926386 loop: 39 sensor_data timestamp: 4326121100044926386 loop: 40 sensor_data timestamp: 4325659172017274303 loop: 41 sensor_data timestamp: 4325659172017274303 loop: 42 sensor_data timestamp: 4326116165127503281 loop: 43 sensor_data timestamp: 4326116165127503281 loop: 44 sensor_data timestamp: 4326116165127503281 loop: 45 sensor_data timestamp: 4326116165127503281 loop: 46 sensor_data timestamp: 4325774693752634811 loop: 47 sensor_data timestamp: 4325774693752634811 loop: 48 sensor_data timestamp: 4326105693997235633 loop: 49 sensor_data timestamp: 4326105693997235633 loop: 50 sensor_data timestamp: 4326105693997235633 loop: 51 sensor_data timestamp: 4326184012725878191 loop: 52 sensor_data timestamp: 4326184012725878191 loop: 53 sensor_data timestamp: 4326120352720616882 loop: 54 sensor_data timestamp: 4326120352720616882 loop: 55 sensor_data timestamp: 4326120352720616882 loop: 56 sensor_data timestamp: 4326083716649582002 loop: 57 sensor_data timestamp: 4326083716649582002 loop: 58 sensor_data timestamp: 4326083716649582002 loop: 59 sensor_data timestamp: 4326119794374868401 loop: 60 sensor_data timestamp: 4326119794374868401 loop: 61 sensor_data timestamp: 4326119794374868401 loop: 62 sensor_data timestamp: 4326056155844443571 loop: 63 sensor_data timestamp: 4326056155844443571 loop: 64 sensor_data timestamp: 4326056155844443571 loop: 65 sensor_data timestamp: 4326068761573457331 loop: 66 sensor_data timestamp: 4326068761573457331 loop: 67 sensor_data timestamp: 4325919172157504951 loop: 68 sensor_data timestamp: 4325919172157504951 loop: 69 sensor_data timestamp: 4325963375960915381 loop: 70 sensor_data timestamp: 4325963375960915381 loop: 71 sensor_data timestamp: 4325963375960915381 loop: 72 sensor_data timestamp: 4325963375960915381 loop: 73 sensor_data timestamp: 4325769964993641916 loop: 74 sensor_data timestamp: 4325769964993641916 loop: 75 sensor_data timestamp: 4325940007043857847 loop: 76 sensor_data timestamp: 4325940007043857847 loop: 77 sensor_data timestamp: 4325940007043857847 loop: 78 sensor_data timestamp: 4325940007043857847 loop: 79 sensor_data timestamp: 4325706554096483773 loop: 80 sensor_data timestamp: 4325706554096483773 loop: 81 sensor_data timestamp: 4325917595904507320 loop: 82 sensor_data timestamp: 4325917595904507320 loop: 83 sensor_data timestamp: 4325917595904507320 loop: 84 sensor_data timestamp: 4325730262315957693 loop: 85 sensor_data timestamp: 4325730262315957693 loop: 86 sensor_data timestamp: 4325935557457739191 loop: 87 sensor_data timestamp: 4325935557457739191 loop: 88 sensor_data timestamp: 4325935557457739191 loop: 89 sensor_data timestamp: 4325935557457739191 loop: 90 sensor_data timestamp: 4325867001189760441 loop: 91 sensor_data timestamp: 4325867001189760441 loop: 92 sensor_data timestamp: 4325934814428396984 loop: 93 sensor_data timestamp: 4325934814428396984 loop: 94 sensor_data timestamp: 4325934814428396984 loop: 95 sensor_data timestamp: 4325934814428396984 loop: 96 sensor_data timestamp: 4325814941891165626 loop: 97 sensor_data timestamp: 4325814941891165626 loop: 98 sensor_data timestamp: 4325814941891165626 loop: 99 sensor_data timestamp: 4325928260308303286 loop: 100 sensor_data timestamp: 4325928260308303286 loop: 101 sensor_data timestamp: 4325928260308303286 loop: 102 sensor_data timestamp: 4325928260308303286 loop: 103 sensor_data timestamp: 4325755516723658172 loop: 104 sensor_data timestamp: 4325895652916592056 loop: 105 sensor_data timestamp: 4325895652916592056 loop: 106 sensor_data timestamp: 4325895652916592056 loop: 107 sensor_data timestamp: 4325895652916592056 loop: 108 sensor_data timestamp: 4325895652916592056 loop: 109 sensor_data timestamp: 4325789734728105404 loop: 110 sensor_data timestamp: 4325789734728105404 loop: 111 sensor_data timestamp: 4325789734728105404 loop: 112 sensor_data timestamp: 4325894437440847288 loop: 113 sensor_data timestamp: 4325894437440847288 loop: 114 sensor_data timestamp: 4325894437440847288 loop: 115 sensor_data timestamp: 4325894437440847288 loop: 116 sensor_data timestamp: 4325776033782431164 loop: 117 sensor_data timestamp: 4325776033782431164 loop: 118 sensor_data timestamp: 4325776033782431164 loop: 119 sensor_data timestamp: 4325911625899965879 loop: 120 sensor_data timestamp: 4325911625899965879 loop: 121 sensor_data timestamp: 4325911625899965879 loop: 122 sensor_data timestamp: 4325911625899965879 loop: 123 sensor_data timestamp: 4325911625899965879 loop: 124 sensor_data timestamp: 4325907833443843511 loop: 125 sensor_data timestamp: 4325907833443843511 loop: 126 sensor_data timestamp: 4325925670443023799 loop: 127 sensor_data timestamp: 4325925670443023799 loop: 128 sensor_data timestamp: 4325925670443023799 loop: 129 sensor_data timestamp: 4325925670443023799 loop: 130 sensor_data timestamp: 4326115692681100722 loop: 131 sensor_data timestamp: 4326115692681100722 loop: 132 sensor_data timestamp: 4326115692681100722 loop: 133 sensor_data timestamp: 4325929677647510967 loop: 134 sensor_data timestamp: 4325929677647510967 loop: 135 sensor_data timestamp: 4325929677647510967 loop: 136 sensor_data timestamp: 4325929677647510967 loop: 137 sensor_data timestamp: 4325929677647510967 loop: 138 sensor_data timestamp: 4325974001710005686 loop: 139 sensor_data timestamp: 4325599785504472513 loop: 140 sensor_data timestamp: 4325599785504472513 loop: 141 sensor_data timestamp: 4325599785504472513 loop: 142 sensor_data timestamp: 4325599785504472513 loop: 143 sensor_data timestamp: 4326063483058650547 loop: 144 sensor_data timestamp: 4326063483058650547 loop: 145 sensor_data timestamp: 4325867538060672441 loop: 146 sensor_data timestamp: 4325867538060672441 loop: 147 sensor_data timestamp: 4325867538060672441 loop: 148 sensor_data timestamp: 4325867538060672441 loop: 149 sensor_data timestamp: 4326195789526203822 loop: 150 sensor_data timestamp: 4326195789526203822 loop: 151 sensor_data timestamp: 4326195789526203822 loop: 152 sensor_data timestamp: 4326195789526203822 loop: 153 sensor_data timestamp: 4326153827695721905 loop: 154 sensor_data timestamp: 4326153827695721905 loop: 155 sensor_data timestamp: 4326327597777550763 loop: 156 sensor_data timestamp: 4326327597777550763 loop: 157 sensor_data timestamp: 4326327597777550763 loop: 158 sensor_data timestamp: 4326327597777550763 loop: 159 sensor_data timestamp: 4326218892155289006 loop: 160 sensor_data timestamp: 4326218892155289006 loop: 161 sensor_data timestamp: 4326218892155289006 loop: 162 sensor_data timestamp: 4326218892155289006 loop: 163 sensor_data timestamp: 4326218892155289006 loop: 164 sensor_data timestamp: 4326346607302802859 loop: 165 sensor_data timestamp: 4326346607302802859 loop: 166 sensor_data timestamp: 4326346607302802859 loop: 167 sensor_data timestamp: 4325928470761700791 loop: 168 sensor_data timestamp: 4325928470761700791 loop: 169 sensor_data timestamp: 4325928470761700791 loop: 170 sensor_data timestamp: 4326250455869947310 loop: 171 sensor_data timestamp: 4326250455869947310 loop: 172 sensor_data timestamp: 4326250455869947310 loop: 173 sensor_data timestamp: 4326250455869947310 loop: 174 sensor_data timestamp: 4326250455869947310 loop: 175 sensor_data timestamp: 4326274396017655213 loop: 176 sensor_data timestamp: 4326274396017655213 loop: 177 sensor_data timestamp: 4326274396017655213 loop: 178 sensor_data timestamp: 4326123329132953009 loop: 179 sensor_data timestamp: 4326123329132953009 loop: 180 sensor_data timestamp: 4326123329132953009 loop: 181 sensor_data timestamp: 4326183587524115887 loop: 182 sensor_data timestamp: 4326183587524115887 loop: 183 sensor_data timestamp: 4326183587524115887 loop: 184 sensor_data timestamp: 4326045388361432500 loop: 185 sensor_data timestamp: 4326045388361432500 loop: 186 sensor_data timestamp: 4326045388361432500 loop: 187 sensor_data timestamp: 4326045388361432500 loop: 188 sensor_data timestamp: 4326045388361432500 loop: 189 sensor_data timestamp: 4326047003269135796 loop: 190 sensor_data timestamp: 4326047003269135796 loop: 191 sensor_data timestamp: 4326047003269135796 loop: 192 sensor_data timestamp: 4325974731854446005 loop: 193 sensor_data timestamp: 4325974731854446005 loop: 194 sensor_data timestamp: 4325974731854446005 loop: 195 sensor_data timestamp: 4325974731854446005 loop: 196 sensor_data timestamp: 4326035926548479411 loop: 197 sensor_data timestamp: 4326035926548479411 loop: 198 sensor_data timestamp: 4326035926548479411 loop: 199 sensor_data timestamp: 4325912162770877879 loop: 200

ZED Camera model

ZED2i

Environment

OS: windows
SDK version

Anything else?

No response

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment otherwise it will be automatically closed in 5 days