Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
rtabmap::RtabmapThread Class Reference

#include <RtabmapThread.h>

Inheritance diagram for rtabmap::RtabmapThread:
Inheritance graph
[legend]

List of all members.

Public Types

enum  State {
  kStateInit, kStateDetecting, kStateReseting, kStateClose,
  kStateChangingParameters, kStateDumpingMemory, kStateDumpingPrediction, kStateExportingDOTGraph,
  kStateExportingPoses, kStateCleanDataBuffer, kStatePublishingMap, kStateTriggeringMap,
  kStateSettingGoal, kStateCancellingGoal, kStateLabelling
}

Public Member Functions

void clearBufferedData ()
void close (bool databaseSaved, const std::string &databasePath="")
void createIntermediateNodes (bool enabled)
bool getCreateIntermediateNodes () const
unsigned int getDataBufferSize () const
float getDetectorRate () const
 RtabmapThread (Rtabmap *rtabmap)
void setDataBufferSize (unsigned int bufferSize)
void setDetectorRate (float rate)
virtual ~RtabmapThread ()

Protected Member Functions

virtual bool handleEvent (UEvent *anEvent)

Private Member Functions

void addData (const OdometryEvent &odomEvent)
bool getData (OdometryEvent &data)
virtual void mainLoop ()
virtual void mainLoopBegin ()
virtual void mainLoopKill ()
void process ()
void publishMap (bool optimized, bool full, bool graphOnly) const
void pushNewState (State newState, const ParametersMap &parameters=ParametersMap())

Private Attributes

bool _createIntermediateNodes
USemaphore _dataAdded
std::list< OdometryEvent_dataBuffer
unsigned int _dataBufferMaxSize
UMutex _dataMutex
UTimer_frameRateTimer
std::list< double > _newMapEvents
bool _paused
double _previousStamp
float _rate
Rtabmap_rtabmap
std::queue< State_state
UMutex _stateMutex
std::queue< ParametersMap_stateParam
cv::Mat _userData
UMutex _userDataMutex
cv::Mat covariance_
Transform lastPose_

Detailed Description

Definition at line 51 of file RtabmapThread.h.


Member Enumeration Documentation

Enumerator:
kStateInit 
kStateDetecting 
kStateReseting 
kStateClose 
kStateChangingParameters 
kStateDumpingMemory 
kStateDumpingPrediction 
kStateExportingDOTGraph 
kStateExportingPoses 
kStateCleanDataBuffer 
kStatePublishingMap 
kStateTriggeringMap 
kStateSettingGoal 
kStateCancellingGoal 
kStateLabelling 

Reimplemented from UThread.

Definition at line 56 of file RtabmapThread.h.


Constructor & Destructor Documentation

Definition at line 46 of file RtabmapThread.cpp.

Definition at line 60 of file RtabmapThread.cpp.


Member Function Documentation

void rtabmap::RtabmapThread::addData ( const OdometryEvent odomEvent) [private]

Definition at line 555 of file RtabmapThread.cpp.

Definition at line 83 of file RtabmapThread.cpp.

void rtabmap::RtabmapThread::close ( bool  databaseSaved,
const std::string &  databasePath = "" 
)

Close rtabmap. This will delete rtabmap object if set.

Parameters:
databaseSavedtrue=database saved, false=database discarded.
databasePathoutput database file name, ignored if Db/Sqlite3InMemory=false (opened database is then overwritten).

Definition at line 118 of file RtabmapThread.cpp.

Definition at line 113 of file RtabmapThread.cpp.

Definition at line 86 of file RtabmapThread.h.

bool rtabmap::RtabmapThread::getData ( OdometryEvent data) [private]

Definition at line 649 of file RtabmapThread.cpp.

unsigned int rtabmap::RtabmapThread::getDataBufferSize ( ) const [inline]

Definition at line 85 of file RtabmapThread.h.

float rtabmap::RtabmapThread::getDetectorRate ( ) const [inline]

Definition at line 84 of file RtabmapThread.h.

bool rtabmap::RtabmapThread::handleEvent ( UEvent event) [protected, virtual]

Method called by the UEventsManager to handle an event. Important : this method must do a minimum of work because the faster the dispatching loop is done; the faster the events are received. If a handling function takes too much time, the events list can grow faster than it is emptied. The event can be modified.

Returns:
"true" to notify UEventsManager that this handler took ownership of the event (meaning it must delete it). The event will not be dispatched to next handlers.
"false" to let event be dispatched to next handlers (default behavior). UEventsManager will take care of deleting the event.

Implements UEventsHandler.

Definition at line 316 of file RtabmapThread.cpp.

void rtabmap::RtabmapThread::mainLoop ( ) [private, virtual]

Pure virtual method mainLoop(). The inner loop of the thread. This method is called repetitively until the thread is killed. Note that if kill() is called in mainLoopBegin(), mainLoop() is not called, terminating immediately the thread.

See also:
mainLoop()
kill()

Implements UThread.

Definition at line 187 of file RtabmapThread.cpp.

void rtabmap::RtabmapThread::mainLoopBegin ( ) [private, virtual]

Virtual method mainLoopBegin(). User can implement this function to add a behavior before the main loop is started. It is called once (before entering mainLoop()).

Reimplemented from UThread.

Definition at line 170 of file RtabmapThread.cpp.

void rtabmap::RtabmapThread::mainLoopKill ( ) [private, virtual]

Virtual method mainLoopKill(). User can implement this function to add a behavior before the thread is killed. When this function is called, the state of the thread is set to kSKilled. It is useful to wake up a sleeping thread to finish his loop and to avoid a deadlock.

Reimplemented from UThread.

Definition at line 180 of file RtabmapThread.cpp.

void rtabmap::RtabmapThread::process ( ) [private]

Definition at line 526 of file RtabmapThread.cpp.

void rtabmap::RtabmapThread::publishMap ( bool  optimized,
bool  full,
bool  graphOnly 
) const [private]

Definition at line 129 of file RtabmapThread.cpp.

void rtabmap::RtabmapThread::pushNewState ( State  newState,
const ParametersMap parameters = ParametersMap() 
) [private]

Definition at line 69 of file RtabmapThread.cpp.

void rtabmap::RtabmapThread::setDataBufferSize ( unsigned int  bufferSize)

Definition at line 108 of file RtabmapThread.cpp.

Definition at line 102 of file RtabmapThread.cpp.


Member Data Documentation

Definition at line 121 of file RtabmapThread.h.

Definition at line 118 of file RtabmapThread.h.

Definition at line 115 of file RtabmapThread.h.

Definition at line 119 of file RtabmapThread.h.

Definition at line 117 of file RtabmapThread.h.

Definition at line 122 of file RtabmapThread.h.

std::list<double> rtabmap::RtabmapThread::_newMapEvents [private]

Definition at line 116 of file RtabmapThread.h.

Definition at line 126 of file RtabmapThread.h.

Definition at line 123 of file RtabmapThread.h.

Definition at line 120 of file RtabmapThread.h.

Definition at line 125 of file RtabmapThread.h.

std::queue<State> rtabmap::RtabmapThread::_state [private]

Definition at line 112 of file RtabmapThread.h.

Definition at line 111 of file RtabmapThread.h.

Definition at line 113 of file RtabmapThread.h.

Definition at line 130 of file RtabmapThread.h.

Definition at line 131 of file RtabmapThread.h.

Definition at line 128 of file RtabmapThread.h.

Definition at line 127 of file RtabmapThread.h.


The documentation for this class was generated from the following files:


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jun 6 2019 21:59:42