Commit Graph

2028 Commits

Author SHA1 Message Date
pkancir
85f0ef9265 waf : use LINKFLAGS for pthread
-pthread is the one supposed to be used because it defines pre-defined
macros as -lpthread doesn't, like was done in
2016-01-14 18:59:04 -02:00
Gustavo Jose de Sousa
ff02adf57e waf: mavgen: reorganize configure
The configure function was reorganized for:
 - removing variables that are not used
 - making it more general, i.e., not relying in ardupilotmega.xml, so that this
   tool can be used for generating other headers in the future
2016-01-15 07:28:49 +11:00
Gustavo Jose de Sousa
46449ee032 waf: mavgen: use output_dir instead of target
The option target for the waf task generator is meant for actual files that are
going to be build. Since our target files are dynamic, let's change the code to
use a new parameter output_dir instead.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa
ce294e841c waf: ardupilotwaf: make vehicle_stlib pass **kw to bld.stlib
That allows users to pass more parameters to bld.stlib.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa
5816dcba03 waf: mavgen: set system env during build instead of configure
By setting env.env during configure time makes changes be for the whole build
system scope and persistently, which may cause problems for other tasks and
tools.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa
e5c66de554 waf: mavgen: ensure order without bld.add_group()
This is a better approach, because there's no need of calling add_group() for
each time a mavgen task generator is created.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa
c9ca75e2cb waf: mavgen: set task signature for dynamic output
Since the output list for mavgen is dynamic, in the sense that we don't have
the information of what files will be generated by the task, that is not
captured by default by waf and post_run can't save the task signature for those
files. Although that doesn't cause build errors, the build time increase
significantly for when tasks that use the generate files are included (for
example, vehicles builds).

This patch search for the headers that were created by the task and set the
task signature for them. Using ant_glob isn't a very good solution, since there
may be stray file in the local build directory, but let's use that for now
until we find a better approach.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa
b3c1c2efd9 waf: mavgen: expand tabs to spaces
Although waf's coding style uses tabs instead of spaces, scripts created for
this repository have been using spaces from the beginning.
2016-01-15 07:28:48 +11:00
Siddharth Bharat Purohit
11b82474de waf: generate mavlink headers for waf build 2016-01-15 07:28:47 +11:00
Julien BERAUD
b8aef20ee8 Frame_Params: Fix bebop compass orient
Without COMPASS_EXTERNAL set to 1, COMPASS_ORIENT wasn't taken
into account, leading to bad data
2016-01-13 19:17:27 -02:00
khancyr
360d9fafb6 waf: force linking of phtread with gbenchmark
There is an issue with gbenchmark and waf on Ubuntu (15.04 and 15.10, ). Waf doesn't link pthread to gbenchmark and linking failed : 

````
[1652/1652] Linking build/linux/libraries/AP_Math/benchmarks/benchmark_matrix.linux
/home/khancyr/Workspace/APM/ardupilot/build/linux/gbenchmark/lib/libbenchmark.a(benchmark.cc.o): dans la fonction « benchmark::RunSpecifiedBenchmarks(benchmark::BenchmarkReporter*) »:
benchmark.cc:(.text+0x2e21): référence indéfinie vers « pthread_create »
/usr/bin/ld generated: référence indéfinie vers « pthread_create »
collect2: error: ld returned 1 exit status

Waf: Leaving directory `/home/khancyr/Workspace/APM/ardupilot/build/linux'
Build failed
 -> task in 'benchmark_matrix.linux' failed (exit status 1): 
    {task 139784788162576: cxxprogram benchmark_matrix.cpp.1.o -> benchmark_matrix.linux}
['/usr/lib/ccache/g++', '-Wl,--gc-sections', 'libraries/AP_Math/benchmarks/benchmark_matrix.cpp.1.o', '-o', '/home/khancyr/Workspace/APM/ardupilot/build/linux/libraries/AP_Math/benchmarks/benchmark_matrix.linux', '-Wl,-Bstatic', '-L.', '-lap', '-Wl,-Bdynamic', '-L/home/khancyr/Workspace/APM/ardupilot/build/linux/gbenchmark/lib', '-lm', '-lpthread', '-lrt', '-lbenchmark']
`````

Adding 'pthread' to env.LIB_GBENCHMARK solve the issue

see https://github.com/diydrones/ardupilot/pull/3460 and https://github.com/diydrones/ardupilot/issues/3461
2016-01-12 18:05:46 -02:00
Linus
81fc4ec838 SITL: add NFSC flying club location 2016-01-12 20:05:41 +09:00
Gustavo Jose de Sousa
d5e7b321f6 waf: add most linux boards 2016-01-11 16:31:59 -02:00
Gustavo Jose de Sousa
e21d41afe3 waf: enable fully static linking
Some boards (e.g. bebop) require fully statically linked binaries.
2016-01-11 16:31:59 -02:00
Gustavo Jose de Sousa
c90b0e8659 waf: add static_linking tool
Some platforms (e.g. bebop) might need to create fully statically linked
binaries. This serves to force a program to be statically linked. It has only
been tested on GNU compilers, other compilers may have unexpected behavior.
2016-01-11 16:31:59 -02:00
Gustavo Jose de Sousa
41e2a8cf1e waf: gbenchmark: disable cross-compilation
That's a temporary solution to allow cross compilation for the common binaries.
We can enable cross compilation of benchmark later.
2016-01-11 16:31:59 -02:00
Gustavo Jose de Sousa
e7312a1f81 waf: add toolchain tool for cross-compiling 2016-01-11 16:31:59 -02:00
Gustavo Jose de Sousa
82a33399ef waf: gbenchmark: call _configure_cmake() in waf configuration
The cmake checks for gbenchmark need to run some code. Calling
_configure_cmake() only during build can potentially fail build. That would
happen in some cross-compilations for example.
2016-01-11 16:31:59 -02:00
Gustavo Jose de Sousa
a31816c039 waf: gbenchmark: move cmake configuration to a separate function 2016-01-11 16:31:59 -02:00
Gustavo Jose de Sousa
7e8d25a56a waf: gbenchmark: use dict for cmake variables
That makes it easy to add new variables for the build system generation
command.
2016-01-11 16:31:59 -02:00
Gustavo Jose de Sousa
7d94095497 travis: unset CXX and CC at the beginning
Those environment variables are set by default by Travis. That fails cross
compilation with waf. There is a GitHub issue open related to that behavior at
https://github.com/travis-ci/travis-ci/issues/4682 .  This change can be
reverted if eventually that is fixed.
2016-01-11 16:31:59 -02:00
Peter Barker
f9f6cbaf9e SITL: use (larger!) font6 as default xterm font 2016-01-11 11:42:07 +11:00
Andrew Tridgell
6e418c2cf5 autotest: always sleep for 3 seconds on starting SITL 2016-01-11 09:31:13 +11:00
Andrew Tridgell
decb6dbab0 autotest: added option of autotest with gdb 2016-01-10 21:26:50 +11:00
Andrew Tridgell
9bb251a3fa autotest: disable DF log for QuadPlane test
it is just too big to be useful
2016-01-10 17:43:02 +11:00
Andrew Tridgell
6cf1fd762b autotest: don't show line noise in log download 2016-01-10 17:43:01 +11:00
Andrew Tridgell
bd111bd90b autotest: lower log bitmask for QuadPlane
reduce log size
2016-01-10 17:43:01 +11:00
Gustavo Jose de Sousa
d6b4e98a88 waf: remove already fixed TODOs
The TODOs removed with this patch were already fixed. Below is the explanation
for each.

 - TODO: add support for unit tests.
    - Supported already added.

 - TODO: Check if we should simply use the signed 'waf' "binary" (after
   verifying it) instead of generating it ourselves from the sources.
    - We're using a submodule for waf.

 - TODO: evaluate if we need shortcut commands for the common targets
   (vehicles). currently using waf --targets=NAME the target name must contain
   the board extension so make it less convenient, maybe hook to support
   automatic filling this extension?
    - There's no need of adding the extension anymore.

 - TODO: Once HAL patches get in, need to filter out the HAL based on the
   bld.env.BOARD.
    - The board-specific HAL library folders is indicated in
      bld.env.AP_LIBRARIES.
2016-01-09 14:08:07 -02:00
Andrew Tridgell
2c617cf8f0 scripts: stop building flymaple for plane
it no longer fits in flash
2016-01-09 17:03:41 +11:00
Andrew Tridgell
62b6057249 autotest: switch QuadPlane mission to full OBC2016 mission in Dalby 2016-01-09 16:50:17 +11:00
Andrew Tridgell
eec1b95f69 autotest: added quadplane test 2016-01-09 16:27:03 +11:00
Andrew Tridgell
9e43d5a4bb autotest: added defaults_file option to start_SIL() 2016-01-09 16:26:51 +11:00
Andrew Tridgell
7667ad3af0 autotest: don't see dynamic vars in defaults file 2016-01-09 07:38:55 +11:00
Andrew Tridgell
626b468930 autotest: added quadplane parameter file 2016-01-09 07:38:54 +11:00
Jonathan Challinger
f299fa7b3d CodeStyle: xmlpretty.py considers nodes with only text children to be one-liners 2016-01-07 17:39:09 +11:00
Jonathan Challinger
3e4b931d18 CodeStyle: update xmlpretty.py 2016-01-07 17:39:09 +11:00
Andrew Tridgell
67c3cf3d9b autotest: fixed incorrect default parms for plane 2016-01-07 13:48:59 +11:00
Andrew Tridgell
e7d7ab5ef6 autotest: no need to forceload parms now 2016-01-07 09:42:22 +11:00
Andrew Tridgell
0d26e3a445 autotest: automatically use sensible defaults for each vehicle type
this make first time use of SITL simpler
2016-01-07 09:10:20 +11:00
Gustavo Jose de Sousa
f338b917d0 waf: gbenchmark: get build node from variant
If there's no variant configuration, then cfg.variant will be '', which will
make bldnode be cfg.bldnode. Thus, this patch prepare gbenchmark build for
variant builds and doesn't break the current build.
2016-01-05 10:21:42 -02:00
Gustavo Jose de Sousa
f577c1702c waf: gbenchmark: catch WafError instead of Exception
Also, change the output.
2016-01-05 10:21:42 -02:00
Peter Barker
d72a833ad4 sim_vehicle.sh: remove unused -e option and unused variables
Closes #3336
2016-01-05 15:23:37 +11:00
Peter Barker
2c78b4f537 SITL: encourage bash to create a subshell when spawning ardupilot
This issue is evident in Vagrant if you don't forward X.

_fdm_input_step determined there was no parent and killed ArduPilot.

Closed #3249
2016-01-04 16:02:48 +11:00
Andrew Tridgell
eb73a2b0c9 autotest: fixed fg_quad_view for new FlightGear versions 2016-01-04 14:31:21 +11:00
Andrew Tridgell
568b1da797 autotest: added VTOL mission at KSFO airport 2016-01-04 10:24:27 +11:00
Andrew Tridgell
881ada9694 autotest: added windows flightgear view scripts 2016-01-04 10:24:17 +11:00
Andrew Tridgell
55e8e0742a autotest: fixed fg_plane_view.sh 2016-01-04 07:58:54 +11:00
Andrew Tridgell
9672b525f5 autotest: prevent duplication locations 2016-01-04 07:58:52 +11:00
Jonathan Challinger
ee18a1c5ed Tools: add xmlpretty.py 2016-01-02 08:42:33 +11:00
Andrew Tridgell
2f4933ec41 autotest: added two new locations 2016-01-01 17:03:43 +11:00
Andrew Tridgell
8932c21155 autotest: added quadplane model 2016-01-01 14:35:15 +11:00
Lucas De Marchi
09ebbac7ab waf: fix unsorted library
The list of libraries is maintained sorted to ease maintenance, avoid
repeating libraries, etc.
2015-12-30 10:42:20 -02:00
bugobliterator
57d2594bd7 Tools: add AP_AccelCal lib to waf library list 2015-12-29 10:46:35 -08:00
bugobliterator
065c67af57 Replay: fix replay build 2015-12-29 10:46:35 -08:00
Lucas De Marchi
a096703b06 Global: don't link with AP_Progmem
AP_Progmem is not used anymore.
2015-12-27 15:58:12 -02:00
Andrew Tridgell
26ced77ebc Replay: fixes for AP_Scheduler change 2015-12-27 14:57:28 +09:00
Don Gagne
07c0c6d519 autotest: Validate Range meta data for correctness 2015-12-27 16:10:43 +11:00
Lucas De Marchi
e9f4d4f1ed waf: use better and simpler syntax to find program
We can pass a list of possible binaries to find_program. This gives us a
better output while configuring:

	Checking for program 'ninja, ninja-build' : /usr/bin/ninja-build

instead of:

	Checking for program 'ninja'             : not found
	Checking for program 'ninja-build'       : /usr/bin/ninja-build
2015-12-23 10:20:17 -02:00
Julien BERAUD
e22fe34259 Params: add arming check for bebop
Taken from bebop 2
2015-12-22 16:50:27 -02:00
Jonathan Challinger
07d87d8877 Replay: reflect renamed function in AP_AHRS 2015-12-18 18:08:37 +11:00
Julien BERAUD
514b60cf5e Tools: add bebop build to travis 2015-12-15 18:59:03 +09:00
Randy Mackay
4f612f5d69 Frame_params: Bebop2 parameters
Rate PIDs are taken from original bebop which are slightly too high
2015-12-14 11:51:34 +09:00
Randy Mackay
8be0f9371f Frame_params: update recommended Bebop parameters 2015-12-14 11:49:00 +09:00
Gustavo Jose de Sousa
c4c9ce6a2a waf: ardupilotwaf: use name without board extention
If the attribute name is passed, then it is the one used to process the option
--target[s] of waf build. The board name should be used only in configuration
time. The build targets should be board/platform agnostic.

Now, instead of using `waf --target ArduCopter.sitl`, we use `waf --target
ArduCopter` and the binary continues named as "ArduCopter.sitl".
2015-12-10 10:40:37 +09:00
Gustavo Jose de Sousa
9b7f365e3a travis: fix waf calls
The path to waf became wrong after the decision of using waf as a submodule.
2015-12-08 11:14:04 +11:00
Gustavo Jose de Sousa
1e119c2182 waf: remove AP_ADC_AnalogSource from common libraries
That library was removed in a recent pull request. That PR was raised before
waf build system was integrated in the tree, that's why the fix just now.
2015-12-07 15:42:02 +09:00
Lucas De Marchi
8f9fa568b4 Tools: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:45 +11:00
Peter Barker
45d80080c3 Replay: use IMT in preference to IMU 2015-12-03 13:23:19 +11:00
Caio Marcelo de Oliveira Filho
6856950bd3 waf: use ConfigSet for board environments
Instead of a dictionary of dictionaries, have a dictionary of
ConfigSets. Using ConfigSet have two benefits: (1) allow easily copying
values from other, (2) have syntax for specifying the keys directly as
attributes.

With this change now it's easier to specify minlure without
repetition. New boards can override a value, append or prepend depending
on the need.

DEFINES attribute is treated as a dictionary instead of a list, so
that's easier to override values (at expense of ordering). When reading
the board environment, the code converts back to a list.

The board configuration is now stored in a separate file, there's also a
function to get the boards names.
2015-12-03 07:54:32 +11:00
Gustavo Jose de Sousa
8456cb4532 travis: support waf build
Currently, an associative array variable waf_supported_boards is used to
trigger waf build only the currently supported boards. After the transition to
the new build system is done, that variable can be removed.

We're just building for now - there is a current issue related to the rotation
for solo, and it turns out that the first unit test added as an example is for
vector rotations. After that is solved we can use waf check, so that unit tests
are run as well.
2015-12-03 07:54:32 +11:00
Gustavo Jose de Sousa
2828f66a6a waf: enable writing and building benchmarks 2015-12-03 07:54:31 +11:00
Gustavo Jose de Sousa
119948f263 waf: add gbenchmark Waf tool 2015-12-03 07:54:31 +11:00
Gustavo Jose de Sousa
6b4a6f5389 waf: use gtest for tests
It was implemented in such a way that gtest is required only if the user wants
to build and run tests. Initially we're considering all tests should be gtests.
We can change that assumption in the future if necessary.
2015-12-03 07:54:31 +11:00
Gustavo Jose de Sousa
8556b5dfb8 waf: add support to run (unit) tests
We're currently using the tests standard error for reporting tests. We can add
TAP later to integrate with other tools.

Additionally, this patch simplifies the exclude patterns passed to
collect_dirs_to_recurse.
2015-12-03 07:54:31 +11:00
Caio Marcelo de Oliveira Filho
6e7b73610d waf: add waf support 2015-12-03 07:54:30 +11:00
Lucas De Marchi
2591261af6 Global: rename min and max macros to uppercase
The problem with using min() and max() is that they conflict with some
C++ headers. Name the macros in uppercase instead. We may go case by
case later converting them to be typesafe.

Changes generated with:

	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)max(/\1MAX(/g'
	git ls-files '*.cpp' '*.h' -z | xargs -0 sed -i 's/\([^_[:alnum:]]\)min(/\1MIN(/g'
2015-12-01 16:28:09 -02:00
proficnc
efbe350182 Tools: firmware.diydrones gets reference to companion computers 2015-12-01 20:04:52 +09:00
Michael du Breuil
f19be28e89 autotest: allow delaying the mavproxy instance in SITL
This useful when using X forwarding, as mavproxy can start to quickly, and then break the sim enviorment. If the argument isn't used there is no change in behaviour
2015-12-01 15:01:24 +11:00
mirkix
ef56d952cd Linux_HAL_Essentials: Add HC-SR04 README.md 2015-12-01 07:04:10 +11:00
mirkix
fe442d35df Linux_HAL_Essentials: Add AioPRU README.md 2015-12-01 07:03:28 +11:00
Hamish Willee
7bbe73b233 Tools: fix up URL in readme to SITL via Vagrant doc 2015-11-30 09:55:07 +09:00
Andrew Tridgell
dfa107c7bb autotest: added Dalby OBC2016 mission and geofence 2015-11-30 07:46:40 +11:00
Andrew Tridgell
a6ed3e5e80 autotest: added Dalby location
location of OBC2016
2015-11-30 07:46:18 +11:00
Andrew Tridgell
6fdc6074d6 autotest: fixed "Reached command" string 2015-11-29 21:46:31 +11:00
Andrew Tridgell
ffa316c1f3 autotest: fixed copter for new strings for arm/disarm 2015-11-29 18:39:32 +11:00
Andrew Tridgell
672fc86d44 Travis: added px4-v4 to the travis build 2015-11-27 19:23:29 +11:00
Andrew Tridgell
084b607862 autotest: updated string for "Flight plan received" 2015-11-26 12:52:19 +11:00
Lucas De Marchi
17d9da4036 travis: use container infrastructure
In order to use the container infrastructure we can't use sudo to
install packages. Now Travis has a way to install packages by specifying
them in the .travis.yml. This greatly simplifies how we install the
packages and there's no need for a separate script anymore.

This also removes several outdated packages that aren't needed anymore.
2015-11-26 07:56:52 +11:00
Andrew Tridgell
fc7cdc1266 autotest: support a wider range of heli backends 2015-11-22 17:30:28 +11:00
Caio Marcelo de Oliveira Filho
071d8e541e Replay: use millis/micros/panic functions 2015-11-20 12:26:55 +09:00
Caio Marcelo de Oliveira Filho
ee7e3e34c0 Tools: CPUInfo use millis/micros/panic functions 2015-11-20 12:26:48 +09:00
Andrew Tridgell
4192c3d0ad autotest: calibrate 2nd accel in SITL for rover 2015-11-17 08:56:48 +11:00
Andrew Tridgell
8f4ce7f20b build: removed all nocore.inoflag files
these were APM2 specific
2015-11-16 08:05:17 +11:00
Andrew Tridgell
d43ef07f98 autotest: switched examples build to navio
apm2 no longer supported. Navio provides good coverage of the code for
example builds
2015-11-16 07:57:57 +11:00
Robert Lefebvre
4f7246c432 SITL: Helicopter parameter updates 2015-11-12 19:37:38 +09:00
Grant Morphett
5c499484a8 Added a default astyle options file and a linux script to run it. 2015-11-11 13:53:28 +11:00
Grant Morphett
e1b608d56d autotest: added arming to the Rover autotesting. 2015-11-11 13:39:39 +11:00
Andrew Tridgell
6bad33c922 scripts: use px4-clean for all binaries targets 2015-11-05 16:38:48 +11:00
Andrew Tridgell
ad9d50a457 autotest: changed -A to be used for arbitrary command line options 2015-11-04 14:24:01 +11:00
Gustavo Jose de Sousa
fe8d471490 Tools: RCInput_UART PIC firmware: keep status led on
Keep status led on while we are continuously sending packets to serial. That
shows the user we are receiving input properly.
2015-11-04 13:55:10 +11:00