~hitmuri/vjpirate/trunk

« back to all changes in this revision

Viewing changes to os/mac/include/vrpn/vrpn_Tracker_GPS.h

  • Committer: Florent Berthaut
  • Date: 2014-07-26 18:53:16 UTC
  • mfrom: (5.1.12 mac)
  • Revision ID: flo@localhost.localdomain-20140726185316-c2ucnwmgm5kij4e2
Merged mac branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// vrpn_Tracker_GPS.h
 
2
// This file contains the header for the VRPN GPS server.  This server
 
3
// reads NMEA messages from a serial GPS.
 
4
// This implementation can convert to UTM meter-based coordinates.
 
5
 
 
6
#ifndef VRPN_TRACKER_GPS_H
 
7
#define VRPN_TRACKER_GPS_H
 
8
 
 
9
#include <time.h>
 
10
#include <math.h>
 
11
#include <stdlib.h>
 
12
#include <stdio.h>
 
13
#ifndef _WIN32
 
14
#include <sys/time.h>
 
15
#endif
 
16
 
 
17
#include "vrpn_Tracker.h"
 
18
#include "vrpn_Button.h"
 
19
#include "vrpn_Analog.h"
 
20
 
 
21
#include "gpsnmealib/nmeaParser.h"
 
22
#include "gpsnmealib/utmCoord.h"
 
23
#include "gpsnmealib/latLonCoord.h" //-eb
 
24
 
 
25
class vrpn_Tracker_GPS: public vrpn_Tracker_Serial {
 
26
  
 
27
 public:
 
28
 
 
29
  vrpn_Tracker_GPS(const char *name, 
 
30
                   vrpn_Connection *c, 
 
31
                   const char *port = "/dev/ttyS1", 
 
32
                                   long baud = 4800,
 
33
                                   int utmFlag = 1,  // report in UTM coordinates if possible
 
34
                                   int testFileFlag = 0,
 
35
                                   const char* startStr = "RMC"); // the sentence to use as the "start" of a sequence
 
36
 
 
37
  ~vrpn_Tracker_GPS();
 
38
 
 
39
 
 
40
  /// This function should be called each time through the main loop
 
41
  /// of the server code. It polls for a report from the tracker and
 
42
  /// sends it if there is one. It will reset the tracker if there is
 
43
  /// no data from it for a few seconds.
 
44
 
 
45
  //  virtual void mainloop();
 
46
    
 
47
 protected:
 
48
         // need a bigger buffer
 
49
  unsigned char buffer[VRPN_TRACKER_BUF_SIZE*10];// Characters read in from the tracker so far
 
50
 
 
51
  virtual int get_report(void);
 
52
  virtual void reset();
 
53
 
 
54
  struct timeval reset_time;
 
55
 
 
56
  FILE *testfile;
 
57
  char testfilename[256];
 
58
 
 
59
  // an nmeaParser object and associated data objects
 
60
  NMEAData nmeaData;
 
61
  NMEAParser nmeaParser;
 
62
  UTMCoord utmCoord;
 
63
  int useUTM;
 
64
};
 
65
 
 
66
#endif