OSVR-Core
Classes | Static Public Member Functions | List of all members
osvr::vbtracker::BodyReporting Class Reference

A per-body class intended to marshall data coming from the tracking/processing thread back to the mainloop thread. More...

#include <ThreadsafeBodyReporting.h>

Public Member Functions

mainloop-thread methods
bool getReport (double additionalPrediction, BodyReport &report)
 Attempts to receive a report: "consumes" as many as there are available, using the last one produced for further computation. More...
 
processing-thread methods
bool updateState (util::time::TimeValue const &tv, BodyState const &state)
 "Produces" an updated state. More...
 
void initProcessModel (BodyProcessModel const &process)
 One-time call: sets up the process model, allowing the consumer end of this class to predict to "now". More...
 
void setTrackerToRoomTransform (Eigen::Isometry3d const &xform)
 This only needs to be called once - it sets a transform that will be applied to each report just before it is used by the receiving thread. More...
 

Static Public Member Functions

static std::unique_ptr< BodyReportingmake ()
 Factory function.
 

Detailed Description

A per-body class intended to marshall data coming from the tracking/processing thread back to the mainloop thread.

Member Function Documentation

§ getReport()

bool osvr::vbtracker::BodyReporting::getReport ( double  additionalPrediction,
BodyReport report 
)

Attempts to receive a report: "consumes" as many as there are available, using the last one produced for further computation.

If a process model and non-zero velocity are available, the state is predicted from the reported timestamp to "now" (or now + additionalPrediction if nonzero). If false is returned, no reports were available to consume.

Thaw out the frozen state.

Difference between measurement time and now.

and the additional time into the future we'd like to predict.

Using computeEstimate instead of the normal prediction saves us the unneeded prediction of the error covariance.

Be sure to post-correct.

OK, now set a proper timestamp for our prediction.

§ initProcessModel()

void osvr::vbtracker::BodyReporting::initProcessModel ( BodyProcessModel const &  process)

One-time call: sets up the process model, allowing the consumer end of this class to predict to "now".

§ setTrackerToRoomTransform()

void osvr::vbtracker::BodyReporting::setTrackerToRoomTransform ( Eigen::Isometry3d const &  xform)

This only needs to be called once - it sets a transform that will be applied to each report just before it is used by the receiving thread.

§ updateState()

bool osvr::vbtracker::BodyReporting::updateState ( util::time::TimeValue const &  tv,
BodyState const &  state 
)

"Produces" an updated state.

Returns
false if there was no room in the queue.

Initialize the array inside the queue value


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