16
16
SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
17
17
Open the serial monitor at 115200 baud to see the output
18
18
19
- After calibrating the module and securing it to your vehicle such that it's
20
- stable within 2 degrees, and the board is oriented correctly with regards to
21
- the vehicle's frame, you can now read the vehicle's "attitude". The attitude
22
- includes the vehicle's heading, pitch, and roll. You can also check the
23
- accuracy of those readings.
19
+ getEsfAlignment (UBX-ESF-ALG) reports the status and alignment angles of the IMU within the vehicle.
20
+ These define the rotation of the IMU frame within the vehicle (installation frame) - not the heading
21
+ of the vehicle itself. The vehicle attitude solution is reported separately by getNAVATT (UBX-NAV-ATT).
24
22
25
23
*/
26
24
@@ -45,6 +43,8 @@ void setup()
45
43
46
44
myGNSS.setI2COutput (COM_TYPE_UBX); // Set the I2C port to output UBX only (turn off NMEA noise)
47
45
46
+ myGNSS.setESFAutoAlignment (true ); // Enable Automatic IMU-mount Alignment
47
+
48
48
if (myGNSS.getEsfInfo ()){
49
49
50
50
Serial.print (F (" Fusion Mode: " ));
@@ -63,20 +63,32 @@ void setup()
63
63
void loop ()
64
64
{
65
65
// ESF data is produced at the navigation rate, so by default we'll get fresh data once per second
66
- if (myGNSS.getEsfAlignment ()) // Poll new ESF ALG data
66
+ if (myGNSS.getEsfAlignment ()) // Poll new ESF ALG data
67
67
{
68
- Serial.print (F (" Status: " ));
69
- Serial.print (myGNSS.packetUBXESFALG ->data .flags .bits .status );
68
+ Serial.print (F (" IMU-Mount Alignment: On/Off: " ));
69
+ Serial.print (myGNSS.packetUBXESFALG ->data .flags .bits .autoMntAlgOn );
70
+ Serial.print (F (" Status: " ));
71
+ Serial.print (myGNSS.packetUBXESFALG ->data .flags .bits .status );
70
72
Serial.print (F (" Roll: " ));
71
73
Serial.print (myGNSS.getESFroll (), 2 ); // Use the helper function to get the roll in degrees
72
- Serial.print (F (" Pitch: " ));
73
- Serial.print (myGNSS.getESFpitch (), 2 ); // Use the helper function to get the pitch in degrees
74
- Serial.print (F (" Heading: " ));
75
- Serial.print (myGNSS.getESFyaw (), 2 ); // Use the helper function to get the yaw in degrees
76
- Serial.print (F (" Errors: " ));
77
- Serial.print (myGNSS.packetUBXESFALG ->data .error .bits .tiltAlgError );
78
- Serial.print (myGNSS.packetUBXESFALG ->data .error .bits .yawAlgError );
79
- Serial.println (myGNSS.packetUBXESFALG ->data .error .bits .angleError );
74
+ Serial.print (F (" Pitch: " ));
75
+ Serial.print (myGNSS.getESFpitch (), 2 ); // Use the helper function to get the pitch in degrees
76
+ Serial.print (F (" Yaw: " ));
77
+ Serial.print (myGNSS.getESFyaw (), 2 ); // Use the helper function to get the yaw in degrees
78
+ Serial.print (F (" Errors: " ));
79
+ Serial.print (myGNSS.packetUBXESFALG ->data .error .bits .tiltAlgError );
80
+ Serial.print (myGNSS.packetUBXESFALG ->data .error .bits .yawAlgError );
81
+ Serial.println (myGNSS.packetUBXESFALG ->data .error .bits .angleError );
82
+ }
83
+
84
+ if (myGNSS.getNAVATT ()) // Poll new NAV ATT data
85
+ {
86
+ Serial.print (F (" Vehicle Attitude: Roll: " ));
87
+ Serial.print (myGNSS.getATTroll (), 2 ); // Use the helper function to get the roll in degrees
88
+ Serial.print (F (" Pitch: " ));
89
+ Serial.print (myGNSS.getATTpitch (), 2 ); // Use the helper function to get the pitch in degrees
90
+ Serial.print (F (" Heading: " ));
91
+ Serial.println (myGNSS.getATTheading (), 2 ); // Use the helper function to get the heading in degrees
80
92
}
81
93
82
94
delay (250 );
0 commit comments