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>
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>
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)
Definition: ProcessIMUMessage.h:62
apply_list< quote< or_ >, transform< Haystack, detail::is_< Needle >>> contains
Determines if type Needle is in the list Haystack - is an alias for a type that inherits std::true_ty...
Definition: Contains.h:49
void updatePoseFromOrientation(util::time::TimeValue const &tv, Eigen::Quaterniond const &quat)
Processes an orientation.
Definition: TrackedBodyIMU.cpp:49
OSVR_AngularVelocityState state
The state itself.
Definition: ClientReportTypesC.h:191
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
typepack::contains< TimestampedReports, Report > is_timestamped_report
Alias to determine if a class is in fact a "Timestamped Report" type.
Definition: ProcessIMUMessage.h:48
Definition: newuoa.h:1888
void updatePoseFromAngularVelocity(util::time::TimeValue const &tv, Eigen::Quaterniond const &deltaquat, double dt)
Processes an angular velocity.
Definition: TrackedBodyIMU.cpp:82
Report type for an orientation callback on a tracker interface.
Definition: ClientReportTypesC.h:145
Definition: TrackedBodyIMU.h:44
void operator()(boost::none_t const &) const
Definition: ProcessIMUMessage.h:56
Implementation detail of unpacking and handling the IMU messages.
Definition: ProcessIMUMessage.h:51
Header for interoperation between the Eigen math library, the internal mini math library, and VRPN's quatlib.
boost::variant< boost::none_t, TimestampedOrientation, TimestampedAngVel > IMUMessage
A "typesafe tagged-union" variant that can hold an IMU report data along with the timestamp and the p...
Definition: IMUMessage.h:93
Report type for an angular velocity callback on a tracker interface.
Definition: ClientReportTypesC.h:187
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Definition: TimeValueC.h:81
OSVR_OrientationState rotation
The rotation unit quaternion.
Definition: ClientReportTypesC.h:149