mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-10 05:20:19 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user