feat(*): add external time source flag in img data
This commit is contained in:
parent
3ac3c7c8ee
commit
5017d5c901
|
@ -660,11 +660,14 @@ struct MYNTEYE_API ImgData {
|
||||||
std::uint64_t timestamp;
|
std::uint64_t timestamp;
|
||||||
/** Image exposure time, virtual value in [1, 480] */
|
/** Image exposure time, virtual value in [1, 480] */
|
||||||
std::uint16_t exposure_time;
|
std::uint16_t exposure_time;
|
||||||
|
/** Is external time source */
|
||||||
|
bool is_etc = false;
|
||||||
|
|
||||||
void Reset() {
|
void Reset() {
|
||||||
frame_id = 0;
|
frame_id = 0;
|
||||||
timestamp = 0;
|
timestamp = 0;
|
||||||
exposure_time = 0;
|
exposure_time = 0;
|
||||||
|
is_etc = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImgData() {
|
ImgData() {
|
||||||
|
@ -674,11 +677,13 @@ struct MYNTEYE_API ImgData {
|
||||||
frame_id = other.frame_id;
|
frame_id = other.frame_id;
|
||||||
timestamp = other.timestamp;
|
timestamp = other.timestamp;
|
||||||
exposure_time = other.exposure_time;
|
exposure_time = other.exposure_time;
|
||||||
|
is_etc = other.is_etc;
|
||||||
}
|
}
|
||||||
ImgData &operator=(const ImgData &other) {
|
ImgData &operator=(const ImgData &other) {
|
||||||
frame_id = other.frame_id;
|
frame_id = other.frame_id;
|
||||||
timestamp = other.timestamp;
|
timestamp = other.timestamp;
|
||||||
exposure_time = other.exposure_time;
|
exposure_time = other.exposure_time;
|
||||||
|
is_etc = other.is_etc;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,7 +32,8 @@ struct ImagePacket {
|
||||||
std::uint64_t timestamp;
|
std::uint64_t timestamp;
|
||||||
std::uint16_t exposure_time;
|
std::uint16_t exposure_time;
|
||||||
std::uint8_t checksum;
|
std::uint8_t checksum;
|
||||||
|
// Is external time source
|
||||||
|
bool is_etc;
|
||||||
ImagePacket() = default;
|
ImagePacket() = default;
|
||||||
explicit ImagePacket(std::uint8_t *data) {
|
explicit ImagePacket(std::uint8_t *data) {
|
||||||
from_data(data);
|
from_data(data);
|
||||||
|
@ -41,8 +42,8 @@ struct ImagePacket {
|
||||||
void from_data(std::uint8_t *data) {
|
void from_data(std::uint8_t *data) {
|
||||||
std::uint32_t timestamp_l;
|
std::uint32_t timestamp_l;
|
||||||
std::uint32_t timestamp_h;
|
std::uint32_t timestamp_h;
|
||||||
|
header = *data & 0b0111;
|
||||||
header = *data;
|
is_ets = (*data & 0b1000 == 0b1000);
|
||||||
size = *(data + 1);
|
size = *(data + 1);
|
||||||
frame_id = (*(data + 2) << 8) | *(data + 3);
|
frame_id = (*(data + 2) << 8) | *(data + 3);
|
||||||
timestamp_h = (*(data + 4) << 24) | (*(data + 5) << 16) |
|
timestamp_h = (*(data + 4) << 24) | (*(data + 5) << 16) |
|
||||||
|
@ -138,6 +139,7 @@ bool unpack_stereo_img_data(
|
||||||
img->frame_id = img_packet.frame_id;
|
img->frame_id = img_packet.frame_id;
|
||||||
img->timestamp = img_packet.timestamp;
|
img->timestamp = img_packet.timestamp;
|
||||||
img->exposure_time = img_packet.exposure_time;
|
img->exposure_time = img_packet.exposure_time;
|
||||||
|
img->is_etc = img_packet.is_etc;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user