mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-03 01:50:24 +08:00
Added a quality odometry threshold, turning the background yellow when the mapping area has too low features
git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1334 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -21,11 +21,12 @@
|
||||
namespace rtabmap {
|
||||
|
||||
|
||||
OdometryViewer::OdometryViewer(int maxClouds, int decimation, float voxelSize, QWidget * parent) :
|
||||
OdometryViewer::OdometryViewer(int maxClouds, int decimation, float voxelSize, int qualityWarningThr, QWidget * parent) :
|
||||
CloudViewer(parent),
|
||||
maxClouds_(maxClouds),
|
||||
voxelSize_(voxelSize),
|
||||
decimation_(decimation),
|
||||
qualityWarningThr_(qualityWarningThr),
|
||||
id_(0),
|
||||
_aSetVoxelSize(0),
|
||||
_aSetDecimation(0),
|
||||
@@ -48,11 +49,14 @@ OdometryViewer::OdometryViewer(int maxClouds, int decimation, float voxelSize, Q
|
||||
void OdometryViewer::processData()
|
||||
{
|
||||
rtabmap::Image data;
|
||||
int quality;
|
||||
dataMutex_.lock();
|
||||
if(buffer_.size())
|
||||
if(data_.size())
|
||||
{
|
||||
data = buffer_.back();
|
||||
buffer_.clear();
|
||||
data = data_.back();
|
||||
data_.clear();
|
||||
quality = dataQuality_;
|
||||
dataQuality_ = 0;
|
||||
}
|
||||
dataMutex_.unlock();
|
||||
|
||||
@@ -96,7 +100,14 @@ void OdometryViewer::processData()
|
||||
|
||||
this->updateCameraPosition(data.pose());
|
||||
|
||||
this->setBackgroundColor(Qt::black);
|
||||
if(qualityWarningThr_ && quality && quality < qualityWarningThr_)
|
||||
{
|
||||
this->setBackgroundColor(Qt::darkYellow);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->setBackgroundColor(Qt::black);
|
||||
}
|
||||
|
||||
this->render();
|
||||
}
|
||||
@@ -114,15 +125,16 @@ void OdometryViewer::handleEvent(UEvent * event)
|
||||
{
|
||||
bool empty = false;
|
||||
dataMutex_.lock();
|
||||
if(buffer_.empty())
|
||||
if(data_.empty())
|
||||
{
|
||||
buffer_.push_back(odomEvent->data());
|
||||
data_.push_back(odomEvent->data());
|
||||
empty= true;
|
||||
}
|
||||
else
|
||||
{
|
||||
buffer_.back() = odomEvent->data();
|
||||
data_.back() = odomEvent->data();
|
||||
}
|
||||
dataQuality_ = odomEvent->quality();
|
||||
dataMutex_.unlock();
|
||||
if(empty)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user