00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2019 The Board of Trustees of the 00004 *cr University of Illinois 00005 *cr All Rights Reserved 00006 *cr 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * RCS INFORMATION: 00011 * 00012 * $RCSfile: P_VRPNTracker.h,v $ 00013 * $Author: johns $ $Locker: $ $State: Exp $ 00014 * $Revision: 1.26 $ $Date: 2019/01/17 21:21:01 $ 00015 * 00016 *************************************************************************** 00017 * DESCRIPTION: 00018 * This is Paul's new Tracker code -- pgrayson@ks.uiuc.edu 00019 * 00020 * A Tracker that gets its info over the net through VRPN. There are 00021 * multiple Trackers using the same connection to a computer, so they 00022 * need to cooperate in creative ways to get sensor updates. 00023 * 00024 ***************************************************************************/ 00025 #ifndef P_VRPNTRACKER_H 00026 #define P_VRPNTRACKER_H 00027 00028 #if defined(VMDVRPN) 00029 00030 #include "P_Tracker.h" 00031 #include "vrpn_Tracker.h" 00032 00034 struct VRPNTrackerUserData { 00035 float *pos; 00036 Matrix4 *orient; 00037 }; 00038 00039 00041 class VRPNTracker : public VMDTracker { 00042 private: 00044 vrpn_Tracker_Remote *tkr; 00045 00048 VRPNTrackerUserData userdata; 00049 00050 protected: 00051 virtual int do_start(const SensorConfig *); 00052 00053 public: 00054 VRPNTracker(); 00055 ~VRPNTracker(); 00056 const char *device_name() const { return "vrpntracker"; } 00057 virtual VMDTracker *clone() { return new VRPNTracker; } 00058 00059 inline virtual int alive() { 00060 if(tkr) if(tkr->connectionPtr()) 00061 return tkr->connectionPtr()->doing_okay(); 00062 return 0; 00063 } 00064 00065 virtual void update(); 00066 }; 00067 00068 #endif 00069 00070 #endif