Resource organization for building firmware

@gmorph, with great thanks to you, I had success building ardupilot code in a Linux environment, both APMrover2-v2.px4 using make, and ardurover.px4 using waf.

At the end of the day I think the critical step for me was to do Tools/scripts/install-prereqs-ubuntu.sh -y from ~/ardupilot; previously, though I tried to follow the “Building PX4 for Linux with Make” documentation very carefully, my notes indicate that I ran install-prereqs-ubuntu.sh -y from my ~/ardupilot/Tools/scripts directory.

Incidentally, this step took almost an hour with my ~8MB/min internet connection.

Also, for practice or proof, from ~/ardupilot I successfully did ./modules/waf/waf-light rover --upload to install the firmware on Pixhawk (rather than using Mission Planner as I had in the past).

Following your lead, for both building and uploading, I used waf-light in the ardupilot/modules/waf directory instead of waf at the top of the ardupilot directory as implicitly suggested in the github ArduPilot/ardupilot/blob/master/BUILD/md documentation to which you refer, without fathoming the possible differences in effect.

Anyway, kind thanks for your responsiveness and motivation!
Pete

You all motivated me to get going with “development” using Linux, not just Windows; I finally got lubuntu 16.10 going on an old Thinkpad T-40. Anyway, attempting to build APMrover2 by make (following “Building Ardupilot for Pixhaw/PX4 on Linux Using Make”, even if make is being deprecated), there is this error,
which I’m not adept enough to interpret.

Did the “git submodule update --init --recursive” return any errors?
Failure to check out the mavlink source has led to this sort of error…

Grant’s advice to use waf is solid.

@peterbarker,

To answer lately: the account of this saga was split between this thread and an ArduBoat discussion thread. I did ultimately succeed in building APMrover2.px4 both with “make” and with “waf”, on Windows XP, Windows 7, and Linux (lubuntu). “git submodule update --init --recursive” did return errors:

  • failed to recurse into submodule path ‘ibuavcan/dsdl_compiler/pyuavcan’
  • failed to recurse into submodule path ‘src/modules/uavcan/libuavcan’
  • failed to recurse into submodule path ‘modules/px4firmware’

…but the build appears to have succeeded (I uploaded and ran the resulting APMrover2-v2.px4).

Roger on Grant’s advice to use waf being solid. I proved that both in the Windows and Linux environments. Not to belabor my inquiry process, but I was just as interested in questions of “what else might work?” and “why?” or “why not?” as in the question of “how can I get this to work?” and “what is the latest mode (fashion)?”!

Cheers,
Pete

Pete,

I realize this is a bit late but I was wondering if you ever were able to get the code compiled using Eclipse and XP? I’ve spent way too much time trying to get my Windows 10 Eclipse setup to spit out a ArduPlane file. I’m getting all sorts of errors that it can’t find the FlightMode enums even though I’ve added the file locations in the Includes path.

Thanks,
Richard

Hi Richard,

Had to review my notes! Hard to remember anything since my country had its stroke last November…

No, unless I’ve forgotten, I was never able to compile APMrover2 px4-v2 using Eclipse, but did succeed from command window using both “make” and “waf”, on the three different platforms noted in #23 of this thread.

By the way, the reference link in that post above has a typo ("." following the final “10”); I touched on my own difficulties with Eclipse in that thread.

Sadly, I gave up on Eclipse. I thought it might help me to get a better handle on the maze of ArduPilot code, by means of function references and so forth, but it always seemed almost as lost as I.

Code organization not being the primary object of my interest, and finding that even ArduPilot experts don’t easily implement what seem to me to be very basic I/O changes, I’m drifting away from the unwieldy universality of ArduPilot in favour of the more rewarding and fun effort of developing my own leaner code for my specific ArduBoat (that might even run on an Arduino!).

Best to you,
Pete