[Canberrauav] python MAVLink implementation
tridge at samba.org tridge at samba.org 
Wed Feb 9 13:58:55 EST 2011 

Hi All,

I don't know how many of you are python programmers, but I thought it
might be a good idea to do some of our mission control code in python,
as it should give us a robust, cross-platform way to develop the
various tools we're going to need.

To get us started on that, I've written a MAVLink implementation in
python. See my posting on the qgroundcontrol list for details:

  http://groups.google.com/group/qgroundcontrol/msg/a6bc241521a0767d

I'm hoping this will give us a reasonable basis for a whole bunch of
mission control tools, including mission logging, playback, parameter
control, payload control etc.

For those of you who don't know about MAVLink, it is a generic
protocol designed for communication with Micro Aerial Vehicles
(MAVs). See http://pixhawk.ethz.ch/wiki/software/mavlink/start for
more details. The ArduPilotMega code already speaks MAVLink, so it is
the obvious choice for us.

The HIL simulation work I've been doing has primarily been working on
ways to connect things via MAVLink messages. The python MAVLink
implementation will make that sort of thing easier too.

Cheers, Tridge

[Canberrauav] python MAVLink implementation
tridge at samba.org tridge at samba.org 
Wed Feb 9 14:39:52 EST 2011 

More on software ...

Once of the reasons I'm thinking of python for our tools is that
opencv (the open computer vision library) has a nice python interface:

  http://opencv.willowgarage.com/documentation/python/index.html

The example here gives a good idea of how we might use it:

  http://opencv.willowgarage.com/documentation/python/objdetect_cascade_classification.html
  #haar-feature-based-cascade-classifier-for-object-detection

So the "joe finding" application for the project might work something
like this:

 - get images from the cameras
 - get telemetry data (GPS, attitude, altitude etc) via MAVLink from
   the APM
 - use opencv to find joe in the images
 - use a bit of trigonometry in python to work out a
   latitude/longitude of joe
 - build a new set of waypoints and commands for the drop
 - send the new tasking to the autopilot via MAVLink

For initial testing this would run on a ground station computer, but
we should be able to move it all onto the mission control computer on
the plane (eg. a pandaboard) once we're at that stage. The pandaboard
would have no trouble running these sort of python scripts (it has
plenty of CPU and memory).

does that sound ok? Are there any other python coders in the team?

Cheers, Tridge

Copyright 2011 http://canberrauav.org.au/