AutoPilotPluginManager.cc 988 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/

10 11 12 13

/// @file
///     @author Don Gagne <don@thegagnes.com>

Don Gagne's avatar
Don Gagne committed
14
#include "AutoPilotPluginManager.h"
15
#include "PX4/PX4AutoPilotPlugin.h"
16
#include "APM/APMAutoPilotPlugin.h"
17
#include "Generic/GenericAutoPilotPlugin.h"
18

19
AutoPilotPlugin* AutoPilotPluginManager::newAutopilotPluginForVehicle(Vehicle* vehicle)
20
{
21 22 23 24 25 26 27
    switch (vehicle->firmwareType()) {
        case MAV_AUTOPILOT_PX4:
            return new PX4AutoPilotPlugin(vehicle, vehicle);
        case MAV_AUTOPILOT_ARDUPILOTMEGA:
            return new APMAutoPilotPlugin(vehicle, vehicle);
        default:
            return new GenericAutoPilotPlugin(vehicle, vehicle);
28
    }
29
}