Added c++ example of RTAB-Map RGB-D version

git-svn-id: http://rtabmap.googlecode.com/svn/trunk/rtabmap@1152 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
matlabbe
2014-02-24 21:04:02 +00:00
parent 510e9cab89
commit 30981b102e
10 changed files with 373 additions and 28 deletions

View File

@@ -66,10 +66,13 @@ public:
};
public:
RtabmapThread();
// take ownership
RtabmapThread(Rtabmap * rtabmap);
virtual ~RtabmapThread();
void clearBufferedData();
void setDetectorRate(float rate);
void setBufferSize(int bufferSize);
protected:
virtual void handleEvent(UEvent * anEvent);

View File

@@ -33,14 +33,15 @@
namespace rtabmap {
RtabmapThread::RtabmapThread() :
RtabmapThread::RtabmapThread(Rtabmap * rtabmap) :
_imageBufferMaxSize(Parameters::defaultRtabmapImageBufferSize()),
_rate(Parameters::defaultRtabmapDetectionRate()),
_frameRateTimer(new UTimer()),
_rtabmap(new Rtabmap()),
_rtabmap(rtabmap),
_paused(false)
{
UASSERT(rtabmap != 0);
}
RtabmapThread::~RtabmapThread()
@@ -77,6 +78,18 @@ void RtabmapThread::clearBufferedData()
_imageMutex.unlock();
}
void RtabmapThread::setDetectorRate(float rate)
{
UASSERT(rate >= 0.0f);
_rate = rate;
}
void RtabmapThread::setBufferSize(int bufferSize)
{
UASSERT(bufferSize >= 0);
_imageBufferMaxSize = bufferSize;
}
void RtabmapThread::publishMap(bool optimized, bool full) const
{
std::map<int, std::vector<unsigned char> > images;