Hi, I am using zed 2i to collect some data for ORB_SLAM using zed-open-capture
my code like this:
const sl_oc::sensors::data::Imu imuData = sensCap->getLastIMUData(2000);
// imuDatas is a std::deque, store the imu data in order
imuDatas.push_back(imuData);
And then I found out there is so many data.timestamp less than the frist imu data.
My code like this:
auto start_t = imuDatas[0].timestamp;
int count = 0;
for(auto &imuData : imuDatas) {
data.imuDatas.push_back(imuData);
if(start_t > imuData.timestamp) {
std::cout << "smaller" << std::endl;
count += 1;
}
}
std::cout << count << std::endl;
cout is 5475, but imuDatas size is 8730
Then I did some experiments,test sensor example is no problem. And finally I found out if i remove this code
videoCap->enableSensorSync(sensCap);
imu data timestamp will be correct. So the question is
- Did I make a mistake in my code?
- Or my code is right. this situation is normal.
- If this is normal,Is the data wrong of timestamp or out of order?