OSVR-Core
|
Corresponds to a rigid arrangements of discrete beacons detected by video-based tracking - typically IR LEDs. More...
#include <TrackedBodyTarget.h>
Classes | |
struct | Impl |
Public Member Functions | |
TrackedBodyTarget (TrackedBody &body, BodyTargetInterface const &bodyIface, Eigen::Vector3d const &targetToBody, TargetSetupData const &setupData, TargetId id) | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW std::vector< BeaconData > const & | getBeaconDebugData () const |
UnderlyingBeaconIdType | getNumBeacons () const |
TrackedBody & | getBody () |
TrackedBody const & | getBody () const |
TargetId | getId () const |
Get the target id within this body. | |
BodyTargetId | getQualifiedId () const |
Get a fully-qualified (within a tracking system) id for this target. | |
Eigen::Vector3d | getBeaconAutocalibPosition (ZeroBasedBeaconId i) const |
Used to extract autocalibration results in a standalone calibration app, and to show information in a debug window. More... | |
Eigen::Vector3d | getBeaconAutocalibVariance (ZeroBasedBeaconId i) const |
Used to extract autocalibration results in a standalone calibration app. | |
void | resetBeaconAutocalib () |
Reset beacon autocalibration position and variance. | |
std::size_t | processLedMeasurements (LedMeasurementVec const &undistortedLeds) |
Called each frame with the results of the blob finding and undistortion (part of the first phase of the tracking system) More... | |
void | disableKalman () |
Override configured setting, disabling Kalman (normal) operating mode. More... | |
void | permitKalman () |
Override configured setting, permitting Kalman (normal) operating mode. More... | |
bool | updatePoseEstimateFromLeds (CameraParameters const &camParams, osvr::util::time::TimeValue const &tv, BodyState &bodyState, osvr::util::time::TimeValue const &startingTime, bool validStateAndTime) |
Update the pose estimate using the updated LEDs - part of the third phase of tracking. More... | |
bool | uncalibratedRANSACPoseEstimateFromLeds (CameraParameters const &camParams, Eigen::Vector3d &xlate, Eigen::Quaterniond &quat, int skipBrightsCutoff=-1, std::size_t iterations=5) |
Perform a simple RANSAC pose estimation from updated LEDs (third phase of tracking) without storing the results internally or changing internal state, or using any internal calibration transforms. More... | |
bool | hasPoseEstimate () const |
Did this target yet, or last time it was asked to, compute a pose estimate? | |
osvr::util::time::TimeValue const & | getLastUpdate () const |
Eigen::Vector3d const & | getBeaconOffset () const |
Get the offset that was subtracted from all beacon positions upon initialization. More... | |
LedGroup const & | leds () const |
Get all beacons/leds, including unrecognized ones. | |
LedPtrList const & | usableLeds () const |
Get a list of pointers to all recognized, in-range beacons/leds. | |
std::size_t | numTrackingResets () const |
Get the number of times tracking has reset - for debugging/optimization. More... | |
double | getInternalStatusMeasurement (TargetStatusMeasurement measurement) const |
A way for tuning and debugging applications to peer inside the implementation. More... | |
Eigen::Vector3d const & | getTargetToBody () const |
Eigen::Vector3d | getStateCorrection () const |
Get the beacon offset transformed into world space. | |
Eigen::Vector3d | computeTranslationCorrectionToBody (Eigen::Quaterniond const &orientation) const |
Static Public Member Functions | |
static Eigen::Vector3d | computeTranslationCorrection (Eigen::Vector3d const &bodyFrameOffset, Eigen::Quaterniond const &orientation) |
Corresponds to a rigid arrangements of discrete beacons detected by video-based tracking - typically IR LEDs.
osvr::vbtracker::TrackedBodyTarget::TrackedBodyTarget | ( | TrackedBody & | body, |
BodyTargetInterface const & | bodyIface, | ||
Eigen::Vector3d const & | targetToBody, | ||
TargetSetupData const & | setupData, | ||
TargetId | id | ||
) |
Create the beacon state objects and initialize the beacon offset.
Make a copy of those beacons.
Create the beacon debug data
Create the LED identifier
void osvr::vbtracker::TrackedBodyTarget::disableKalman | ( | ) |
Override configured setting, disabling Kalman (normal) operating mode.
Eigen::Vector3d osvr::vbtracker::TrackedBodyTarget::getBeaconAutocalibPosition | ( | ZeroBasedBeaconId | i | ) | const |
Used to extract autocalibration results in a standalone calibration app, and to show information in a debug window.
|
inline |
Get the offset that was subtracted from all beacon positions upon initialization.
double osvr::vbtracker::TrackedBodyTarget::getInternalStatusMeasurement | ( | TargetStatusMeasurement | measurement | ) | const |
A way for tuning and debugging applications to peer inside the implementation.
std::size_t osvr::vbtracker::TrackedBodyTarget::numTrackingResets | ( | ) | const |
Get the number of times tracking has reset - for debugging/optimization.
void osvr::vbtracker::TrackedBodyTarget::permitKalman | ( | ) |
Override configured setting, permitting Kalman (normal) operating mode.
std::size_t osvr::vbtracker::TrackedBodyTarget::processLedMeasurements | ( | LedMeasurementVec const & | undistortedLeds | ) |
Called each frame with the results of the blob finding and undistortion (part of the first phase of the tracking system)
Clear the "usableLeds" that will be populated in a later step, if we get that far.
Only bother resetting if anyone is actually going to receive the data.
For some reason, filtering in that measurement caused an LED object to go bad. The above function wiped the LED object, but let's undo the match and usage of the measurement in case it was someone else's.
this is how many elements the match-count early-out saved us
Do the initial filtering of the LED group to just the identified ones before we pass it to an estimator.
bool osvr::vbtracker::TrackedBodyTarget::uncalibratedRANSACPoseEstimateFromLeds | ( | CameraParameters const & | camParams, |
Eigen::Vector3d & | xlate, | ||
Eigen::Quaterniond & | quat, | ||
int | skipBrightsCutoff = -1 , |
||
std::size_t | iterations = 5 |
||
) |
Perform a simple RANSAC pose estimation from updated LEDs (third phase of tracking) without storing the results internally or changing internal state, or using any internal calibration transforms.
Intended for use during initial room calibration (startup).
camParams | Camera parameters for the image source (no distortion) | |
[out] | xlate | Pose estimate: translation in meters. Only modified if return value is true. |
[out] | quat | Pose estimate: rotation. Only modified if return value is true. |
skipBrightsCutoff | If positive, the number of non-bright LEDs seen that will trigger us to skip using bright LEDs in pose estimation. |
bool osvr::vbtracker::TrackedBodyTarget::updatePoseEstimateFromLeds | ( | CameraParameters const & | camParams, |
osvr::util::time::TimeValue const & | tv, | ||
BodyState & | bodyState, | ||
osvr::util::time::TimeValue const & | startingTime, | ||
bool | validStateAndTime | ||
) |
Update the pose estimate using the updated LEDs - part of the third phase of tracking.
Must pre/post correct the state by our offset :-/
Will we permit Kalman this estimation?
OK, now must decide who we talk to for pose estimation.
Lost tracking somehow and we're in a SCAAT state.
pre-estimation transitions based on overall health
Smooth RANSAC here - we haven't lost all sight.
Pre-estimation transitions per-state
main estimation dispatch
End of main estimation dispatch
post-estimation transitions (based on state)
Update our local target-specific timestamp
Corresponding post-correction.