#include <OdometryThread.h>
Public Member Functions | |
OdometryThread (Odometry *odometry, unsigned int dataBufferMaxSize=1) | |
virtual | ~OdometryThread () |
Protected Member Functions | |
virtual void | handleEvent (UEvent *event) |
Private Member Functions | |
void | addData (const SensorData &data) |
bool | getData (SensorData &data) |
void | mainLoop () |
void | mainLoopKill () |
Private Attributes | |
USemaphore | _dataAdded |
std::list< SensorData > | _dataBuffer |
unsigned int | _dataBufferMaxSize |
UMutex | _dataMutex |
Odometry * | _odometry |
bool | _resetOdometry |
Definition at line 41 of file OdometryThread.h.
rtabmap::OdometryThread::OdometryThread | ( | Odometry * | odometry, |
unsigned int | dataBufferMaxSize = 1 |
||
) |
Definition at line 39 of file OdometryThread.cpp.
rtabmap::OdometryThread::~OdometryThread | ( | ) | [virtual] |
Definition at line 47 of file OdometryThread.cpp.
void rtabmap::OdometryThread::addData | ( | const SensorData & | data | ) | [private] |
Definition at line 104 of file OdometryThread.cpp.
bool rtabmap::OdometryThread::getData | ( | SensorData & | data | ) | [private] |
Definition at line 143 of file OdometryThread.cpp.
void rtabmap::OdometryThread::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 but must not be deleted.
Implements UEventsHandler.
Definition at line 58 of file OdometryThread.cpp.
void rtabmap::OdometryThread::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.
Implements UThread.
Definition at line 85 of file OdometryThread.cpp.
void rtabmap::OdometryThread::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 77 of file OdometryThread.cpp.
Definition at line 61 of file OdometryThread.h.
std::list<SensorData> rtabmap::OdometryThread::_dataBuffer [private] |
Definition at line 63 of file OdometryThread.h.
unsigned int rtabmap::OdometryThread::_dataBufferMaxSize [private] |
Definition at line 65 of file OdometryThread.h.
UMutex rtabmap::OdometryThread::_dataMutex [private] |
Definition at line 62 of file OdometryThread.h.
Odometry* rtabmap::OdometryThread::_odometry [private] |
Definition at line 64 of file OdometryThread.h.
bool rtabmap::OdometryThread::_resetOdometry [private] |
Definition at line 66 of file OdometryThread.h.