OSVR-Core
Public Member Functions | List of all members
osvr::vbtracker::TrackerThread Class Reference
Inheritance diagram for osvr::vbtracker::TrackerThread:

Public Member Functions

 TrackerThread (TrackingSystem &trackingSystem, ImageSource &imageSource, BodyReportingVector &reportingVec, CameraParameters const &camParams, std::int32_t cameraUsecOffset=0, bool bufferImu=false, bool debugData=false)
 
void threadAction ()
 Thread function-call operator: should be invoked by a lambda in a dedicated thread. More...
 
void signalImageProcessingComplete (ImageOutputDataPtr &&imageData, cv::Mat const &frame, cv::Mat const &frameGray)
 Call from image processing thread to signal completion of frame processing. More...
 
Main thread methods

The thread starts and immediately blocks.

Calling this allows it to proceed with execution.

void permitStart ()
 
void triggerStop ()
 Call from the main thread to trigger this thread's execution to exit after the current frame. More...
 
bool submitIMUReport (TrackedBodyIMU &imu, util::time::TimeValue const &tv, OSVR_OrientationReport const &report)
 Submit an orientation report for an IMU. More...
 
bool submitIMUReport (TrackedBodyIMU &imu, util::time::TimeValue const &tv, OSVR_AngularVelocityReport const &report)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. for angular velocity. More...
 
bool checkForDebugData (DebugArray &data)
 

Member Function Documentation

§ signalImageProcessingComplete()

void osvr::vbtracker::TrackerThread::signalImageProcessingComplete ( ImageOutputDataPtr &&  imageData,
cv::Mat const &  frame,
cv::Mat const &  frameGray 
)

Call from image processing thread to signal completion of frame processing.

§ submitIMUReport() [1/2]

bool osvr::vbtracker::TrackerThread::submitIMUReport ( TrackedBodyIMU imu,
util::time::TimeValue const &  tv,
OSVR_OrientationReport const &  report 
)

Submit an orientation report for an IMU.

Returns
false if there is no room in the queue for the message

Main thread method!

§ submitIMUReport() [2/2]

bool osvr::vbtracker::TrackerThread::submitIMUReport ( TrackedBodyIMU imu,
util::time::TimeValue const &  tv,
OSVR_AngularVelocityReport const &  report 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. for angular velocity.

Main thread method!

§ threadAction()

void osvr::vbtracker::TrackerThread::threadAction ( )

Thread function-call operator: should be invoked by a lambda in a dedicated thread.

The thread internally is organized around processing video frames, with arrival of IMU reports internally handled as they come. Thus, we keep getting frames and processing them until we're told to stop, doing what we can asynchronously to also process incoming IMU messages.

sleep an extra half a second to give everyone else time to get off the starting blocks.

Initialize reporting vector, as far as we can.

Launch the image proc thread in a waiting state.

Call the doFrame() method to perform one video frame's worth of processing.

Copy the run flag.

§ triggerStop()

void osvr::vbtracker::TrackerThread::triggerStop ( )

Call from the main thread to trigger this thread's execution to exit after the current frame.

Main thread method!


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