Replace LOG(WARNING) with VLOG(2) When get imu params failed or image packet is unaccepted

This commit is contained in:
kalman 2018-09-01 21:03:28 +08:00
parent 54f01eec1a
commit 92585a3b8d
2 changed files with 12 additions and 12 deletions

View File

@ -252,7 +252,7 @@ MotionIntrinsics Device::GetMotionIntrinsics(bool *ok) const {
return *motion_intrinsics_; return *motion_intrinsics_;
} else { } else {
*ok = false; *ok = false;
LOG(WARNING) << "Motion intrinsics not found"; VLOG(2) << "Motion intrinsics not found";
return {}; return {};
} }
} }
@ -263,7 +263,7 @@ Extrinsics Device::GetMotionExtrinsics(const Stream &from, bool *ok) const {
return motion_from_extrinsics_.at(from); return motion_from_extrinsics_.at(from);
} catch (const std::out_of_range &e) { } catch (const std::out_of_range &e) {
*ok = false; *ok = false;
LOG(WARNING) << "Motion extrinsics from " << from << " not found"; VLOG(2) << "Motion extrinsics from " << from << " not found";
return {}; return {};
} }
} }
@ -580,7 +580,7 @@ void Device::ReadAllInfos() {
VLOG(2) << "Motion extrinsics left to imu: {" VLOG(2) << "Motion extrinsics left to imu: {"
<< GetMotionExtrinsics(Stream::LEFT) << "}"; << GetMotionExtrinsics(Stream::LEFT) << "}";
} else { } else {
LOG(WARNING) << "Motion intrinsics & extrinsics not exist"; VLOG(2) << "Motion intrinsics & extrinsics not exist";
} }
} }

View File

@ -50,9 +50,9 @@ bool unpack_stereo_img_data(
// << ", checksum=0x" << std::hex << static_cast<int>(img_packet.checksum); // << ", checksum=0x" << std::hex << static_cast<int>(img_packet.checksum);
if (img_packet.header != 0x3B) { if (img_packet.header != 0x3B) {
LOG(WARNING) << "Image packet header must be 0x3B, but 0x" << std::hex VLOG(2) << "Image packet header must be 0x3B, but 0x" << std::hex
<< std::uppercase << std::setw(2) << std::setfill('0') << std::uppercase << std::setw(2) << std::setfill('0')
<< static_cast<int>(img_packet.header) << " now"; << static_cast<int>(img_packet.header) << " now";
return false; return false;
} }
@ -61,11 +61,11 @@ bool unpack_stereo_img_data(
checksum = (checksum ^ packet[i]); checksum = (checksum ^ packet[i]);
} }
if (img_packet.checksum != checksum) { if (img_packet.checksum != checksum) {
LOG(WARNING) << "Image packet checksum should be 0x" << std::hex VLOG(2) << "Image packet checksum should be 0x" << std::hex
<< std::uppercase << std::setw(2) << std::setfill('0') << std::uppercase << std::setw(2) << std::setfill('0')
<< static_cast<int>(img_packet.checksum) << ", but 0x" << static_cast<int>(img_packet.checksum) << ", but 0x"
<< std::setw(2) << std::setfill('0') << std::setw(2) << std::setfill('0') << static_cast<int>(checksum)
<< static_cast<int>(checksum) << " now"; << " now";
return false; return false;
} }
@ -160,7 +160,7 @@ bool Streams::PushStream(const Capabilities &capability, const void *data) {
} else { } else {
// discard left // discard left
DiscardStreamData(Stream::LEFT); DiscardStreamData(Stream::LEFT);
LOG(WARNING) << "Image packet is unaccepted, frame dropped"; VLOG(2) << "Image packet is unaccepted, frame dropped";
pushed = false; pushed = false;
} }
} break; } break;