1
1
/*
2
- Once RTK Fix is achieved, and the tilt sensor is activated (ie shaken ) the tilt sensor
2
+ Once RTK Fix is achieved, and the tilt sensor is activated (ie rocked back and forth ) the tilt sensor
3
3
generates binary-encoded lat/lon/alt values that are tilt-compensated. To get these values to the
4
4
GIS Data Collector software, we need to transmit corrected NMEA sentences over Bluetooth. The
5
5
Data Collector does not know anything is being tilt-compensated. To do this we must intercept
@@ -64,7 +64,7 @@ void tiltUpdate()
64
64
break ;
65
65
66
66
case TILT_STARTED:
67
- // Waiting for user to shake unit (RTK Fix required for isInitialized)
67
+ // Waiting for user to rock unit back and forth (RTK Fix required for isInitialized)
68
68
tiltSensor->update (); // Check for the most recent incoming binary data
69
69
70
70
// Check IMU state at 1Hz
@@ -73,12 +73,12 @@ void tiltUpdate()
73
73
lastTiltCheck = millis ();
74
74
75
75
if (settings.antennaHeight_mm < 500 )
76
- systemPrintf (" Warning: Short pole length detected: %0.3f \r\n " , settings.antennaHeight_mm );
76
+ systemPrintf (" Warning: Short pole length detected: %0.3fm \r\n " , settings.antennaHeight_mm / 1000.0 );
77
77
78
78
if (settings.enableImuDebug == true )
79
79
printTiltDebug ();
80
80
81
- // Check to see if tilt sensor has been shaken
81
+ // Check to see if tilt sensor has been rocked
82
82
if (tiltSensor->isInitialized ())
83
83
{
84
84
beepDurationMs (1000 ); // Audibly indicate the init of tilt
@@ -110,7 +110,7 @@ void tiltUpdate()
110
110
lastTiltCheck = millis ();
111
111
112
112
if (settings.antennaHeight_mm < 500 )
113
- systemPrintf (" Warning: Short pole length detected: %0.3f \r\n " , settings.antennaHeight_mm );
113
+ systemPrintf (" Warning: Short pole length detected: %0.3fm \r\n " , settings.antennaHeight_mm / 1000.0 );
114
114
115
115
if (settings.enableImuDebug == true )
116
116
printTiltDebug ();
@@ -301,6 +301,10 @@ void beginTilt()
301
301
302
302
snprintf (clubVector, sizeof (clubVector), " CLUB_VECTOR=0,0,%0.3f" ,
303
303
(settings.antennaHeight_mm + settings.antennaPhaseCenter_mm ) / 1000.0 );
304
+
305
+ if (settings.enableImuCompensationDebug == true )
306
+ systemPrintf (" Setting club vector to: %s\r\n " , clubVector);
307
+
304
308
result &= tiltSensor->sendCommand (clubVector);
305
309
306
310
// Configure interface type. This allows IM19 to receive Unicore-style binary messages
@@ -553,7 +557,7 @@ void applyCompensationGNS(char *nmeaSentence, int arraySize)
553
557
// Add interstitial between end of lon and beginning of alt
554
558
strncat (newSentence, nmeaSentence + longitudeStop, altitudeStart - longitudeStop);
555
559
}
556
- else // No tilt compensation, no changes the lat/lon
560
+ else // No tilt compensation, no changes to the lat/lon
557
561
{
558
562
// Add start of message up to altitude
559
563
strncat (newSentence, nmeaSentence, altitudeStart);
@@ -820,7 +824,7 @@ void applyCompensationGGA(char *nmeaSentence, int arraySize)
820
824
uint8_t undulationStop = 0 ;
821
825
uint8_t checksumStart = 0 ;
822
826
823
- if (settings.enableImuCompensationDebug == true )
827
+ if (settings.enableImuCompensationDebug == true && !inMainMenu )
824
828
systemPrintf (" Original GNGGA: %s\r\n " , nmeaSentence);
825
829
826
830
int commaCount = 0 ;
@@ -870,14 +874,6 @@ void applyCompensationGGA(char *nmeaSentence, int arraySize)
870
874
strncpy (undulationStr, &nmeaSentence[undulationStart], undulationStop - undulationStart);
871
875
float undulation = (float )atof (undulationStr);
872
876
873
- float orthometricHeight = 0 ;
874
-
875
- if (tiltIsCorrecting () == true )
876
- {
877
- // Remove the undulation from the IMU's altitude
878
- orthometricHeight = tiltSensor->getNaviAltitude () - undulation;
879
- }
880
-
881
877
char newSentence[150 ] = {0 };
882
878
883
879
if (sizeof (newSentence) < arraySize)
@@ -915,7 +911,7 @@ void applyCompensationGGA(char *nmeaSentence, int arraySize)
915
911
// Add interstitial between end of lon and beginning of alt
916
912
strncat (newSentence, nmeaSentence + longitudeStop, altitudeStart - longitudeStop);
917
913
}
918
- else // No tilt compensation, no changes the lat/lon
914
+ else // No tilt compensation, no changes to the lat/lon
919
915
{
920
916
// Add start of message up to altitude
921
917
strncat (newSentence, nmeaSentence, altitudeStart);
@@ -967,7 +963,7 @@ void applyCompensationGGA(char *nmeaSentence, int arraySize)
967
963
// Overwrite the original NMEA
968
964
strncpy (nmeaSentence, newSentence, arraySize);
969
965
970
- if (settings.enableImuCompensationDebug == true )
966
+ if (settings.enableImuCompensationDebug == true && !inMainMenu )
971
967
systemPrintf (" Compensated GNGGA: %s\r\n " , nmeaSentence);
972
968
}
973
969
0 commit comments