Commit 40b92b96 authored by Thiago Santini's avatar Thiago Santini

Fixes synchronization timestamp and isRecent update

parent f3c1e19e
......@@ -449,8 +449,10 @@ bool CameraWidget::isDataRecent(Timestamp t)
Timestamp cur = gTimer.elapsed();
if (cur - t < maxAgeMs) // TODO: make this based on estimated FPS?
return true;
if (cur - lastUpdate > maxAgeMs) // not recent, but we haven't update in a while
if (cur - lastUpdate > maxAgeMs) { // not recent, but we haven't update in a while
lastUpdate = cur;
return true;
}
return false;
}
......
......@@ -33,6 +33,7 @@
class EyeData : public InputData {
public:
explicit EyeData(){
timestamp = 0;
input = cv::Mat();
pupil = cv::RotatedRect(cv::Point2f(0,0), cv::Size2f(0,0), 0);
validPupil = false;
......
......@@ -49,6 +49,7 @@ public:
class FieldData : public InputData {
public:
explicit FieldData(){
timestamp = 0;
input = cv::Mat();
gazeEstimate = cv::Point3f(0,0,0);
validGazeEstimate = false;
......
......@@ -33,7 +33,7 @@ public:
cv::Mat gazeEstimationVisualization;
bool showGazeEstimationVisualization;
QString header() const {
return "Timestamp" + gDataSeparator + FieldData().header("field.") + EyeData().header("left.") + EyeData().header("right.");
return QString("sync.timestamp") + gDataSeparator + FieldData().header("field.") + EyeData().header("left.") + EyeData().header("right.");
}
QString toQString() {
return QString::number(timestamp) + gDataSeparator + field.toQString() + lEye.toQString() + rEye.toQString();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment