25 #ifndef INCLUDED_TrackedBody_h_GUID_1FC60169_196A_4F89_551C_E1B41531BBC8 26 #define INCLUDED_TrackedBody_h_GUID_1FC60169_196A_4F89_551C_E1B41531BBC8 37 #include <boost/assert.hpp> 46 class TrackedBodyTarget;
47 struct TargetSetupData;
66 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
84 createIntegratedIMU(
double orientationVariance,
85 double angularVelocityVariance = 1.0);
107 BodyState const &getState()
const {
return m_state; }
110 bool hasIMU()
const {
return static_cast<bool>(m_imu); }
114 BOOST_ASSERT_MSG(m_imu,
"getIMU() called when hasIMU() is false!");
120 BOOST_ASSERT_MSG(m_imu,
"getIMU() called when hasIMU() is false!");
130 return m_target.get();
137 return m_target.get();
142 template <
typename F>
void forEachTarget(F &&f) {
144 std::forward<F>(f)(*m_target);
148 template <
typename F>
void forEachTarget(F &&f)
const {
150 std::forward<F>(f)(*m_target);
157 bool hasEverHadPoseEstimate()
const;
243 std::unique_ptr<Impl> m_impl;
244 std::unique_ptr<TrackedBodyIMU> m_imu;
245 std::unique_ptr<TrackedBodyTarget> m_target;
250 #endif // INCLUDED_TrackedBody_h_GUID_1FC60169_196A_4F89_551C_E1B41531BBC8 BodyId getId() const
Gets the body ID within the tracking system.
Definition: TrackedBody.cpp:100
bool hasPoseEstimate() const
Do we have a pose estimate for this body in general?
Definition: TrackedBody.cpp:241
TrackedBody(TrackingSystem &system, BodyId id)
Constructor.
Definition: TrackedBody.cpp:55
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
void pruneHistory(OSVR_TimeValue const &videoTime)
Clean histories of no-longer-needed historical state and measurements.
Definition: TrackedBody.cpp:134
Header wrapping include of <Eigen/Core> and <Eigen/Geometry> for warning quieting.
void replaceStateSnapshot(osvr::util::time::TimeValue const &origTime, osvr::util::time::TimeValue const &newTime, BodyState const &newState)
This is the counterpart to getStateAtOrBefore() and should only be called subsequent to it...
Definition: TrackedBody.cpp:164
TrackedBodyIMU & getIMU()
Get the IMU - only valid if hasIMU is true.
Definition: TrackedBody.h:113
TrackedBodyTarget * createTarget(Eigen::Vector3d const &targetToBody, TargetSetupData const &setupData)
Creates a video-based tracking target (constellation of beacons) to add to this body.
Definition: TrackedBody.cpp:82
Definition: TrackingSystem.h:54
Corresponds to a rigid arrangements of discrete beacons detected by video-based tracking - typically ...
Definition: TrackedBodyTarget.h:77
A safe way to store and transport an orientation measurement or an angular velocity measurement witho...
Definition: CannedIMUMeasurement.h:44
TrackedBody & operator=(TrackedBody const &)=delete
Non-copy-assignable.
TrackedBodyIMU const & getIMU() const
Get the IMU - only valid if hasIMU is true.
Definition: TrackedBody.h:119
std::size_t getNumTargets() const
How many (if any) video-based tracking targets does this tracked body have?
Definition: TrackedBody.h:126
General configuration parameters.
Definition: ConfigParams.h:82
ConfigParams const & getParams() const
Definition: TrackedBody.cpp:96
Data for a full target (all the beacons), unswizzled into a "struct of vectors".
Definition: BeaconSetupData.h:53
Definition: TrackedBodyIMU.h:44
bool hasIMU() const
Does this tracked body have an IMU?
Definition: TrackedBody.h:110
Header providing a C++ wrapper around TimeValueC.h.
This is the class representing a tracked rigid body in the system.
Definition: TrackedBody.h:56
~TrackedBody()
Destructor - explicit so we can use unique_ptr for our pimpls.
Definition: TrackedBody.cpp:67
Definition: TrackedBody.cpp:49
Definition: PoseState.h:164
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Definition: TimeValueC.h:81
BodyState & getState()
Definition: TrackedBody.h:216
osvr::util::time::TimeValue getStateTime() const
Get timestamp associated with current state.
Definition: TrackedBody.cpp:101
bool getStateAtOrBefore(osvr::util::time::TimeValue const &desiredTime, osvr::util::time::TimeValue &outTime, BodyState &outState)
Requests a copy of (a possibly historical snapshot of) body state, as close to desiredTime without be...
Definition: TrackedBody.cpp:105
A basically-constant-velocity model, with the addition of some damping of the velocities inspired by ...
Definition: PoseSeparatelyDampedConstantVelocity.h:43
void incorporateNewMeasurementFromIMU(util::time::TimeValue const &tv, CannedIMUMeasurement const &meas)
Incorporates a brand-new measurement from the IMU into the state.
Definition: TrackedBody.cpp:199