vrpn  07.33
Virtual Reality Peripheral Network
vrpn_Tracker_PhaseSpace.h
Go to the documentation of this file.
1 #ifndef VRPN_TRACKER_PHASESPACE_H
2 #define VRPN_TRACKER_PHASESPACE_H
3 
4 #include "vrpn_Configure.h" // IWYU pragma: keep
5 
6 #ifdef VRPN_INCLUDE_PHASESPACE
7 #include <map>
8 #include <vector>
9 
10 #include "vrpn_Shared.h"
11 #include "vrpn_Tracker.h"
12 
13 #include "owl.h"
14 #include "owl_planes.h"
15 #include "owl_peaks.h"
16 #include "owl_images.h"
17 
18 #define VRPN_PHASESPACE_MAXMARKERS 256
19 #define VRPN_PHASESPACE_MAXRIGIDS 32
20 #define VRPN_PHASESPACE_MAXCAMERAS 128
21 #define VRPN_PHASESPACE_MAXDETECTORS 128
22 #define VRPN_PHASESPACE_MAXPLANES 256
23 #define VRPN_PHASESPACE_MAXPEAKS 512
24 #define VRPN_PHASESPACE_MAXIMAGES 512
25 #define VRPN_PHASESPACE_MSGBUFSIZE 1024
26 
28 
29 public:
30 
31  vrpn_Tracker_PhaseSpace(const char *name,
32  vrpn_Connection *c,
33  const char* device,
34  float frequency,
35  int readflag,
36  int slaveflag=0);
37 
38 
40 
41  virtual void mainloop();
42 
43  bool addMarker(int sensor,int led_id);
44  bool addRigidMarker(int sensor, int led_id, float x, float y, float z);
45  bool startNewRigidBody(int sensor);
46  bool enableTracker(bool enable);
47  void setFrequency(float freq);
48 
49  static int VRPN_CALLBACK handle_update_rate_request(void *userdata, vrpn_HANDLERPARAM p);
50 
51 protected:
52 
53  int numRigids;
55  bool owlRunning;
56  float frequency;
58  bool slave;
59  int frame;
60 
61  typedef std::map<int, vrpn_int32> RigidToSensorMap;
63  std::vector<OWLMarker> markers;
64  std::vector<OWLRigid> rigids;
65  std::vector<OWLCamera> cameras;
66  std::vector<OWLPlane> planes;
67  std::vector<OWLPeak> peaks;
68  std::vector<OWLImage> images;
69  std::vector<OWLDetectors> detectors;
70 
71 protected:
72  int read_frame(void);
73 
74  virtual int get_report(void);
75  virtual void send_report(void);
76 };
77 #endif
78 
79 #endif
std::vector< OWLPeak > peaks
std::vector< OWLCamera > cameras
std::vector< OWLDetectors > detectors
Generic connection class not specific to the transport mechanism.
#define VRPN_CALLBACK
#define VRPN_API
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
This structure is what is passed to a vrpn_Connection message callback.
std::vector< OWLMarker > markers
std::vector< OWLRigid > rigids
std::vector< OWLImage > images
std::map< int, vrpn_int32 > RigidToSensorMap
std::vector< OWLPlane > planes