QGroundControl Integration for ArduPilotMega - Setup Guide

This is a quick how-to to get going with ArduPilotMega QGroundControl Integration. Note that this is a work in progress and that the gains/ waypoints sent to the apm are not currently setting the values in the autopilot. I'll be working today to hook these up. I could really use help debugging and coding though so I've posted this to get everyone else up to speed.
  1. Get ArduPilotMega mavlink branch: svn checkout http://ardupilot-mega.googlecode.com/svn/ArduPilotMega/branches/mavlink "pathtosketchbook"/ArduPilotMega
  2. Get Arducopter libraries: svn checkout http://arducopter.googlecode.com/svn/trunk/libraries "pathtosketchbook"/libraries
  3. Get Mavlink: git clone https://github.com/pixhawk/mavlink.git "pathtosketchbook"/libraries/mavlink
  4. Get QGroundControl: http://qgroundcontrol.org/downloads or build from source: git clone https://github.com/pixhawk/qgroundcontrol.git "base directory"/qgroundcontrol, if you build from source you will need to copy "pathtosketchbook"/libraries/mavlink to "base directory" or create a symbolic link
  5. Set sketchbook path for arduino to "pathtosketchbook", then restart arduino IDE.
  6. Create an APM_Config.h file as seen below.
  7. Compile and upload code to board.
  8. Start QGroundControl, select network, add link, set to comm port (/dev/ttyUSB* on linux, COM* on windows) and then set the baud rate to 115200 (if using GCS_PORT 3)
Here is some documentation:

APM_Config.h file:

#define DEBUG_SUBSYSTEM 0

#define FLIGHT_MODE_CHANNEL 8
#define FLIGHT_MODE_1 AUTO
#define FLIGHT_MODE_2 RTL
#define FLIGHT_MODE_3 FLY_BY_WIRE_A
#define FLIGHT_MODE_4 FLY_BY_WIRE_B
#define FLIGHT_MODE_5 STABILIZE
#define FLIGHT_MODE_6 MANUAL

#define GCS_PROTOCOL GCS_PROTOCOL_MAVLINK
#define ENABLE_HIL ENABLED
#define GCS_PORT 3
#define GPS_PROTOCOL GPS_PROTOCOL_IMU
#define AIRSPEED_CRUISE 25

#define THROTTLE_FAILSAFE ENABLED
#define AIRSPEED_SENSOR ENABLED

Views: 2593

Comment by Paul Drews on December 2, 2010 at 10:12pm
Has anyone been maintaining the mavlink branch? I just tried to grab and build it using these instruction, but it seems to be out of date compared to the latest ArduCopter libraries. I did notice that the APM trunk has some mavlink code in it, so I am going to try to build it next. Is the APM trunk stable enough to try to fly with? I would really like to have qgroundcontrol(mainly in-flight gain tuning), but it is a beast getting all this stuff to build.
Comment by James Goppert on December 2, 2010 at 11:08pm
The mavlink dev branch is the one in sync with the apm trunk. (git clone "mavlinkurl" -b dev) I have hil running right now with in flight gains etc. I'm debugging some issues with the imu and flight modes as we speak. I wouldn't fly apm trunk until you can get a good hil run going. Hopefully I"ll have that working for me tonight though. It was previously working but we made some eeprom changes.
Comment by Paul Drews on December 3, 2010 at 12:17am
Awesome, thanks. I will keep an eye on the trunk. I just got my APM board a few days ago, and am developing under linux so I have no HIL. I will stay out of the main branch until I get a few flights under my belt. However, I hope to eventually help with development.

Any chance another stable APM release will be coming out any time soon?
Comment by James Goppert on December 3, 2010 at 1:22am
Sounds Great! I work exclusively on linux so you should be all set for HIL. I use the oooark scicoslab toolbox to talk mavlink to APM over Serial0 and then talk to qgroundcontrol on Serial3. http://oooark.git.sourceforge.net/git/gitweb-index.cgi
Comment by James Goppert on December 3, 2010 at 1:23am
The development team is pushing hard to have a new stable release soon. There have been some great flights on the beta branch but there are still a few kinks to work out.
Comment by Paul Drews on December 3, 2010 at 8:01am
Sweet! Glad to hear there is Linux support for all this. As soon as I get a few flights in, I will start poking around and see if I can get all this setup. I am quite glad I am not the only nut who likes linux.
Comment by Juan Enrique Martin Boix on December 12, 2010 at 2:47am

Hi ,if you follow pixhawk recommendations about Xbee ,115K baud is toomuch for bidirectional communications ,Do you agree?

http://pixhawk.ethz.ch/wiki/tutorials/how_to_configure_xbee

Bye!!

Comment by James Goppert on December 12, 2010 at 4:34am

Thanks for the info Juan. I have been using it on my desktop at 115200 with the XBee 900 Mhz modules and it has been functional. I haven't flown everything in the field yet so maybe I'll run into this problem at longer ranges?

Comment by Juan Enrique Martin Boix on December 12, 2010 at 4:14pm

http://pixhawk.ethz.ch/wiki/electronics/communication?s[]=xbee

They talk about "drop rates"  ?????

 

Is it possible for you to explain step by step, how to build the Qgcs with the Qtcreator. Why can´t  be created yet a built 0.7.7 ? Can you?

By the way ,I´m a total noob .....git was enough for a weekend and running and example in qt was a full sunday morning :))))

Comment by Rhett Walker on January 25, 2011 at 2:16pm
Hi,

I followed the directions exactly, but every time i try and upload the code it gives me the error:

" 'APM_ADC_HIL_Class' does not name a type"

does anyone know what might be the issue?

Comment

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

Join DIY Drones

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service