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();
135 TrackedBodyTarget
const *getTarget(TargetId
id)
const {
136 if (TargetId(0) ==
id) {
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;
184 BodyState &outState);
204 BodyState
const &newState);
213 BodyProcessModel &getProcessModel() {
return m_processModel; }
224 TrackingSystem
const &getSystem()
const {
return m_system; }
231 CannedIMUMeasurement
const &meas);
235 TrackingSystem &m_system;
240 BodyProcessModel m_processModel;
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
osvr::util::time::TimeValue getStateTime() const
Get timestamp associated with current state.
bool hasPoseEstimate() const
Do we have a pose estimate for this body in general?
TrackedBody(TrackingSystem &system, BodyId id)
Constructor.
void pruneHistory(OSVR_TimeValue const &videoTime)
BodyId getId() const
Gets the body ID within the tracking system.
Header wrapping include of and for warning quieting.
void replaceStateSnapshot(osvr::util::time::TimeValue const &origTime, osvr::util::time::TimeValue const &newTime, BodyState const &newState)
TrackedBodyIMU & getIMU()
Get the IMU - only valid if hasIMU is true.
TrackedBodyTarget * createTarget(Eigen::Vector3d const &targetToBody, TargetSetupData const &setupData)
::OSVR_TimeValue TimeValue
C++-friendly typedef for the OSVR_TimeValue structure.
ConfigParams const & getParams() const
TrackedBody & operator=(TrackedBody const &)=delete
Non-copy-assignable.
General configuration parameters.
Header providing a C++ wrapper around TimeValueC.h.
TrackedBodyIMU const & getIMU() const
Get the IMU - only valid if hasIMU is true.
~TrackedBody()
Destructor - explicit so we can use unique_ptr for our pimpls.
std::size_t getNumTargets() const
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
bool hasIMU() const
Does this tracked body have an IMU?
bool getStateAtOrBefore(osvr::util::time::TimeValue const &desiredTime, osvr::util::time::TimeValue &outTime, BodyState &outState)
void incorporateNewMeasurementFromIMU(util::time::TimeValue const &tv, CannedIMUMeasurement const &meas)