MainWindow: Odometry visualization not updated if msgs are received faster than they can be visualized. ZED: self-calibration set to true by default (should be true for ZED-M vio)

This commit is contained in:
matlabbe
2018-06-14 17:25:35 -04:00
parent f638add755
commit c6d893bc98
4 changed files with 8 additions and 13 deletions
+2 -2
View File
@@ -123,7 +123,7 @@ public:
bool computeOdometry = false, bool computeOdometry = false,
float imageRate=0.0f, float imageRate=0.0f,
const Transform & localTransform = Transform::getIdentity(), const Transform & localTransform = Transform::getIdentity(),
bool selfCalibration = false); bool selfCalibration = true);
CameraStereoZed( CameraStereoZed(
const std::string & svoFilePath, const std::string & svoFilePath,
int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY int quality = 1, // 0=NONE, 1=PERFORMANCE, 2=QUALITY
@@ -132,7 +132,7 @@ public:
bool computeOdometry = false, bool computeOdometry = false,
float imageRate=0.0f, float imageRate=0.0f,
const Transform & localTransform = Transform::getIdentity(), const Transform & localTransform = Transform::getIdentity(),
bool selfCalibration = false); bool selfCalibration = true);
virtual ~CameraStereoZed(); virtual ~CameraStereoZed();
virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = ""); virtual bool init(const std::string & calibrationFolder = ".", const std::string & cameraName = "");
+4 -3
View File
@@ -1000,16 +1000,17 @@ SensorData CameraStereoZed::captureImage(CameraInfo * info)
{ {
UTimer timer; UTimer timer;
bool res = zed_->grab(rparam); bool res = zed_->grab(rparam);
while (src_ == CameraVideo::kUsbDevice && res && timer.elapsed() < 2.0) while (src_ == CameraVideo::kUsbDevice && res!=sl::SUCCESS && timer.elapsed() < 2.0)
{ {
// maybe there is a latency with the USB, try again in 10 ms (for the next 2 seconds) // maybe there is a latency with the USB, try again in 10 ms (for the next 2 seconds)
uSleep(10); uSleep(10);
res = zed_->grab(rparam); res = zed_->grab(rparam);
} }
if(!res) if(res==sl::SUCCESS)
{ {
// get left image // get left image
sl::Mat tmp;zed_->retrieveImage(tmp,sl::VIEW_LEFT); sl::Mat tmp;
zed_->retrieveImage(tmp,sl::VIEW_LEFT);
cv::Mat rgbaLeft = slMat2cvMat(tmp); cv::Mat rgbaLeft = slMat2cvMat(tmp);
cv::Mat left; cv::Mat left;
+1 -7
View File
@@ -874,13 +874,7 @@ bool MainWindow::handleEvent(UEvent* anEvent)
} }
else else
{ {
// we receive too many odometry events! just send without data // we receive too many odometry events! ignore them
SensorData data(cv::Mat(), cameraEvent->data().id(), cameraEvent->data().stamp());
data.setCameraModels(cameraEvent->data().cameraModels());
data.setStereoCameraModel(cameraEvent->data().stereoCameraModel());
data.setGroundTruth(cameraEvent->data().groundTruth());
OdometryEvent tmp(data, cameraEvent->info().odomPose, odomInfo);
emit odometryReceived(tmp, true);
} }
} }
} }
+1 -1
View File
@@ -1622,7 +1622,7 @@ void PreferencesDialog::resetSettings(QGroupBox * groupBox)
_ui->spinBox_stereo_right_device->setValue(-1); _ui->spinBox_stereo_right_device->setValue(-1);
_ui->comboBox_stereoZed_resolution->setCurrentIndex(2); _ui->comboBox_stereoZed_resolution->setCurrentIndex(2);
_ui->comboBox_stereoZed_quality->setCurrentIndex(1); _ui->comboBox_stereoZed_quality->setCurrentIndex(1);
_ui->checkbox_stereoZed_selfCalibration->setChecked(false); _ui->checkbox_stereoZed_selfCalibration->setChecked(true);
_ui->comboBox_stereoZed_sensingMode->setCurrentIndex(0); _ui->comboBox_stereoZed_sensingMode->setCurrentIndex(0);
_ui->spinBox_stereoZed_confidenceThr->setValue(100); _ui->spinBox_stereoZed_confidenceThr->setValue(100);
_ui->checkbox_stereoZed_odom->setChecked(false); _ui->checkbox_stereoZed_odom->setChecked(false);