Hi,
I was recently interested in doing the same thing for a research project I am working on, and I was able to make some initial progress. I thought for myself that it could be useful to make some heavy mods to the ArduPlane vehicle category, so I just made a copy of the ArduPlane folder in my branch of the repository and called it “ArduModel” (you can name it whatever you want, but this one seemed to make sense for me). Then the other mods I had to make so it would compile with $ ./waf is I had to edit lines 37 and 38 of the version of the wscript file that was copied from the ArduPlane folder and is now in the ArduModel so they went from
program_name='arduplane',
program_groups=['bin', 'plane'],
to
program_name='ardumodel',
program_groups=['bin', 'model'],
I also had to edit line 552 of the wscript file in the root ArduPilot repository folder so that it went from
for name in ('antennatracker', 'copter', 'heli', 'plane', 'rover', 'sub', 'bootloader','iofirmware','AP_Periph'):
to
for name in ('antennatracker', 'copter', 'heli', 'plane', 'model', 'rover', 'sub', 'bootloader','iofirmware','AP_Periph'):
Now when I run $ ./waf --help in my local version of the ArduPilot repository, the first part of the output looks like
sdeal3@ME02W0464GRD03:/mnt/d/sdeal3/Documents/ardupilot-research$ ./waf --help
waf [commands] [options]
Main commands (example: ./waf build -j4)
AP_Periph : builds AP_Periph programs
all : builds all programs of all group
antennatracker: builds antennatracker programs
benchmarks : builds all programs of benchmarks group
bin : builds all programs of bin group
bootloader : builds bootloader programs
build : executes the build
check : builds all programs and run tests
check-all : shortcut for `waf check --alltests`
clean : cleans the project
configure : configures the project
copter : builds copter programs
dist : makes a tarball for redistributing the sources
distcheck : checks if the project compiles (tarball from 'dist')
distclean : removes build folders and data
examples : builds all programs of examples group
heli : builds heli programs
install : installs the targets on the system
iofirmware : builds iofirmware programs
list : lists the targets to execute
localinstall : runs install using BLD/install as destdir, where BLD is the build variant directory
model : builds model programs
plane : builds plane programs
rover : builds rover programs
rsync : runs localinstall and then rsyncs BLD/install with the target system
step : executes tasks in a step-by-step fashion, for debugging
sub : builds sub programs
tests : builds all programs of tests group
tools : builds all programs of tools group
uninstall : removes the targets installed
So now $ ./waf knows about my new vehicle “model” and I can compile and upload it to my flight controller with the command $ ./waf model --upload. Obviously there are a lot of things that I won’t be needing that are copied over from ArduPlane, but the scheduler can be easily edited in the main ArduPlane file to remove the functions that I am not using and add the new functions that I want to use.
Sorry for the length, but this is just some of my thoughts that I had as I am trying out some interesting ways of tackling drone and robotics projects while taking advantage of the modularity and portability of the ArduPilot codebase.