The JAviator's software runs on the Robostix, Gumstix, and ground system hardware. The software is divided into three layers called Helicopter Plant (Plant), Flight Control System (FCS), and Ground Control System (GCS), as illustrated in the left-hand portion of the figure above. Each of these layers has been developed independently with well-defined interfaces to the other layers. Moreover, there are multiple, alternative implementations of all layers, which can be switched at compile time without changing any of the other layers. The lowest layer, in terms of software hierarchy, is the Plant. It either communicates sensor and motor data with the real JAviator, or else implements a simulation of the JAviator's dynamics. The FCS layer is the most complex part of the JAviator's software, and is shown in more detail in the right-hand portion of the figure. It implements the flight control algorithms and communicates with both, the Plant and the GCS. Finally, the GCS implements the Control Terminal application for piloting the JAviator and displaying its status. All three layers communicate via a simple, custom-designed message-passing protocol with the following format: a message is a packet with a header, a variable-size payload, and a checksum to ensure data integrity. The figure below depicts the packet format, which starts with the packet delimiter (0xFF) followed by two header bytes. The first of these two bytes contains the type of the packet such as, for instance, sensor data. The second byte encodes the payload size, followed by the payload, checksum, and another, final packet delimiter.
Due to the protocol-based layer separation, we are able to switch between alternative implementations of all three layers. This allows us to experiment with different control algorithms and implementations, run-time environments, and even programming languages. In the following sections, we provide more details on the different requirements and implementations of the layers described.