Developer
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
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • James, Thanks a lot for your work on the integration with APM. I have used qgroundcontrol successfully to update parameters and do some other stuff but still have trouble with uploading waypoints (at least I suspect it's the GCS and not the APM causing problems). It seems that the altitude of waypoints (by default 0m) is absolute and not relative. Can you confirm that? I was wondering whether it's a bug or a feature :)

    The other issue I've had (but that's not related to APM integration) is that it does not seem to cache google map tiles. My 3g connection on the field is sporadic so it takes quite a few attempts and a lot of time to download tiles whereas it should be pretty simple to just cache these. Do you know if there is a way to activate this?

    This is all with Mac OS, APM 2.22, qgroundcontrol 0.9.0 (the dmg build). Thanks!

  • http://qgroundcontrol.org/users/start does not exist... please revise and update... Also I see this as a problem, to many trunks and branches and all are confused, would it be more logical to only have a few selected branches for ArduPilot Mega? and delete the other code or put it in a zip file for archive purposes?

  • Thanks James, so the first step should be:

    1. Get ArduPilotMega mavlink branch: svn checkout http://ardupilot-mega.googlecode.com/svn/ArduPilotMega/trunk "pathtosketchbook"/ArduPilotMega
  • Thanks James i just got it working!
  • Developer
    Use the trunk, the mavlink branch is now obsolete since it has been merged with the trunk.
  • 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?
  • 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 :))))

  • Developer

    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?

  • 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!!

  • 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.
This reply was deleted.