fix(api): get_imu_correspondence
This commit is contained in:
parent
f4007aa78c
commit
ecb8cd640a
|
@ -55,10 +55,7 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||||
if (left_data.frame.empty() || right_data.frame.empty()) {
|
if (!left_data.frame.empty() || !right_data.frame.empty()) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto img_stamp = left_data.img->timestamp;
|
auto img_stamp = left_data.img->timestamp;
|
||||||
LOG(INFO) << "Img timestamp: " << img_stamp
|
LOG(INFO) << "Img timestamp: " << img_stamp
|
||||||
<< ", diff_prev=" << (img_stamp - prev_img_stamp);
|
<< ", diff_prev=" << (img_stamp - prev_img_stamp);
|
||||||
|
@ -69,6 +66,9 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
auto &&motion_datas = api->GetMotionDatas();
|
auto &&motion_datas = api->GetMotionDatas();
|
||||||
LOG(INFO) << "Imu count: " << motion_datas.size();
|
LOG(INFO) << "Imu count: " << motion_datas.size();
|
||||||
|
if (motion_datas.size() == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for (size_t i = 0, n = motion_datas.size() - 1; i <= n; ++i) {
|
for (size_t i = 0, n = motion_datas.size() - 1; i <= n; ++i) {
|
||||||
auto data = motion_datas[i];
|
auto data = motion_datas[i];
|
||||||
auto imu_flag = data.imu->flag;
|
auto imu_flag = data.imu->flag;
|
||||||
|
@ -85,7 +85,7 @@ int main(int argc, char *argv[]) {
|
||||||
ss << " timestamp: " << imu_stamp
|
ss << " timestamp: " << imu_stamp
|
||||||
<< ", diff_prev=" << (imu_stamp - prev_imu_stamp)
|
<< ", diff_prev=" << (imu_stamp - prev_imu_stamp)
|
||||||
<< ", diff_img=" << (1.0f + imu_stamp - img_stamp);
|
<< ", diff_img=" << (1.0f + imu_stamp - img_stamp);
|
||||||
#ifdef CHECK_ACCEL_THEN_GYRO
|
#ifdef CHECK_ACCEL_THEN_GYRO
|
||||||
if (imu_flag > 0) {
|
if (imu_flag > 0) {
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
if (i == 0) { // first
|
if (i == 0) { // first
|
||||||
|
@ -106,16 +106,16 @@ int main(int argc, char *argv[]) {
|
||||||
if (!ok) exit = true;
|
if (!ok) exit = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
LOG(INFO) << ss.str();
|
LOG(INFO) << ss.str();
|
||||||
|
|
||||||
prev_imu_stamp = imu_stamp;
|
prev_imu_stamp = imu_stamp;
|
||||||
}
|
}
|
||||||
LOG(INFO);
|
LOG(INFO);
|
||||||
#ifdef CHECK_ACCEL_THEN_GYRO
|
#ifdef CHECK_ACCEL_THEN_GYRO
|
||||||
imu_count += motion_datas.size();
|
imu_count += motion_datas.size();
|
||||||
if (exit) break;
|
if (exit) break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
painter.DrawImgData(img, *left_data.img);
|
painter.DrawImgData(img, *left_data.img);
|
||||||
|
@ -125,6 +125,7 @@ int main(int argc, char *argv[]) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
cv::imshow("frame", img);
|
cv::imshow("frame", img);
|
||||||
|
}
|
||||||
|
|
||||||
char key = static_cast<char>(cv::waitKey(1));
|
char key = static_cast<char>(cv::waitKey(1));
|
||||||
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
||||||
|
|
Loading…
Reference in New Issue
Block a user