OpenPilot GCS Development
Every large system has a well defined system architecture; which if understood well makes it easy for us to start developing. The OpenPilot GCS is no different in this regard. In this page, the basic architecture of the GCS is outlined.
It’s Plugins All The Way Down
The actual OpenPilot GCS is basically a Plugin loader as all functionality of the application is implemented in plugins.
The core functionality is implemented in the Core Plugin
(Core::ICore), additionally the plugin manager
(ExtensionSystem::PluginManager) provides simple means for plugin cooperation that allow plugins to provide hooks for other plugin’s extensions.
At the most fundamental level plugin is a shared library (DLL file on Windows, SO file on Linux, DYLIB file on Mac). From a developer’s point of view plugin is a module that:
- Implements the ExtensionSystem::IPlugin interface in a class.
- Exports the Plugin Class using the Q_EXPORT_PLUGIN macro.
- Provides a pluginspec file that provides some meta information about the plugin.
- Exposes one or more objects that might be of some interest to other plugins.
- Searches for the availability of one or more objects exposed by other plugins.
We mention plugins a lot because from a developers point of view this is exactly what they are, however from a users perspective all the plugins they will be aware of are UAV Gadgets.
UAV Gadgets are in fact a special type of plugin which, on top of the above creates a IUAVGadget upon initialization. This is normally done through a gadget factory. The following diagram shows the classes that you have to implement in order to write a gadget (colored) an some other classes that are related to a gadget.
Here are the sources (DIA) for the diagram: OpenPilot GCS Development
The Core Plugin
The Core Plugin is the central plugin for the GCS. For normal plugin-development you don’t need to know about the internals. The following is intended for people who do development on the Core-Plugin. The following diagram shows some central relations of the Core Plugin.