fix(correspondence): improve warning if not start motion tracking

This commit is contained in:
John Zhao 2019-02-22 14:57:20 +08:00
parent 84145cd35c
commit 6d0fa3a3ca

View File

@ -200,8 +200,11 @@ std::vector<api::StreamData> Correspondence::GetReadyStreamData(bool matched) {
{ {
std::lock_guard<std::recursive_mutex> _(mtx_motion_datas_); std::lock_guard<std::recursive_mutex> _(mtx_motion_datas_);
if (motion_datas_.empty()) { if (motion_datas_.empty()) {
LOG(WARNING) << "motion data is unexpected empty!"; LOG(WARNING) << "motion data is unexpected empty!"
return {}; "\n\n Please ensure Start(Source::MOTION_TRACKING) "
"or Start(Source::ALL)\n";
std::lock_guard<std::recursive_mutex> _(mtx_stream_datas_);
return std::move(matched ? stream_datas_match_ : stream_datas_);
} }
imu_stamp = motion_datas_.back().imu->timestamp; imu_stamp = motion_datas_.back().imu->timestamp;
} }