All the work below is done with the objective of finally being able to fly multiple MAVs/UAVs all in autonomous mode communicating with one another to achieve meaningful goals (Like quickly scan a particular area for identifying a target etc). The "Human pilot" flying in manual mode is optionally kept in the loop. Everything below is open source, so feel free to use/modify/extend :)
I am not sure if anyone else here in the community is working on carrying out such cooperative missions(like Leader-Follower, Orbit follower, Cyclic Pursuit etc) although theoretical work on it has been around for a while in many research papers. If nobody has worked on it yet, here is a fresh start, else, do comment below about your projects.
Currently, what we have here is a HIL simulator for these cooperative missions for 3 MAVs and we wish to now implement these in flight.
A framework for Hardware in Loop Simulation (HILS) of cooperative missions in autonomous miniature aerial vehicles (MAV) using open source Ardupilot-Mega based hardware and software platform has been implemented. Ardupilot Mega (APM) is an Arduino based commercial autopilot board for stabilization and navigation of individual MAVs. Our framework extends its features to support HILS of cooperative missions for multiple MAVs by facilitating inter-aircraft and aircraft-ground station communication.
The framework has a loosely coupled design which isolates the high level planning algorithms from the rapidly evolving low level autopilot routines. It is designed as a natural extension to the various flight modes (Manual/Return-to-Launch/Circle/Waypoint navigation) already present in Ardupilot-Mega platform and can be switched between them seamlessly. Cooperative mission mode is triggered through switching to "Guided Mode".
Inter-aircraft communication is done using Xbee API protocol which facilitates unicasting custom message packets to-and-from any aircraft of the cooperative system. The Xbees are also used by all the aircrafts in the HILS to communicate with the QGroundControl Station (qGCS) using the widely compatible MAVlink protocol. This makes the framework compatible with any other GCS supporting MAVlink protocol.
Since all the communication between various nodes of simulation is through Xbees in API mode, it makes the framework readily extendable for flight testing of the cooperative algorithms in real flights. The hardware in this HIL simulation comprises of the APM autopilot controller board and Xbee modules in API mode. The APM board runs both the low level autopilot software and the high-level cooperative algorithms. Xbees perform the inter-aircraft and aircraft-GCS communication. The sensors and actuators are being simulated in this HILS framework. Open source flight simulation software Flightgear is used to simulate the flight dynamics. The sensor/actuator information is exchanged
between the autopilot board and Flightgear over a serial port.
In short :
GCS used : Qgroundcontrol GCS
Autopilot Used : APM 1.4 (without Oilpan)
Communication modules : Xbee Pro in API mode on all aircrafts and GCS
Inter Aircraft communication : In Xbee API protocol
Aircraft GCS communication : MAVlink v0.9 embedded in Xbee API header and Footer
Flight Simulator Used : Flight gear, Aircraft used : Rascal 110 and C172p (JSBsim)
No. of MAVs in the cooperative mission simulated : Upto 3 till now, can be easily extended to more.
Cooperative missions performed up untill now : Leader follower for 3 MAVs, Orbit Follower for 3 MAVs, Cyclic Pursuit for 3 MAVs
Here are a few snaps of qGCS during various cooperative mission HIL simulations:
Leader Follower for 3 MAVs:
MAV1 : Autonomus Waypoint Navigation mode
MAV2 : Continuously follows MAV1
MAV3 : Continuously follows MAV1
View from another angle of the same mission.
Orbit Follower for 3 MAVs
The orbit center(lat,long,alt) can be set for any of the 3 MAVs through clicking on APM Missionplanner "Fly to Here" option which sets it as the orbit center for that MAV and also sends this orbit center information to rest of the MAVs in the simulation with then accept it as there orbit center information. Thus all the aircrafts immediately start to converge into orbits around that center.
Another angle of view for the same simulation.
The major part of APM firmware is kept essentially the same, except for a few additions. This flowchart below explains what we have tried to do :
Since we were using APM1.4 without the Oilpan, we started with the firmware provided by ardupilotdev ArduPlane_228xp2.zip and made all the additions/changes in it. We are in an effort to port everything to the latest APM firmware so that we can test the setup in flight. We also have to shift from the old MAVlink 0.9 to MAVlink 1.0.
Here are the required codes for the leader follower mission (Edit it using Arduino 0022 relax patch)
I seem to have exceeded a space limit of some kind(can't seem to attach anymore files!), I'll attach the codes as comments below.
This work was carried out by the combined effort of Swaroop Hangal and Bharat Tak under the guidance of Dr. Hemendra Arya.