| 89 | |
| 90 | private: |
| 91 | void m_handle(vrpn_TRACKERCB const &info) { |
| 92 | common::tracing::markNewTrackerData(); |
| 93 | OSVR_PoseReport report; |
| 94 | report.sensor = info.sensor; |
| 95 | OSVR_TimeValue timestamp; |
| 96 | osvrStructTimevalToTimeValue(×tamp, &(info.msg_time)); |
| 97 | osvrQuatFromQuatlib(&(report.pose.rotation), info.quat); |
| 98 | osvrVec3FromQuatlib(&(report.pose.translation), info.pos); |
| 99 | Eigen::Matrix4d pose = |
| 100 | m_transform.transform(util::fromPose(report.pose).matrix()); |
| 101 | util::toPose(pose, report.pose); |
| 102 | |
| 103 | if (m_opts.reportPose) { |
| 104 | for (auto &iface : m_interfaces) { |
| 105 | iface->triggerCallbacks(timestamp, report); |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | if (m_opts.reportPosition) { |
| 110 | OSVR_PositionReport positionReport; |
| 111 | positionReport.sensor = info.sensor; |
| 112 | positionReport.xyz = report.pose.translation; |
| 113 | for (auto &iface : m_interfaces) { |
| 114 | iface->triggerCallbacks(timestamp, positionReport); |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | if (m_opts.reportOrientation) { |
| 119 | OSVR_OrientationReport oriReport; |
| 120 | oriReport.sensor = info.sensor; |
| 121 | oriReport.rotation = report.pose.rotation; |
| 122 | |
| 123 | for (auto &iface : m_interfaces) { |
| 124 | iface->triggerCallbacks(timestamp, oriReport); |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | unique_ptr<vrpn_Tracker_Remote> m_remote; |
| 129 | common::Transform m_transform; |
| 130 | common::InterfaceList &m_interfaces; |
no test coverage detected