@@ -30,14 +30,14 @@ DEFINE_string(polaris_api_key, "",
30
30
" The service API key. Contact account administrator or "
31
31
32
32
33
- DEFINE_string (polaris_unique_id, " device12345 " ,
33
+ DEFINE_string (polaris_unique_id, " " ,
34
34
" The unique ID to assign to this Polaris connection." );
35
35
36
36
// Serial port forwarding options.
37
- DEFINE_string (receiver_serial_port, " /dev/ttyACM0 " ,
37
+ DEFINE_string (receiver_serial_port, " /dev/ttyUSB0 " ,
38
38
" The path to the serial port for which to forward corrections." );
39
39
40
- DEFINE_int32 (receiver_serial_baud, 115200 , " The baud rate of the serial port." );
40
+ DEFINE_int32 (receiver_serial_baud, 460800 , " The baud rate of the serial port." );
41
41
42
42
namespace {
43
43
// Max size of string buffer to hold before clearing NMEA data. Should be larger
@@ -61,11 +61,12 @@ double ConvertGGADegreesToDecimalDegrees(double gga_degrees) {
61
61
void OnNmea (const std::string& nmea_str, PolarisClient* polaris_client) {
62
62
// Some receivers put out INGGA messages as opposed to GPGGA.
63
63
if (!(boost::istarts_with (nmea_str, " $GPGGA" ) ||
64
+ boost::istarts_with (nmea_str, " $GNGGA" ) ||
64
65
boost::istarts_with (nmea_str, " $INGGA" ))) {
65
- LOG (INFO ) << nmea_str;
66
+ VLOG ( 2 ) << nmea_str;
66
67
return ;
67
68
}
68
- VLOG ( 4 ) << " Got GGA: " << nmea_str;
69
+ LOG (INFO ) << " Got GGA: " << nmea_str;
69
70
std::stringstream ss (nmea_str);
70
71
std::vector<std::string> result;
71
72
@@ -82,7 +83,7 @@ void OnNmea(const std::string& nmea_str, PolarisClient* polaris_client) {
82
83
(result[3 ] == " N" ? 1 : -1 );
83
84
double lon = ConvertGGADegreesToDecimalDegrees (std::stod (result[4 ], &sz)) *
84
85
(result[5 ] == " E" ? 1 : -1 );
85
- double alt = std::stod (result[8 ], &sz);
86
+ double alt = std::stod (result[9 ], &sz);
86
87
VLOG (3 ) << " Setting position: lat: " << lat << " lon: " << lon
87
88
<< " alt: " << alt;
88
89
polaris_client->SendLLAPosition (lat, lon, alt);
@@ -108,6 +109,7 @@ void OnSerialData(const void* data, size_t length,
108
109
109
110
if (nmea_sentence_buffer.size () > MAX_NMEA_SENTENCE_LENGTH) {
110
111
LOG (WARNING) << " Clearing NMEA buffer. Are you sending NMEA ascii data?" ;
112
+ nmea_sentence_buffer.clear ();
111
113
}
112
114
}
113
115
0 commit comments