HK's GCS now compatible with APM MAVlink

Paramater updates and waypoint/mission commands are now included in my GCS. "Control" commands are not available yet because I don't know what's ready to go in the APM MAVlink code yet....

The MAVlink trunk is here:

Download my GCS here:

It took me a while (and some help from Doug Weibel...Thanks Doug!) to figure out the 2-way communication. The hardest part about this implementation is it's asyncronous. Which means you've got to be ready to handle the messages even though they're sprinkled in with telemetry data. I still need to add the ability to change the output Hz on the MAVlink messages.... and all the control messages (like RTL and Loiter Here....etc). I'd also like to be able to download logs files using MAVlink.... but I'm not sure if that's possible.

Works via X-Bee. Built in parameter limits and descriptions. Drag and drop waypoints built into Google Earth plugin for real time mission planning. Automatic retries and timeouts for bad connections. Progress bar and status messages. Full APM mission command set.
E-mail me when people leave their comments –

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

Join diydrones


  • Andrus, my statement was not correct. We figured out what needs to be done and Doug has plans to implement it, but hasn't yet. The PIXHAWK guys added message #4 for us, but that doesn't solve the problem completely. I believe NMEA, SiRF and MediaTek all use a UTC time/date. uBlox is the only one (or maybe SiRF does too) that uses a number since an epoch... so the trouble becomes that Doug has to convert it one way or the other....everything to UTC or everything to epoch. What he's going to do is convert the first valid message from the GPS using his routine (it will be slow) and then simply add on the time that has passed since that conversion. So I think he's going to be using message #2 (SYSTEM_TIME) when he does it. And yes, it will be microseconds.
  • T3

    Hi Happykillmore, you are doing amazing job with your GCS, its such a nice software.


    Let me point out one issue you might not be aware of. You wrote:

    @Krzysztof, I will investigate today. There is currently an issue with ArduPilot Mega and UTC time. The MAVlink protocol requires a long integer since January of milliseconds.  Which is actually an overflow for today's date. Doug Weibel is working with the guys from MAVlink on this issue and I'm hoping to have this sorted out shortly.


    This is not correct. Mavlink protocol expects date not in milliseconds, but microseconds (and is using long long data format). Look at , every time or timestamp has format:


    I would not mind using milliseconds (my uav's timer ticks milliseconds anyway), but I'm worried about incompatibility with protocol.

  • So what kind of output stream can the flight sim generate? Would it come out a serial port? A socket? UDP? TCP?


    If you're just looking for a way to steer the plane you see on the GCS, my GPS Emulator will do that...Start, All Programs, HappyKillmore, GPS Emulator. You'll need to click the button to add the com0com drivers and create a feedback port (all this can be done in the emulator).

  • and in case i missed your point about who's in control. I would be using the flight simulator 's autopilot and way-point stack. If there are things that i'm missing that APM does that the flight sim can't, then that would have to be done by a middleware program
  • The point would be to be able to develop and test the ground station and control side of things without having to plug in the APM.  In the same way that you can use a flight simulator to make it think it is in the air. the Idea is to take out the APM and make the ground control station think it is talking to the APM when it is actually talking to the flight simulator.

    Assuming there is nothing like this available, can you point me in the direction of the communication to and from the APM. I'm guessing I'm going to have to make an intermediate middleware program...

  • Phil, what would be the point? A ground control station controlling a 3D representation of a plane? That doesn't make sense. Who's the brains of the operation?


    You can try my GPS emulator if you want. I don't know if Flightgear can take GPS will also emulate ArduPilot legacy commands.


    Peter, no, offline maps do not work.

  • I think this has been asked before - my apologies.

    Will the map work without being connected to the internet when you are flying?

  • Hey Happy,

    Is there a way to remove the APM from the Hardware in the loop simulation such that the GCS controls Flightgear instead of the APM autopilot?

  • Try downloading and installing this manually:…
  • Does it give any details in the send error report?


    Have you looked in the Event Logs for any details?


    Does this computer have any serial ports? Take a look in hardware manager to see if any are listed.

This reply was deleted.