Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
rtabmap::OdometryThread Class Reference

#include <OdometryThread.h>

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

Public Member Functions

 OdometryThread (Odometry *odometry, unsigned int dataBufferMaxSize=1)
 
virtual ~OdometryThread ()
 
- Public Member Functions inherited from UThread
Handle getThreadHandle () const
 
unsigned long getThreadId () const
 
bool isCreating () const
 
bool isIdle () const
 
bool isKilled () const
 
bool isRunning () const
 
void join (bool killFirst=false)
 
void kill ()
 
void setAffinity (int cpu=0)
 
void setPriority (Priority priority)
 
void start ()
 
 UThread (Priority priority=kPNormal)
 
virtual ~UThread ()
 
- Public Member Functions inherited from UThreadC< void >
int Create (Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const
 
int Create (Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const
 
int Create (unsigned long &ThreadId, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const
 
int Create (unsigned long &ThreadId, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false) const
 
virtual ~UThreadC ()
 
virtual ~UThreadC ()
 
- Public Member Functions inherited from UEventsHandler
void registerToEventsManager ()
 
void unregisterFromEventsManager ()
 
- Public Member Functions inherited from UEventsSender
 UEventsSender ()
 
virtual ~UEventsSender ()
 

Protected Member Functions

virtual bool handleEvent (UEvent *event)
 
- Protected Member Functions inherited from UThreadC< void >
 UThreadC ()
 
 UThreadC ()
 
- Protected Member Functions inherited from UEventsHandler
 UEventsHandler ()
 
virtual ~UEventsHandler ()
 
- Protected Member Functions inherited from UEventsSender
void post (UEvent *event, bool async=true) const
 

Private Member Functions

void addData (const SensorData &data)
 
bool getData (SensorData &data)
 
virtual void mainLoop ()
 
virtual void mainLoopBegin ()
 
virtual void mainLoopKill ()
 

Private Attributes

USemaphore _dataAdded
 
std::list< SensorData_dataBuffer
 
unsigned int _dataBufferMaxSize
 
UMutex _dataMutex
 
std::list< SensorData_imuBuffer
 
double _imuEstimatedDelay
 
double _lastImuStamp
 
Odometry_odometry
 
bool _resetOdometry
 
Transform _resetPose
 

Additional Inherited Members

- Public Types inherited from UThread
enum  Priority {
  kPLow, kPBelowNormal, kPNormal, kPAboveNormal,
  kPRealTime
}
 
- Public Types inherited from UThreadC< void >
typedef THREAD_HANDLE Handle
 
typedef THREAD_HANDLE Handle
 
typedef void(* Handler) ()
 
typedef void(* Handler) ()
 
- Static Public Member Functions inherited from UThread
static unsigned long currentThreadId ()
 
- Static Public Member Functions inherited from UThreadC< void >
static int Create (const Handler &Function, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false)
 
static int Create (const Handler &Function, Handle *const &H=0, const bool &CreateDetached=false, const unsigned int &StackSize=0, const bool &CancelEnable=false, const bool &CancelAsync=false)
 
static int Detach (Handle H)
 
static int Detach (const Handle &H)
 
static int Join (const Handle &H)
 
static int Join (Handle H)
 
static int Kill (Handle H)
 
static int Kill (const Handle &H)
 
- Static Protected Member Functions inherited from UThreadC< void >
static void Exit ()
 
static void Exit ()
 
static Handle Self ()
 
static int Self ()
 
static void TestCancel ()
 
static void TestCancel ()
 

Detailed Description

Definition at line 41 of file OdometryThread.h.

Constructor & Destructor Documentation

rtabmap::OdometryThread::OdometryThread ( Odometry odometry,
unsigned int  dataBufferMaxSize = 1 
)

Definition at line 39 of file OdometryThread.cpp.

rtabmap::OdometryThread::~OdometryThread ( )
virtual

Definition at line 50 of file OdometryThread.cpp.

Member Function Documentation

void rtabmap::OdometryThread::addData ( const SensorData data)
private

Definition at line 128 of file OdometryThread.cpp.

bool rtabmap::OdometryThread::getData ( SensorData data)
private

Definition at line 187 of file OdometryThread.cpp.

bool rtabmap::OdometryThread::handleEvent ( UEvent event)
protectedvirtual

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 58 of file OdometryThread.cpp.

void rtabmap::OdometryThread::mainLoop ( )
privatevirtual

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 105 of file OdometryThread.cpp.

void rtabmap::OdometryThread::mainLoopBegin ( )
privatevirtual

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 92 of file OdometryThread.cpp.

void rtabmap::OdometryThread::mainLoopKill ( )
privatevirtual

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 97 of file OdometryThread.cpp.

Member Data Documentation

USemaphore rtabmap::OdometryThread::_dataAdded
private

Definition at line 62 of file OdometryThread.h.

std::list<SensorData> rtabmap::OdometryThread::_dataBuffer
private

Definition at line 64 of file OdometryThread.h.

unsigned int rtabmap::OdometryThread::_dataBufferMaxSize
private

Definition at line 67 of file OdometryThread.h.

UMutex rtabmap::OdometryThread::_dataMutex
private

Definition at line 63 of file OdometryThread.h.

std::list<SensorData> rtabmap::OdometryThread::_imuBuffer
private

Definition at line 65 of file OdometryThread.h.

double rtabmap::OdometryThread::_imuEstimatedDelay
private

Definition at line 71 of file OdometryThread.h.

double rtabmap::OdometryThread::_lastImuStamp
private

Definition at line 70 of file OdometryThread.h.

Odometry* rtabmap::OdometryThread::_odometry
private

Definition at line 66 of file OdometryThread.h.

bool rtabmap::OdometryThread::_resetOdometry
private

Definition at line 68 of file OdometryThread.h.

Transform rtabmap::OdometryThread::_resetPose
private

Definition at line 69 of file OdometryThread.h.


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


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:43:43