vrpn  07.33
Virtual Reality Peripheral Network
vrpn_Flock_Parallel.h
Go to the documentation of this file.
1 /*****************************************************************************\
2  vrpn_Flock_Parallel.h
3  --
4  Description : implements a class which runs an ascension flock of birds
5  tracker in multiple rs232 mode.
6 
7  ----------------------------------------------------------------------------
8  Author: weberh
9  Created: Thu Mar 5 19:38:55 1998
10  Revised: Fri Mar 19 15:05:28 1999 by weberh
11 \*****************************************************************************/
12 #ifndef _VRPN_FLOCK_PARALLEL_H_
13 #define _VRPN_FLOCK_PARALLEL_H_
14 
15 #include "vrpn_Configure.h" // for VRPN_API
16 #include "vrpn_Flock.h" // for vrpn_Tracker_Flock, etc
17 #include "vrpn_Types.h" // for vrpn_int32
18 
20 
21 // This is a class which provides a server for an ascension
22 // Flock of Birds tracker. The server will send out messages
23 // at whatever rate the flock of bird's stream mode feeds them.
24 // Default filtering is active.
25 // The timestamp is the time when the first character was read
26 // from the serial driver with "read". No adjustment is currently
27 // made to this time stamp.
28 
29 // Adelstein, et al, "Dynamic response of electromagnetic spatial
30 // displacement trackers", Presence 5(3) found that if all of the filters
31 // are turned off, and the time required to transport the data to the
32 // server is ignored, then the latency of the flock is about 2 ms for ori,
33 // 7.5 ms for pos for the 0-4hz range (ie, when the data is ready to leave
34 // the flock in stream mode, the pos is 7.5 ms old, and the ori is 2 ms
35 // old). Later this data will be combined with the baud rate to provide a
36 // more accurate time stamp for certain flock modes.
37 
38 // If this is running on a non-linux system, then the serial port driver
39 // is probably adding more latency -- see the vrpn README for more info.
40 
41 // forward decl
43 
44 // this class acts as the master
45 // these are both derived from vrpn_Tracker_Flock to take advantage
46 // of some of the data and functionality, but they replace the major
47 // functions
49 
50  public:
51 
52  // for parallel, you supply the master port and then the
53  // slave ports in a array with cSensors elements
54  vrpn_Tracker_Flock_Parallel(char *name, vrpn_Connection *c, int cSensors,
55  char *port, long baud,
56  char *slavePortArray[],
57  bool invertQuaternion = false);
58 
59  virtual ~vrpn_Tracker_Flock_Parallel();
60  virtual void mainloop();
61 
62  protected:
63  virtual int get_report(void);
64  virtual void reset();
65 
66  // slave ptrs
68 };
69 
70 // the special args are the master's vrpn id and tracker pos msg id
71 // The slave masquerades as the master when sending out reports
73 public:
75  vrpn_Connection *c,
76  char *port,
77  long baud,
78  vrpn_int32 vrpnMasterID,
79  int iSensorID );
81  virtual void mainloop();
82 
83  protected:
84  virtual void reset();
85 
87 };
88 
89 #endif // _VRPN_FLOCK_PARALLEL_H_
vrpn_Types.h
VRPN_FLOCK_MAX_SENSORS
#define VRPN_FLOCK_MAX_SENSORS
Definition: vrpn_Flock.h:11
vrpn_Tracker_Flock_Parallel_Slave
class VRPN_API vrpn_Tracker_Flock_Parallel_Slave
Definition: vrpn_Flock_Parallel.h:42
vrpn_Tracker_Serial::mainloop
virtual void mainloop()
Uses the get_report, send_report, and reset routines to implement a server.
Definition: vrpn_Tracker.C:907
vrpn_Tracker_Flock::get_report
virtual int get_report(void)
Gets a report if one is available, returns 0 if not, 1 if complete report.
Definition: vrpn_Flock.C:525
vrpn_Tracker_Flock_Parallel
Definition: vrpn_Flock_Parallel.h:48
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition: vrpn_Connection.h:510
vrpn_Tracker_Flock_Parallel_Slave
Definition: vrpn_Flock_Parallel.h:72
vrpn_Tracker_Flock::reset
virtual void reset()
Reset the tracker.
Definition: vrpn_Flock.C:296
vrpn_Flock.h
vrpn_Configure.h
vrpn_Tracker_Flock
Definition: vrpn_Flock.h:38
VRPN_API
#define VRPN_API
Definition: vrpn_Configure.h:646