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!

Views: 10128

Tags: ardupilot

Comment by Paul Mather on August 13, 2009 at 7:56am
Jordi, I never see a change in THH, is this because I don't have the sensor connected?

3D Robotics
Comment by Jordi Muñoz on August 13, 2009 at 9:07am
Hello Happy, maybe yes, because is in function of the airspeed.
Comment by Paul Mather on August 13, 2009 at 8:19pm
If I'm sending it GPS commands that say it's doing 40 MPH or 200 MPH, the THH never tells me to slow down or speed up.

3D Robotics
Comment by Jordi Muñoz on August 15, 2009 at 5:29pm
You need the airspeed.
Comment by I Heart Robotics on August 15, 2009 at 6:29pm
If I understand the schematic correctly, then the microcontroller sends telemetry data while the gps is not sending data. Is is correct that there is no secondary hardware serial port that could be used for an alternate telemetry data stream?

3D Robotics
Comment by Chris Anderson on August 15, 2009 at 8:31pm
No, the GPS has exclusive access to the Rx side of the serial port, while telemetry has exclusive access to the Tx side. There is no second serial port. (The Arduino library has a "software serial" function that's supposed to turn any digital pin into a serial port, but it doesn't work)
Comment by gke on March 7, 2010 at 12:49am
Jordi,
Do you have a draft of the binary protocol yet for the Mega. Converting to human readable in the flight code is a little expensive. I usually use message ID, LENGTH, payload, Checksum. The length is useful. I assume you will keep with using the message IDs only once rather than reusing the ID if a message type is abandoned.

Greg
ps ConfigTool now working well with UAVX - thanks again. Unfortunately we don't seem to have elevation data via Google here in Oz.
Comment by Resat Emre Ayvaci on December 11, 2010 at 4:11pm

LAT:33952600

LON:-117409072

 

i can't figure out what these values are. I tired to use this webpage to figure out, but failed. Can someone explain please?

http://itouchmap.com/latlong.html is the webpage that i used.

Comment by Paul Mather on December 11, 2010 at 4:22pm

Take each number and divide by 1000000 That will give you actual lat and long. You can plug them into Google Earth.

Comment by Resat Emre Ayvaci on December 11, 2010 at 4:28pm

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

please can someone explain this in measurement units? i don't know the units, and i can't the assumption. 

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2014   Created by Chris Anderson.

Badges  |  Report an Issue  |  Terms of Service