First, here is the output code I’m using:
[code]
altimu simple_minimu sd implementation 2-21-16 jaf
add hand monitor printout 2-21-16 jaf
*/
void printdata(void)
{
Serial.print("!");
Serial.print(“iTOW:”); Serial.print(posllh.iTOW);
Serial.print(" Mag heading: “);
Serial.print(MAG_Heading);
Serial.print(” lat/lon: “); Serial.print(posllh.lat/10000000.0f, 6); Serial.print(”,"); Serial.print(posllh.lon/10000000.0f, 6);
Serial3.print(“lat: “); Serial3.print(posllh.lat/10000000.0f,4);
Serial3.println();
Serial.print(” hMSL: “); Serial.print(posllh.hMSL/1000.0f);
Serial.print(” height: “); Serial.print(posllh.height/1000.0f);
Serial.print(” hAcc: “); Serial.print(posllh.hAcc/1000.0f);
Serial.print(” vAcc: “); Serial.print(posllh.vAcc/1000.0f);
Serial.print(”, ANG:”);
Serial.print(ToDeg(roll));
Serial.print(",");
Serial.print(ToDeg(pitch));
Serial.print(",");
Serial.print(ToDeg(yaw));
Serial.println();
dataFile.print("!");
dataFile.print("iTOW:"); dataFile.print(posllh.iTOW);
dataFile.print(" Mag heading: ");
dataFile.print(MAG_Heading);
dataFile.print(" lat/lon: "); dataFile.print(posllh.lat/10000000.0f, 6); dataFile.print(","); dataFile.print(posllh.lon/10000000.0f, 6);
dataFile.print(" hMSL: "); dataFile.print(posllh.hMSL/1000.0f);
dataFile.print(" height: "); dataFile.print(posllh.height/1000.0f);
dataFile.print(" hAcc: "); dataFile.print(posllh.hAcc/1000.0f);
dataFile.print(" vAcc: "); dataFile.print(posllh.vAcc/1000.0f);
dataFile.print(", ANG:");
dataFile.print(ToDeg(roll));
dataFile.print(",");
dataFile.print(ToDeg(pitch));
dataFile.print(",");
dataFile.print(ToDeg(yaw));
dataFile.println();
}
long convert_to_dec(float x)
{
return x10000000;
}
[/code]/
Here are two lines of the recorded data:
!iTOW:70897200 Mag heading: -0.03 lat/lon: 26.432762,-80.084946 hMSL: -0.55 height: -27.86 hAcc: 44.68 vAcc: 70.89, ANG:-1.42,0.81,-10.83
!iTOW:71128900 Mag heading: -2.98 lat/lon: 26.432747,-80.085014 hMSL: -14.39 height: -41.70 hAcc: 9.53 vAcc: 10.11, ANG:-6.97,-39.32,147.22
Without getting into signing, which I can deal with, the Mag heading output appears to be off by a couple of decimal places, to wit: 0.03 is more likely 03.00 degrees and 2.98 more likely 298.0 degrees. Am I missing something here or should i simply fix the math?
Second question is what are the units in the ANG: output? what does -6.97, -39.32, and 147.22 mean? Are they angles relative to a coordinate system in degrees? If not, what?
The other data are from binary output from a Ublox M8N which is a really marvelous chip which seems to have orders of magnitude more features and utility than the last one I used 4 years ago for another project.
This particular project is a datalogger to ride around for hours in a fixed wing R/C plane to record how it handles the better to design a custom autopilot for it, not to mention helping me learn how to do it.
I apologize if I might have found all of this already available somewhere on the web, but alas…