25 #ifndef INCLUDED_VrpnTrackerServer_h_GUID_15AD76EE_C97F_4FBC_1EC5_A73576D5BAAC 
   26 #define INCLUDED_VrpnTrackerServer_h_GUID_15AD76EE_C97F_4FBC_1EC5_A73576D5BAAC 
   35 #include <vrpn_Tracker.h> 
   41 namespace connection {
 
   45         typedef vrpn_Tracker Base;
 
   47             : vrpn_Tracker(init.getQualifiedName().c_str(), init.conn) {
 
   58         static const vrpn_uint32 CLASS_OF_SERVICE = vrpn_CONNECTION_LOW_LATENCY;
 
   64             osvrVec3ToQuatlib(Base::pos, &val);
 
   65             m_sendPose(sensor, tv);
 
   72             osvrQuatToQuatlib(Base::d_quat, &val);
 
   73             m_sendPose(sensor, tv);
 
   80             osvrQuatToQuatlib(Base::d_quat, &(val.
rotation));
 
   81             m_sendPose(sensor, tv);
 
   87             osvrVec3ToQuatlib(Base::vel, &(val.linearVelocity));
 
   88             osvrQuatToQuatlib(Base::vel_quat,
 
   89                               &(val.angularVelocity.incrementalRotation));
 
   90             Base::vel_quat_dt = val.angularVelocity.dt;
 
   91             m_sendVelocity(sensor, tv);
 
   98             osvrVec3ToQuatlib(Base::vel, &val);
 
   99             m_sendVelocity(sensor, tv);
 
  106             osvrQuatToQuatlib(Base::vel_quat, &(val.incrementalRotation));
 
  107             Base::vel_quat_dt = val.dt;
 
  108             m_sendVelocity(sensor, tv);
 
  114             osvrVec3ToQuatlib(Base::acc, &(val.linearAcceleration));
 
  115             osvrQuatToQuatlib(Base::acc_quat,
 
  116                               &(val.angularAcceleration.incrementalRotation));
 
  117             Base::acc_quat_dt = val.angularAcceleration.dt;
 
  118             m_sendAccel(sensor, tv);
 
  125             osvrVec3ToQuatlib(Base::acc, &val);
 
  126             m_sendAccel(sensor, tv);
 
  133             osvrQuatToQuatlib(Base::acc_quat, &(val.incrementalRotation));
 
  134             Base::acc_quat_dt = val.dt;
 
  135             m_sendAccel(sensor, tv);
 
  139         void m_resetVec3(vrpn_float64 vec[3]) {
 
  144         void m_resetPos() { m_resetVec3(pos); }
 
  145         void m_resetQuat(vrpn_float64 quat[4]) {
 
  151         void m_resetQuat() { m_resetQuat(d_quat); }
 
  154             m_resetVec3(Base::vel);
 
  155             m_resetQuat(Base::vel_quat);
 
  156             Base::vel_quat_dt = 0;
 
  159         void m_resetAccel() {
 
  160             m_resetVec3(Base::acc);
 
  161             m_resetQuat(Base::acc_quat);
 
  162             Base::acc_quat_dt = 0;
 
  168             Base::d_sensor = sensor;
 
  171             vrpn_int32 len = Base::encode_to(msgbuf);
 
  172             d_connection->pack_message(len, Base::timestamp,
 
  173                                        Base::position_m_id, Base::d_sender_id,
 
  174                                        msgbuf, CLASS_OF_SERVICE);
 
  180             Base::d_sensor = sensor;
 
  183             vrpn_int32 len = Base::encode_vel_to(msgbuf);
 
  184             d_connection->pack_message(len, Base::timestamp,
 
  185                                        Base::velocity_m_id, Base::d_sender_id,
 
  186                                        msgbuf, CLASS_OF_SERVICE);
 
  192             Base::d_sensor = sensor;
 
  195             vrpn_int32 len = Base::encode_acc_to(msgbuf);
 
  196             d_connection->pack_message(len, Base::timestamp, Base::accel_m_id,
 
  197                                        Base::d_sender_id, msgbuf,
 
  205 #endif // INCLUDED_VrpnTrackerServer_h_GUID_15AD76EE_C97F_4FBC_1EC5_A73576D5BAAC 
Struct for combined acceleration state. 
uint32_t OSVR_ChannelCount
The integer type specifying a number of channels/sensors or a channel/sensor index. 
Interface for external access to generating tracker reports. 
void returnTrackerInterface(osvr::connection::TrackerServerInterface &iface)
Returns a tracker interface through the pointer-pointer. 
A structure defining a 3D vector, often a position/translation. 
OSVR_Quaternion rotation
Orientation as a unit quaternion. 
void toStructTimeval(struct timeval &dest, TimeValue const &src)
Convert a TimeValue to a struct timeval. 
A structure defining a quaternion, often a unit quaternion representing 3D rotation. 
The quaternion represents the incremental rotation taking place over a period of dt seconds...
A structure defining a 3D (6DOF) rigid body pose: translation and rotation. 
Struct for combined velocity state. 
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
OSVR_Vec3 translation
Position vector.