OSVR-Core
|
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< BodyReporting > | make () |
Factory function. | |
A per-body class intended to marshall data coming from the tracking/processing thread back to the mainloop thread.
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.
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".
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.
bool osvr::vbtracker::BodyReporting::updateState | ( | util::time::TimeValue const & | tv, |
BodyState const & | state | ||
) |
"Produces" an updated state.
Initialize the array inside the queue value