25 #ifndef INCLUDED_TrackedBodyTarget_h_GUID_E4315530_5C4F_4DB4_2497_11686F0F6E0E 26 #define INCLUDED_TrackedBodyTarget_h_GUID_E4315530_5C4F_4DB4_2497_11686F0F6E0E 37 #include <boost/assert.hpp> 47 struct CameraParameters;
53 cv::Point2d measurement = {0, 0};
54 cv::Point2d residual = {0, 0};
62 enum class TargetStatusMeasurement {
68 PosErrorVarianceLimit,
81 Eigen::Vector3d
const &targetToBody,
84 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
86 std::vector<BeaconData>
const &getBeaconDebugData()
const {
87 return m_beaconDebugData;
95 TrackedBody const &getBody()
const {
return m_body; }
111 void resetBeaconAutocalib();
119 processLedMeasurements(LedMeasurementVec
const &undistortedLeds);
123 void disableKalman();
131 bool updatePoseEstimateFromLeds(
135 bool validStateAndTime);
154 bool uncalibratedRANSACPoseEstimateFromLeds(
157 std::size_t iterations = 5);
168 return m_beaconOffset;
172 LedGroup
const &leds()
const;
175 LedPtrList
const &usableLeds()
const;
179 std::size_t numTrackingResets()
const;
184 getInternalStatusMeasurement(TargetStatusMeasurement measurement)
const;
186 Eigen::Vector3d
const &getTargetToBody()
const {
187 return m_targetToBody;
191 Eigen::Vector3d getStateCorrection()
const;
193 static Eigen::Vector3d
194 computeTranslationCorrection(Eigen::Vector3d
const &bodyFrameOffset,
197 Eigen::Vector3d computeTranslationCorrectionToBody(
201 std::ostream &msg()
const;
202 void enterKalmanMode();
203 void enterRANSACMode();
204 void enterRANSACKalmanMode();
206 void dumpBeaconsToConsole()
const;
211 void updateUsableLeds();
213 LedPtrList &usableLeds();
216 void m_verifyInvariants()
const {
217 BOOST_ASSERT_MSG(m_beacons.size() ==
218 m_beaconMeasurementVariance.size(),
219 "Must have the same number of beacons as default " 220 "measurement variances.");
222 m_beacons.size() == m_beaconFixed.size(),
223 "Must have the same number of beacons as beacon fixed flags.");
224 BOOST_ASSERT_MSG(m_beacons.size() ==
225 m_beaconEmissionDirection.size(),
226 "Must have the same number of beacons as beacon " 227 "emission directions.");
230 using BeaconStateVec = std::vector<std::unique_ptr<BeaconState>>;
240 Eigen::Vector3d m_targetToBody;
242 const std::size_t m_numBeacons;
247 BeaconStateVec m_beacons;
248 std::vector<double> m_beaconMeasurementVariance;
250 std::vector<bool> m_beaconFixed;
251 Vec3Vector m_beaconEmissionDirection;
254 std::vector<BeaconData> m_beaconDebugData;
256 BeaconStateVec m_origBeacons;
258 Eigen::Vector3d m_beaconOffset;
260 bool m_hasPoseEstimate =
false;
264 std::unique_ptr<Impl> m_impl;
269 #endif // INCLUDED_TrackedBodyTarget_h_GUID_E4315530_5C4F_4DB4_2497_11686F0F6E0E A way for targets to access internals of a tracked body.
Definition: BodyTargetInterface.h:41
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
std::pair< BodyId, TargetId > BodyTargetId
Type-safe zero-based target ID qualified with its body ID.
Definition: BodyIdTypes.h:67
Definition: CameraParameters.h:41
TargetId getId() const
Get the target id within this body.
Definition: TrackedBodyTarget.h:98
Definition: TypeSafeId.h:41
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
bool hasPoseEstimate() const
Did this target yet, or last time it was asked to, compute a pose estimate?
Definition: TrackedBodyTarget.h:161
Data for a full target (all the beacons), unswizzled into a "struct of vectors".
Definition: BeaconSetupData.h:53
Definition: TrackedBodyTarget.h:50
Header providing a C++ wrapper around TimeValueC.h.
This is the class representing a tracked rigid body in the system.
Definition: TrackedBody.h:56
Eigen::Vector3d const & getBeaconOffset() const
Get the offset that was subtracted from all beacon positions upon initialization. ...
Definition: TrackedBodyTarget.h:167
Definition: Quaternion.h:47
Definition: PoseState.h:164
int UnderlyingBeaconIdType
All beacon IDs, whether 0 or 1 based, are ints on the inside.
Definition: BeaconIdTypes.h:49
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Definition: TimeValueC.h:81
A very simple (3D by default) vector state with no velocity, ideal for use as a position, with ConstantProcess for beacon autocalibration.
Definition: PureVectorState.h:40
Definition: TrackedBodyTarget.cpp:143