OKVIS ROS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
okvis::ImuFrameSynchronizer Class Reference

This class is to safely notify different threads whether IMU measurements up to a timestamp (e.g. the one of a camera frame) have already been registered. More...

#include <ImuFrameSynchronizer.hpp>

Public Member Functions

 ImuFrameSynchronizer ()
 Constructor. More...
 
 ~ImuFrameSynchronizer ()
 Destructor. More...
 
void gotImuData (const okvis::Time &stamp)
 Tell the synchronizer that a new IMU measurement has been registered. More...
 
bool waitForUpToDateImuData (const okvis::Time &frame_stamp)
 Wait until a IMU measurement with a timestamp equal or newer to the supplied one is registered. More...
 
void shutdown ()
 Tell the synchronizer to shutdown. This will notify all waiting threads to wake up. More...
 

Private Attributes

okvis::Time newestImuDataStamp_
 Newest IMU data timestamp. More...
 
okvis::Time imuDataNeededUntil_
 A thread is waiting for IMU data newer or equal to this timestamp. More...
 
std::condition_variable gotNeededImuData_
 Condition variable for waiting and notyfing. More...
 
std::mutex mutex_
 Mutex. More...
 
std::atomic_bool shutdown_
 True if shutdown() was called. More...
 

Detailed Description

This class is to safely notify different threads whether IMU measurements up to a timestamp (e.g. the one of a camera frame) have already been registered.

Constructor & Destructor Documentation

okvis::ImuFrameSynchronizer::ImuFrameSynchronizer ( )

Constructor.

okvis::ImuFrameSynchronizer::~ImuFrameSynchronizer ( )

Destructor.

Member Function Documentation

void okvis::ImuFrameSynchronizer::gotImuData ( const okvis::Time stamp)

Tell the synchronizer that a new IMU measurement has been registered.

Parameters
stampTimestamp of the new IMU mewasurement.
void okvis::ImuFrameSynchronizer::shutdown ( )

Tell the synchronizer to shutdown. This will notify all waiting threads to wake up.

bool okvis::ImuFrameSynchronizer::waitForUpToDateImuData ( const okvis::Time frame_stamp)

Wait until a IMU measurement with a timestamp equal or newer to the supplied one is registered.

Parameters
frame_stampTimestamp until you want to have IMU measurements for.
Returns
False if a shutdown signal has been received. Otherwise true.

Member Data Documentation

std::condition_variable okvis::ImuFrameSynchronizer::gotNeededImuData_
private

Condition variable for waiting and notyfing.

okvis::Time okvis::ImuFrameSynchronizer::imuDataNeededUntil_
private

A thread is waiting for IMU data newer or equal to this timestamp.

std::mutex okvis::ImuFrameSynchronizer::mutex_
private

Mutex.

okvis::Time okvis::ImuFrameSynchronizer::newestImuDataStamp_
private

Newest IMU data timestamp.

std::atomic_bool okvis::ImuFrameSynchronizer::shutdown_
private

True if shutdown() was called.


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