Auto mode doesn't hold altitude

I have a Pixhawk on my Skyhunter, and have noticed a problem with the AUTO flight mode. When flying to waypoints, it does not follow the desired altitude. In the Mission Planner, all waypoints listed have 100 as their altitude. However, when flying the waypoints it will slowly descend until I have to manually take over.

I did notice this in the log file, where it writes out the waypoints. It doesn’t look like there is any altitude information there:

[quote]CMD, 15052, 39, 0, 16, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000
CMD, 15052, 39, 1, 206, 68.55556, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000
CMD, 15052, 39, 2, 16, 0.000000, 0.000000, 0.000000, 0.000000, 39.77721, -121.8298, 30.48000
CMD, 15052, 39, 3, 16, 0.000000, 0.000000, 0.000000, 0.000000, 39.77298, -121.8295, 30.48000
CMD, 15052, 39, 4, 16, 0.000000, 0.000000, 0.000000, 0.000000, 39.77298, -121.8290, 30.48000
CMD, 15052, 39, 5, 16, 0.000000, 0.000000, 0.000000, 0.000000, 39.77718, -121.8293, 30.48000
CMD, 15052, 39, 6, 16, 0.000000, 0.000000, 0.000000, 0.000000, 39.77715, -121.8288, 30.48000
CMD, 15052, 39, 7, 16, 0.000000, 0.000000, 0.000000, 0.000000, 39.77299, -121.8286, 30.48000
CMD, 15052, 39, 8, 16, 0.000000, 0.000000, 0.000000, 0.000000, 39.77300, -121.8281, 30.48000
CMD, 15053, 39, 9, 16, 0.000000, 0.000000, 0.000000, 0.000000, 39.77711, -121.8284, 30.48000
CMD, 15053, 39, 10, 16, 0.000000, 0.000000, 0.000000, 0.000000, 39.77708, -121.8279, 30.48000
CMD, 15053, 39, 11, 16, 0.000000, 0.000000, 0.000000, 0.000000, 39.77301, -121.8276, 30.48000[/quote]

Here’s a copy of the full log: drive.google.com/file/d/0B4mrCP … sp=sharing

From the documentation, I found this for the format of the CMD message. It seems I have one more parameter at the end, after longitude. Also, there is no altitude before the latitude, which might be my problem. I guess the big question is how do I fix it???

[quote]CMD (commands received from the ground station or executed as part of a mission):

CTot: the total number of commands in the mission

CNum: this command’s number in the mission (0 is always home, 1 is the first command, etc)

CId: the mavlink message id

Copt: the option parameter (used for many different purposes)

Prm1: the command’s parameter (used for many different purposes)

Alt: the command’s altitude in meters

Lat: the command’s latitude position

Lng: the command’s longitude position[/quote]

Figured it out. On the Pixhawk, it’s the last parameter that is altitude for the CMD message. And where I thought my altitude was in meters, it’s actually in feet. I’ve updated my waypoints, now I just need to get out there and fly to test it out!