25 #ifndef INCLUDED_OptimizationBase_h_GUID_C3489E14_63D4_4290_45C0_225AC84A8BF5 26 #define INCLUDED_OptimizationBase_h_GUID_C3489E14_63D4_4290_45C0_225AC84A8BF5 67 auto &body = system->getBody(
BodyId(0));
68 auto &target = *(body.getTarget(
TargetId(0)));
69 return OptimData(std::move(system), body, target,
70 commonData.camParams);
73 return OptimData::make(commonData.initialParams, commonData);
85 : camParams_(camParams), system_(std::move(system)), body_(&body),
89 std::unique_ptr<TrackingSystem> system_;
103 makeImageOutputDataFromRow(row, optim.getCamParams());
119 makeImageOutputDataFromRow(row, optim.getCamParams());
121 std::move(inputData));
127 bool havePose()
const {
return gotPose; }
129 std::size_t getNumResets(
OptimData const &optim) {
134 bool gotPose =
false;
146 flippedPose_ =
false;
151 optim.getCamParams(), pos, quat);
155 double yAxisYComponent = (quat * Eigen::Vector3d::UnitY()).y();
156 if (yAxisYComponent < 0) {
168 ransacPoseFilter.filter(dt, pos, quat);
171 pose = ransacPoseFilter.getIsometry();
174 bool flippedPose()
const {
return flippedPose_; }
175 std::size_t getNumFlips()
const {
return numFlips_; }
176 bool havePose()
const {
return gotPose; }
183 bool gotPose =
false;
184 bool flippedPose_ =
false;
185 std::size_t numFlips_ = 0;
200 : base_(reftracker::getBaseTransform(
201 reftracker::getRefTrackerTransformParams())),
202 inner_(reftracker::getInnerTransform(
203 reftracker::getRefTrackerTransformParams())) {}
207 pose_ = base_ *
makeIsometry(row.xlate, row.rot) * inner_;
209 bool havePose()
const {
return true; }
219 #endif // INCLUDED_OptimizationBase_h_GUID_C3489E14_63D4_4290_45C0_225AC84A8BF5 LedUpdateCount const & updateLedsFromVideoData(ImageOutputDataPtr &&imageData)
This is the second phase of the video-based tracking algorithm - the part that actually changes LED s...
Definition: TrackingSystem.cpp:90
Definition: UtilityFunctions.h:48
Algorithm functor to be called in a loop that processes measurements rows: feeds in LEDs (stage 2) an...
Definition: OptimizationBase.h:115
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 t...
Definition: TrackedBodyTarget.cpp:644
bool hasPoseEstimate() const
Do we have a pose estimate for this body in general?
Definition: TrackedBody.cpp:241
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT void OSVR_UTIL_EXPORT int OSVR_EXTERN_C_END OSVR_INLINE double osvrTimeValueDurationSeconds(OSVR_IN_PTR const OSVR_TimeValue *tvA, OSVR_IN_PTR const OSVR_TimeValue *tvB)
Compute the difference between the two time values, returning the duration as a double-precision floa...
Definition: TimeValueC.h:185
Definition: CameraParameters.h:41
Header wrapping include of <Eigen/Core> and <Eigen/Geometry> for warning quieting.
Creates and owns the tracking system created for each optimization run.
Definition: OptimizationBase.h:57
std::unique_ptr< TrackingSystem > makeHDKTrackingSystem(ConfigParams const ¶ms)
Definition: MakeHDKTrackingSystem.h:216
Algorithm functor, call after either stage-2 functor: obtains a RANSAC pose and feeds it into a 1-eur...
Definition: OptimizationBase.h:142
Eigen::Isometry3d getIsometry() const
Get the position and quaternion combined into a single isometry (transformation)
Definition: PoseState.h:246
Algorithm functor, to use a transformed recorded tracker pose, typically instead of an alternate meth...
Definition: OptimizationBase.h:197
::OSVR_TimeValue TimeValue
C++-friendly typedef for the OSVR_TimeValue structure.
Definition: TimeValue.h:48
void operator()(OptimData &optim, TimestampedMeasurements const &row)
Definition: OptimizationBase.h:144
Header defining some filters for Eigen datatypes.
Definition: TrackingSystem.h:54
BodyIndices const & updateBodiesFromVideoData(ImageOutputDataPtr &&imageData)
The combined second and third phases of the video-based tracking algorithm.
Definition: TrackingSystem.cpp:115
Corresponds to a rigid arrangements of discrete beacons detected by video-based tracking - typically ...
Definition: TrackedBodyTarget.h:77
General configuration parameters.
Definition: ConfigParams.h:82
Algorithm functor to be called in a loop that processes measurements rows: all it does is feed in LED...
Definition: OptimizationBase.h:99
This is the class representing a tracked rigid body in the system.
Definition: TrackedBody.h:56
Definition: Quaternion.h:47
Isometry3< typename Derived1::Scalar > makeIsometry(Eigen::MatrixBase< Derived1 > const &translation, Eigen::RotationBase< Derived2, 3 > const &rotation)
A simpler, functional-style alternative to .fromPositionOrientationScale when no scaling is performed...
Definition: EigenExtras.h:93
Input from main to the optimization routine (wrapper)
Definition: OptimizationBase.h:47
Combines a one-euro filter for position and a one-euro filter for orientation for the common use case...
Definition: EigenFilters.h:226
std::size_t numTrackingResets() const
Get the number of times tracking has reset - for debugging/optimization.
Definition: TrackedBodyTarget.cpp:761