Hi! It’s about projects like ArduPlane or AntennaTracker.
-
Create new project directory in ArduPilot root dir.
New dir should be on the same level as ArduPlane or ArduCopter and so on. -
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