25 #ifndef INCLUDED_ProcessIMUMessage_h_GUID_9F00FD7F_C068_4DB1_61C8_42317D1CF786
26 #define INCLUDED_ProcessIMUMessage_h_GUID_9F00FD7F_C068_4DB1_61C8_42317D1CF786
38 #include <type_traits>
46 template <
typename Report>
47 using is_timestamped_report =
48 typepack::contains<TimestampedReports, Report>;
54 ImuMessageCategory messageType = ImuMessageCategory::Empty;
60 template <
typename Report>
61 typename std::enable_if<is_timestamped_report<Report>::value>::type
65 bodyId = report.imu().getBody().getId();
68 updatePose(report.imu(), report.timestamp, report.data);
74 messageType = ImuMessageCategory::Orientation;
76 timestamp, util::eigen_interop::map(ori.
rotation).quat());
82 messageType = ImuMessageCategory::AngularVelocity;
85 util::eigen_interop::map(angVel.
state.incrementalRotation)
91 inline std::pair<BodyId, ImuMessageCategory>
92 processImuMessage(IMUMessage
const &m) {
94 detail::IMUMessageProcessor processor;
95 boost::apply_visitor(processor, m);
96 return std::make_pair(processor.bodyId, processor.messageType);
100 #endif // INCLUDED_ProcessIMUMessage_h_GUID_9F00FD7F_C068_4DB1_61C8_42317D1CF786
std::enable_if< is_timestamped_report< Report >::value >::type operator()(Report const &report)
void updatePoseFromOrientation(util::time::TimeValue const &tv, Eigen::Quaterniond const &quat)
Processes an orientation.
OSVR_AngularVelocityState state
The state itself.
void updatePoseFromAngularVelocity(util::time::TimeValue const &tv, Eigen::Quaterniond const &deltaquat, double dt)
Processes an angular velocity.
Report type for an orientation callback on a tracker interface.
void operator()(boost::none_t const &) const
Implementation detail of unpacking and handling the IMU messages.
Header for interoperation between the Eigen math library, the internal mini math library, and VRPN's quatlib.
Report type for an angular velocity callback on a tracker interface.
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
OSVR_OrientationState rotation
The rotation unit quaternion.