If you ever wonder how to read and decode the protocol check this:
The protocol looks like this in terminal:
!!!LAT:33952600,LON:-117409072,SPD:0.38,CRT:0.00,ALT:0,ALH:0,CRS:185.80,BER:94,WPN:0,DST:25853,BTV:11.84,***
+++ASP:0,THH:85,RLL:26,PCH:-31,STT:2,***
+++ASP:6,THH:85,RLL:27,PCH:-30,STT:2,***
+++ASP:11,THH:85,RLL:27,PCH:-29,STT:2,***
+++ASP:14,THH:77,RLL:28,PCH:-29,STT:2,***
+++ASP:15,THH:72,RLL:28,PCH:-28,STT:2,***
!!!LAT:33952596,LON:-117409072,SPD:0.24,CRT:0.00,ALT:0,ALH:0,CRS:185.57,BER:94,WPN:0,DST:25853,BTV:11.88,***
+++ASP:16,THH:68,RLL:29,PCH:-23,STT:2,***
+++ASP:18,THH:60,RLL:30,PCH:-20,STT:2,***
+++ASP:17,THH:61,RLL:31,PCH:-21,STT:2,***
+++ASP:14,THH:69,RLL:30,PCH:-27,STT:2,***
+++ASP:13,THH:71,RLL:29,PCH:-31,STT:2,***
There's a low rate string at 1hz that start with !!! and the second string is 4hz and starts with +++, both finish with ***.
You need to be able to search for the head of every string like "LAT:", without care of the order, then you read the value after and stop until you reach the comma. In C/C++ are functions that do that for you, if you need an example please read the
ardustation source code.
Definitions low rate:
LAT: Latitude
LON: Longitude
SPD: Speed over ground from GPS
CRT: Climb Rate in M/S
ALT: Altitude in meters
ALH: The altitude is trying to hold
CRS: Course over ground in degrees.
BER: Bearing is the heading you want to go
WPN: Waypoint number, where WP0 is home.
DST: Distance from Waypoint
BTV: Battery Voltage.
RSP: Roll setpoint used to debug, (not displayed here).
Definitions high rate:
ASP: Airspeed, right now is the raw data.
TTH: Throttle in 100% the autopilot is applying.
RLL: Roll in degrees + is right - is left
PCH: Pitch in degrees
SST: Switch Status, used for debugging, but is disabled in the current version.
I know the protocol sucks but is very flexible and i can add and remove new strings when ever i want without damaging the parsing of every groundstation. In ArduPilot Mega i will use ONLY binary protocol with Message ID's, Payload Bytes and CheckSums, better/faster/efficient/flexible..
Enjoy!
You need to be a member of DIY Drones to add comments!
Join DIY Drones