In HEARTBEAT( Msg id 0) consist of Flightmode stored in custom_mode field but in MAVLink document didn't define this field because it depend on
which flight controller software was using in this case Arducopter
it was define in file "defines.h"
// Auto Pilot modes
// ----------------
#define STABILIZE 0 // hold level position
#define ACRO 1 // rate control
#define ALT_HOLD 2 // Altitude Hold
#define AUTO 3 // Waypoint
#define GUIDED 4 // Hold a single location from command
#define LOITER 5 // Hold a single location
#define RTL 6 // return to launch
#define CIRCLE 7 // orbit around a single location
#define LAND 9 // Landing
#define OF_LOITER 10 // Hold a single location using optical flow sensor
#define DRIFT 11 // DRIFT mode (Note: 12 is no longer used)
#define SPORT 13 // earth frame rate control
#define FLIP 14 // flip the vehicle on the roll axis
#define AUTOTUNE 15 // autotune the vehicle's roll and pitch gains
#define POSHOLD 16 // position hold with manual override
#define NUM_MODES 17
in MAVLink status from flight controller pack together in MAVLink Message
ex. Msg id #30 ATTITUDE consist of roll,pitch,yaw,roll speed,pitch speed,yaw speed
but in case of requesting these msg from flight controller we need to send request to flight controller for MAV_DATA_STREAM and frequency of these stream
MAV_DATA_STREAM is collection of different msg id group together
PyMAVLink is Tool for Bindings MAVLink with Python and also provide number tools for data analysis MAVLink stream logs
Download
git clone git://github.com/mavlink/mavlink.git
For Ubuntu
sudo apt-get install python-matplotlib
After Install Mathplot install PyMAVLink
cd ~
mkdir -p src
cd src
git clone https://github.com/mavlink/mavlink/
cd mavlink/pymavlink
python setup.py install --user
After install PyMAVLink it will show path in status message.It may vary
example : $HOME/.local/lib/python2.6/site-packages/
Edit ~/.bashrc or ~/.bash_profile and add this line: