Commit Graph

20605 Commits

Author SHA1 Message Date
Andrew Tridgell ee453783eb AP_InertialSensor: added get_delta_angle_dt() API 2016-01-19 09:50:21 +11:00
Lucas De Marchi f0d9f91650 travis: move some builds to the first thread
Now that we are build every linux board twice (one with make and one
with waf) and additionally building all examples and tests, it's taking
a long time to leave all linux boards in the same thread. Let's move
some of them to the other thread.
2016-01-18 20:30:14 -02:00
Lucas De Marchi 2d3a62eae3 AP_HAL_Linux: RCInput_RPI: revert PWM support
This reverts support for RCInput via PWM. This is causing trouble in
some RPI-based boards, receiving a SIGSEGV. Let's revert it for now and
retry this later.

This reverts commit 5629f38b2c.
This reverts commit 51fd0b3d55.
This reverts commit 79d56073f7.
2016-01-18 20:07:42 -02:00
Lucas De Marchi c8947c3e9c AP_HAL_Linux: RCInput_RPI: provide signal information
Otherwise it's difficult to know what signal is causing the program to
exit.
2016-01-18 19:20:44 -02:00
Lucas De Marchi 5629f38b2c AP_HAL_Linux: RCInput_RPI: fix use of uninitiliazed value
../../libraries/AP_HAL_Linux/RCInput_RPI.cpp: In member function ‘virtual void Linux::RCInput_RPI::_timer_tick()’:
../../libraries/AP_HAL_Linux/RCInput_RPI.cpp:489:127: warning: ‘x’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     counter = circle_buffer->bytes_available(curr_pointer, circle_buffer->get_offset(circle_buffer->_virt_pages, (uintptr_t)x));
                                                                                                                               ^
2016-01-18 19:19:36 -02:00
Julien BERAUD 45d668df47 AP_Compass_AK8963: support for timesliced timers
fallback in case the current scheduler doesn't support it
2016-01-18 16:57:48 -02:00
Julien BERAUD d15097f3fc AP_Baro_MS5611: Support for timesliced timers
fallback if current scheduler doesn't support it
2016-01-18 16:57:48 -02:00
Julien BERAUD 4acc121bd6 AP_HAL_Linux: support for timesliced timers
In order for lower frequency timers not to be called at the same iteration
of the main timer loop. This improves scheduling.
2016-01-18 16:57:48 -02:00
Julien BERAUD d5c4917bcd AP_HAL: add default support for timesliced timers
To keep compatibility
2016-01-18 16:57:48 -02:00
Lucas De Marchi 7f04e0106e waf: change binary names
APMrover2 -> ardurover
AntennaTracker -> antennatracker
ArduCopter -> arducopter
ArduPlane -> arduplane
2016-01-18 16:56:08 -02:00
Lucas De Marchi d663a748f2 waf: fix blddestdir
The destination directory for binaries should be
<build_dir>/<board>/bin/ and not
<build_dir>/<board>/<where-wscript-file-is>/bin

The same reasoning can be applied for others: tools, examples, etc
should follow the same rule.

Before this patch, compiling for example ArduPlane for navio we would
have:

    [339/339] Linking build/navio/ArduPlane/bin/ArduPlane

And now we have:

    [339/339] Linking build/navio/bin/ArduPlane
2016-01-18 16:56:08 -02:00
Lucas De Marchi eb6c89d09c waf: use os.path.join() for joining paths
Use platform-neutral way in python to join path components to improve
readability. Both will work when passing down to waf's Node object, even
on Windows.
2016-01-18 16:56:08 -02:00
Don Gagne c13cf70163 GCS_MAVLink: system id output as severity INFO 2016-01-18 09:40:00 +09:00
Andrew Tridgell df64a63243 scripts: use BUILDROOT in build_all.sh and build_binaries.sh
better ccache performance

fixup
2016-01-16 16:07:42 +11:00
Gustavo Jose de Sousa 2311affd0f waf: Makefile.waf: add check-all target
As a convenience shortcut for running *all* tests. Additionally, add
information about check targets in help.
2016-01-15 20:37:48 -02:00
Gustavo Jose de Sousa 5c41b48621 waf: run tests failed before on check
That avoids a failing test to "hide" behind some tests that were just modified
and fixed.
2016-01-15 20:37:48 -02:00
Gustavo Jose de Sousa 60abd4ff2f waf: don't differentiate taskgen names from targets for programs
waf's terminology might be a bit confusing regarding the word 'target'. As an
attribute for a task generator, it means the paths of the files supposed to be
built. As a command line option (--target), it means the list of names of the
task generators to be used in the build.

Before this commit, only vehicles programs had their task generators' target
parameter value different from the name parameter. Now, there's no distinction
between those two parameters for the case of programs.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa 386c12f8ff waf: Makefile.waf: simplify waf calls for vehicles 2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa 5f6debd186 waf: create build shortcuts for the vehicles 2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa 2448ea1611 waf: ardupilotwaf: add function build_shortcut
That enable the easy creation of custom build commands with the purpose of
creating "shortcuts" for execution from command line.

For example, consider the following code fragment from a wscript:
```
copter = ardupilotwaf.build_shortcut(targets='ArduCopter')
```

With that, one can just issue `waf copter` instead of
`waf --target ArduCopter`.

The parameter target is made optional because more parameters might be added to
this function in the future.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa 0b8eff79af waf: remove extension from programs' names
Each platform has its own build directory, no extension is necessary.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa ad0f2080c6 waf: reorganize destination of binaries in Tools
It makes more sense for Hello to be an example and for CPUInfo and Replay to be
placed inside a `build/<board>/tools/` directory.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa f4a6d13cef waf: make benchmarks and tests be placed in common directories
Benchmarks now go to `build/<board>/benchmarks/` and tests to
`build/<board>/tests/`. That's done by using ardupilotwaf.program() and passing
blddestdir and program_name.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa 59562ad693 waf: add option program_name to ardupilotwaf.program()
That allows one to set explictly the program name instead of getting it from
the current directory.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa 2ad91dc1bc waf: add option use_legacy_defines to ardupilotwaf.program()
This is to allow to use ardupilotwaf.program() for programs that don't need the
legacy defines.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa d281067bcc waf: make example binaries be placed in 'examples' dir
This commit makes examples' wscripts use ardupilotwaf.example() instead of
ardupilot.program().
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa c933b94f4d waf: add shortcut function for examples build
The function example() calls program() passing blddestdir as 'examples'.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa e549d0a3eb waf: use blddestdir to define task generator name
The only exception is for binaries that go in 'bin', like vehicles.
That way, partial builds follow the rule:
 - If building a vehicle or some helper that goes into 'bin', just use the
   binary name as the argument for --target. Example: `waf --target
   ArduCopter`.
 - For other binaries, the name of the directory they are placed in must be
   used. Example: `waf --target tests/test_vectors`.
2016-01-15 16:46:41 -02:00
Gustavo Jose de Sousa a55d803638 waf: make program() use blddestdir param
That param defines where the binary will be saved in the build directory,
namely `build/<board>/<blddestdir>`. The default is 'bin', for binaries that are
to be shipped for installation.
2016-01-15 16:46:40 -02:00
Ricardo de Almeida Gonzaga 4c60dd5e44 AP_HAL_Linux: improve yuyv_to_grey() performance
Based on gbenchmark metrics.

Before:
Benchmark             Time(ns)    CPU(ns) Iterations
----------------------------------------------------
BM_YuyvToGrey/4k          3109       3114     233334
BM_YuyvToGrey/75k        55777      55857      12353
BM_YuyvToGrey/300k      231829     232227       3043

After:
Benchmark             Time(ns)    CPU(ns) Iterations
----------------------------------------------------
BM_YuyvToGrey/4k          1713       1716     411765
BM_YuyvToGrey/75k        32124      32152      21875
BM_YuyvToGrey/300k      128530     128753       5385
2016-01-15 16:43:52 -02:00
Ricardo de Almeida Gonzaga 3748760ead AP_HAL_Linux: improve crop_8bpp() performance
Based on gbenchmark metrics.

Before:
Benchmark             Time(ns)    CPU(ns) Iterations
----------------------------------------------------
BM_Crop8bpp/64/64         3206       3197     198113
BM_Crop8bpp/240/240      38166      38181      18421
BM_Crop8bpp/640/480     193589     193317       3621

After:
Benchmark             Time(ns)    CPU(ns) Iterations
----------------------------------------------------
BM_Crop8bpp/64/64         2652       2657     232103
BM_Crop8bpp/240/240      33532      33506      20792
BM_Crop8bpp/640/480     187848     188201       3684
2016-01-15 16:43:52 -02:00
Ricardo de Almeida Gonzaga 210c90e784 AP_HAL_Linux: add benchmark for crop_8bpp() and yuyv_to_grey()
We had to check for board subtypes in the benchmark since VideoIn.cpp
does these checks.
2016-01-15 16:43:52 -02:00
Julien BERAUD 43307d95c8 OpticalFlow_Onboard: fix body rate calculation
The correct integral of the body rate is (rate + last_rate)/2*dt
and not rate * dt
2016-01-15 16:11:19 -02:00
Ricardo de Almeida Gonzaga 753f7d864a AP_HAL_Linux: add a shrink by software option in OpticalFlow
This shrink must be used when the output camera sizes doesn't fit
the expected output.

We don't need to crop it even when the camera sizes aren't squared since
the shrink_8bpp() function shrinks a selected area.
2016-01-15 16:05:47 -02:00
Ricardo de Almeida Gonzaga 553d36c860 AP_HAL_Linux: add shrink_8bpp() to VideoIn
This function shrinks a selected area on a 8bpp image.

The focus in this function was the performance, so this may not be the
clearer or the most understandable way to write it. The performance
was measured using GoogleBenchmark[1].

[1] - https://github.com/google/benchmark.git
2016-01-15 16:05:47 -02:00
Andrew Tridgell 9e243f50ca mavlink: submodule update 2016-01-15 19:11:05 +11:00
Andrew Tridgell d65ace2e34 scripts: make build_examples.sh much faster 2016-01-15 19:09:21 +11:00
Lucas De Marchi 51fd0b3d55 AP_HAL_Linux: RCInput_RPI: fix coding style
- Remove trailing whitespaces
 - Remove some uneeded comments
 - Fix indentation
 - Replace some breaks inside the loop by checking in the loop itself
2016-01-15 00:16:14 -02:00
Aaron Wang Shi 79d56073f7 AP_HAL_Linux: support PWM input for BH hat 2016-01-15 00:16:14 -02:00
Julien BERAUD f449107563 AP_HAL_Linux: Add Perf Lttng
Support for perf api using lttng.
Some additional build tricks needed for bebop because lttng uses dl_open
which is not compatible with a static link on a different libc as used
on the bebop
2016-01-14 19:13:35 -02:00
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
Lucas De Marchi 3a24531ade mk: fix dynamic linking option for board native
-pthread is the one supposed to be used because it defines pre-defined
macros as -lpthread doesn't
2016-01-14 18:59:04 -02:00
Julien BERAUD f5f2e6dcd9 mk: fix dynamic linking option for board linux
-pthread is the one supposed to be used because it defines pre-defined
macros as -lpthread doesn't
2016-01-14 18:59:04 -02:00
Andrew Tridgell f6c2b55c3f mk: fixed dependency on mavlink header generation 2016-01-15 07:44:15 +11: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 282c254897 waf: define include path for mavlink only if necessary
By using the export_includes, the include paths for mavlink are enabled only
for libs or programs that depend on it.
2016-01-15 07:28:48 +11:00
Gustavo Jose de Sousa 17e5d99509 waf: allow partial builds with new mavlink as submodule
The task generator for the mavlink headers is given a name 'mavlink' and is
added as a dependency to all local static libraries, because all of them use
sources that include mavlink headers. It would be nice to have a good way to
detect sources that use mavlink headers or to declare list of libraries that
use the headers, so that the dependency could be added automatically.

Additionally, there's a minor change in syntax for the task generator: using
strings directly instead of lists.
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