fixed odometry "empty image?" error when reading from database with

stereo images, fixed databaseViewer fatal error when there are null
poses
This commit is contained in:
Mathieu Labbe
2015-01-08 16:12:45 -05:00
parent db382d6149
commit 05ee9a7b84
3 changed files with 30 additions and 4 deletions
+5
View File
@@ -230,6 +230,11 @@ SensorData DBReader::getNextData()
pose,
variance,
seq);
UDEBUG("Laser=%d RGB/Left=%d Depth=%d Right=%d",
data.laserScan().empty()?0:1,
data.image().empty()?0:1,
data.depth().empty()?0:1,
data.rightImage().empty()?0:1);
}
}
else
+1 -1
View File
@@ -1308,7 +1308,7 @@ void OdometryThread::mainLoop()
void OdometryThread::addData(const SensorData & data)
{
if(data.image().empty() || data.depth().empty() || data.fx() == 0.0f || data.fy() == 0.0f)
if(data.image().empty() || data.depthOrRightImage().empty() || data.fx() == 0.0f || data.fyOrBaseline() == 0.0f)
{
ULOGGER_ERROR("image empty !?");
return;
+24 -3
View File
@@ -406,9 +406,30 @@ void DatabaseViewer::updateIds()
std::map<int, int> nids = memory_->getNeighborsId(memory_->getLastWorkingSignature()->id(), 0, -1, true);
memory_->getMetricConstraints(uKeys(nids), poses_, links_, true);
int first = nids.begin()->first;
ui_->spinBox_optimizationsFrom->setRange(first, memory_->getLastWorkingSignature()->id());
ui_->spinBox_optimizationsFrom->setValue(first);
if(poses_.size())
{
bool nullPoses = poses_.begin()->second.isNull();
for(std::map<int,Transform>::iterator iter=poses_.begin(); iter!=poses_.end(); ++iter)
{
if((!iter->second.isNull() && nullPoses) ||
(iter->second.isNull() && !nullPoses))
{
UWARN("Mixed valid and null poses! Ignoring graph...");
poses_.clear();
links_.clear();
break;
}
}
if(nullPoses)
{
poses_.clear();
links_.clear();
}
int first = nids.begin()->first;
ui_->spinBox_optimizationsFrom->setRange(first, memory_->getLastWorkingSignature()->id());
ui_->spinBox_optimizationsFrom->setValue(first);
}
}
ui_->actionGenerate_TORO_graph_graph->setEnabled(false);