Commit Graph

20430 Commits

Author SHA1 Message Date
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
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
bugobliterator abc2d712c3 submodule/mavlink:update mavlink submodule 2016-01-15 07:28:48 +11:00
bugobliterator d7fcc7cd85 GCS_MAVLink: remove obsolete files from GCS_MAVLink dir 2016-01-15 07:28:47 +11:00
Siddharth Bharat Purohit 11b82474de waf: generate mavlink headers for waf build 2016-01-15 07:28:47 +11:00
Siddharth Bharat Purohit dd65495668 mk: generate mavlink headers using mavlink module files 2016-01-15 07:28:47 +11:00
Siddharth Bharat Purohit 9a534da18c modules: add mavlink submodule 2016-01-15 07:28:47 +11:00
Randy Mackay d989cf29e2 Copter: cancelling no-gps-land switches to AltHold
Previously it could switch to Loiter
2016-01-14 15:22:02 +09:00
Randy Mackay dc2ec5db18 Copter: add Bitmask param description for PILOT_THR_BHV 2016-01-14 15:21:59 +09:00
Randy Mackay 2c5f9422d4 Copter: log event if pilot cancels land
Also add definition for throttle value that cancels land
2016-01-14 15:21:57 +09:00
Jonathan Challinger 8965185587 Copter: add "high throttle cancels landing" option 2016-01-14 15:21:54 +09:00
Randy Mackay 9e0cd7a5cf Copter: allow arming in Drift and Sport modes 2016-01-14 10:13:45 +09:00
Derek Ma 3751dbef91 ArduCopter: include precision landing sensor in mavlink system status
Set MAV_SYS_STATUS_SENSOR_VISION_POSITION bit in onboard_control_sensors_present, onboard_control_sensors_enabled and onboard_control_sensors_health based on the status of precision landing sensor.
2016-01-14 09:36:24 +09:00
Julien BERAUD 25de3c74c5 README: add github for Julien BERAUD 2016-01-13 19:18:37 -02: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
Paul Riseborough 287ebe8e6a AP_NavEKF2: Fix bug in application of sensor bias corrections
Sensor bias corrections were being applied to the incoming IMU data using the wrong delta time.
This was what was driving the different tuning between plane and copter for gyro bias process noise so the same gyro bias process noise default tuning value can now be used for all platform types.
Sensor bias corrections were being applied a a second time to the output observer inertial data.
2016-01-13 08:05:39 +11:00
Paul Riseborough 20923da23a AP_NavEKF2: Allow tuning of non-GPS mode
Eliminate the use of horizontal position states during non-aiding operation to make it easier to tune.
Explicitly set the horizontal position associated Kalman gains to zero and the coresponding covariance entries to zero after avery fusion operation.
Make the horizontal velocity observation noise used during non-aiding operation adjustable.
Use a fixed value of velocity noise during initial alignment so that the flight peformance can be tuned without affecting the initial alignment.
2016-01-13 08:05:39 +11:00
Paul Riseborough 23038e7243 AP_NavEKF2: Use measurement uncertainties to initialise covariance 2016-01-13 08:05:39 +11: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
Randy Mackay 97725c3187 Copter: add DISALLOW_GCS_MODE_CHANGE_DURING_RC_FAILSAFE to APM_Config.h
This makes it easier for us to find the definition without searching through the code
2016-01-12 19:51:43 +09:00
Jonathan Challinger cc1f27ad95 Copter: add DISALLOW_GCS_MODE_CHANGE_DURING_RC_FAILSAFE option 2016-01-12 19:49:17 +09:00
Jonathan Challinger 5cc969f01b Copter: simplify battery and radio failsafe logic 2016-01-12 18:23:01 +09:00
squilter 91187899fd Copter: initialize capabilities earlier 2016-01-12 18:13:15 +09:00