Cooperative Flight Using APM

This code would enable users to fly(and simulate using HILS) multiple ArduPlanes in cooperative flight(For example Leader - Follower - Its Follower ... chains). Cooperative flight mode will only trigger in GUIDED mode, and flies like the standard ArduPlane code in other modes. The code is tested on APM2 and PX4(IO and fmu standalone). Xbee in API(mode 1) are used for communication. The code is well tested on HILS with rascal in flight gear and in actual flights. 
MAVProxy (slightly modified) is used to run the groundstation on APM MissionPlanner and QGCS both. I've give some figures and more details on my blog on diydrones.com(http://diydrones.com/xn/detail/705844:BlogPost:1122913?xg_source=activity). 

Thanks for the review in advance.