Adding new Drone type into ArduPilot

Hi! It’s about projects like ArduPlane or AntennaTracker.

  1. Create new project directory in ArduPilot root dir.
    New dir should be on the same level as ArduPlane or ArduCopter and so on.

  2. In this directory put next 3 files:

Makefile (with one line):

include ../mk/apm.mk

Makefile.waf:

all:
        @$(MAKE) -C ../  -f Makefile.waf programGroupsName

wscript (I took its contents from ArduPlane):

#!/usr/bin/env python
# encoding: utf-8

def build(bld):
    vehicle = bld.path.name
    bld.ap_stlib(
        name=vehicle + '_libs',
        ap_vehicle=vehicle,
        ap_libraries=bld.ap_common_vehicle_libraries() + [
            #below list libraries you need in you project
            'APM_Control',
            'AP_AdvancedFailsafe',
            'AP_ADSB',
            'AP_Avoidance',
            'AP_Arming',
            'AP_Camera',
            'AP_Frsky_Telem',
            'AP_L1_Control',
            'AP_Menu',
            'AP_Navigation',
            'AP_Parachute',
            'AP_RCMapper',
            'AP_Relay',
            'AP_ServoRelayEvents',
            'AP_SpdHgtControl',
            'AP_TECS',
            'AP_InertialNav',
            'AC_WPNav',
            'AC_AttitudeControl',
            'AP_Motors',
            'AC_PID',
            'AC_Fence',
            'AC_Avoidance'
        ],
        use='mavlink',
    )
    bld.ap_program(
        program_name='progamName',
        program_groups=['bin', 'programGroupsName'],
        use=vehicle + '_libs',
    )

As programName you can use for example “ArduMyPlane” and “myplane” as programGroupsName.

Also:
Don’t forget to put at least on .cpp file. Otherwise waf will fail to build anything from ardupilot directory (yes anything, even working projects).
Well that’s it.

Afterwards you can build your project:

$ cd $ArduPilotDir
$ waf --targets bin/progamName
# or if you use ArduMyPlane
$ waf --targets bin/ArduMyPlane

Hello,

Thanks for working on this guide. Perhaps this could become a wiki page? It needs to be filled out with other bring-up advice - i.e., setting up the scheduler, a main vehicle loop, params, mavlink, and dataflash logging at least.

I’d love to see a new ArduEmpty or ArduVehicleBase vehicle directory, and ideally Copter and Plane would actually inherit from it! PX4 is a really easy basis for new projects - can we make ArduPilot similarly easy?

see Wiki Editing Guide — ArduPilot documentation for info on that