#include <OdometryThread.h>
Public Member Functions | |
OdometryThread (Odometry *odometry) | |
virtual | ~OdometryThread () |
Protected Member Functions | |
virtual void | handleEvent (UEvent *event) |
Private Member Functions | |
void | addData (const SensorData &data) |
void | getData (SensorData &data) |
void | mainLoop () |
void | mainLoopKill () |
Private Attributes | |
USemaphore | _dataAdded |
SensorData | _dataBuffer |
UMutex | _dataMutex |
Odometry * | _odometry |
bool | _resetOdometry |
Definition at line 40 of file OdometryThread.h.
rtabmap::OdometryThread::OdometryThread | ( | Odometry * | odometry | ) |
Definition at line 37 of file OdometryThread.cpp.
rtabmap::OdometryThread::~OdometryThread | ( | ) | [virtual] |
Definition at line 44 of file OdometryThread.cpp.
void rtabmap::OdometryThread::addData | ( | const SensorData & | data | ) | [private] |
Definition at line 105 of file OdometryThread.cpp.
void rtabmap::OdometryThread::getData | ( | SensorData & | data | ) | [private] |
Definition at line 138 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 55 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 86 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 78 of file OdometryThread.cpp.
Definition at line 60 of file OdometryThread.h.
Definition at line 62 of file OdometryThread.h.
UMutex rtabmap::OdometryThread::_dataMutex [private] |
Definition at line 61 of file OdometryThread.h.
Odometry* rtabmap::OdometryThread::_odometry [private] |
Definition at line 63 of file OdometryThread.h.
bool rtabmap::OdometryThread::_resetOdometry [private] |
Definition at line 64 of file OdometryThread.h.