Commit Graph

113 Commits

Author SHA1 Message Date
Caio Marcelo de Oliveira Filho ec52df991c build: compile only the HAL files needed by the board
Instead of requiring every program to specify the HAL related modules,
let the build system do it (in practice everything we compiled depended
on HAL anyway). This allow including only the necessary files in the
compilation.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
Gustavo Jose de Sousa f32c4ceda9 AP_OpticalFlow: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:38:21 +10:00
Randy Mackay 4aef64c153 OpticalFlow_Linux: reworked driver
remove PANICs from init
return semaphore if init fails
add successful initialisation check before attempting to read from sensor
structure made private where possible
formatting fixes
check I2C reads succeed
add request_measurement to request sensor to produce measurement
quit after 20 of previous 40 reads fail
throttle reads to 10hz max
2015-08-07 15:51:11 +09:00
Víctor Mayoral Vilches ed3366aaae AP_OpticalFlow: Add support for Linux
Add a Linux userspace driver for the PX4FLOW sensor.
2015-08-07 15:50:41 +09:00
Randy Mackay 03356a8d3a OptFlow: fix parameter descriptions 2015-07-06 11:37:38 +09:00
Randy Mackay 7bbaeac55f OpticalFlow: init _last_update_ms member
This resolves a defect found with coverity
2015-06-08 14:46:11 +09:00
Andrew Tridgell 637f8430c9 AP_OpticalFlow: convert example from .pde to .cpp 2015-06-01 17:07:06 +10:00
Andrew Tridgell 4ee54a8915 AP_OpticalFlow: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Paul Riseborough 53358a4e10 AP_OpticalFlow: Add parameter to compensate for flow sensor yaw angle
AP_OpticalFlow: update parameter name
2015-04-10 11:07:31 +09:00
Randy Mackay 385558db4d OptFlow: fix example sketch 2015-03-13 16:41:01 +09:00
Andrew Tridgell 995311f807 AP_OpticalFlow: change for new PX4 device paths 2015-02-14 12:25:44 +11:00
Randy Mackay f48a71f30a OptFlow: fix example sketch 2015-01-28 17:15:47 +09:00
Andrew Tridgell 19c717df2e AP_OpticalFlow: updates for new AP_Baro API 2015-01-09 11:50:56 +11:00
Andrew Tridgell aff01c6d09 AP_OpticalFlow: fixed reversed timestamp
thanks to Randy
2015-01-03 14:16:34 +11:00
Andrew Tridgell 11ff12dfd3 AP_OpticalFlow: split library into frontend/backend
this will make it easier to add a SITL backend
2015-01-03 14:16:33 +11:00
Andrew Tridgell f8bce994b5 AP_OpticalFlow: don't write an error message if no flow sensor
most users have no flow sensor
2015-01-01 11:02:43 +11:00
Randy Mackay 3c23f00e81 OptFlow: remove ADNS3080 image grabber example 2014-12-08 14:58:24 +09:00
Andrew Tridgell 22a7b69260 AP_OpticalFlow: don't build optical flow example
broken by library changes
2014-12-06 22:05:42 +11:00
Andrew Tridgell ed510d4f87 AP_OpticalFlow: run PX4 flow sensor at 10Hz
Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
2014-12-06 18:16:51 +11:00
priseborough 063fb41748 AP_OpticalFlow: Add separate scale factors for X and Y axis.
The resolution is also increased to take advantage of the planned introduction of automated calibration methods
2014-12-06 18:16:49 +11:00
priseborough f4f0dfc45c AP_OpticalFlow: efficiency improvements to data processing 2014-12-06 18:16:49 +11:00
priseborough 7ec8dfebcf AP_OpticalFlow : Remove gyro scale factor user adjustable parameter
No longer required because bug in flow sensor has been fixed.
2014-12-06 18:16:48 +11:00
priseborough df59f3311a AP_OpticalFlow : Add gyro scale factor correction parameter 2014-12-06 18:16:48 +11:00
priseborough eec49ce1dd AP_OpticalFlow : Add parameter for flow rate scale factor correction 2014-12-06 18:16:48 +11:00
priseborough 92e9336fe1 AP_OpticalFlow : prevent divide by zero 2014-12-06 18:16:47 +11:00
priseborough cb4d5986e0 AP_OpticalFlow : Update PX4Flow interface
Interface now uses the integral of flow and body rates
2014-12-06 18:16:43 +11:00
priseborough 0d774d301d AP_OpticalFlow : Remove support for ADNS3080 sensor
It is not compatible with the new interface and data fusion requirements
2014-12-06 18:16:43 +11:00
Andrew Tridgell 5ddbcc296d AP_OpticalFlow: fixed example build 2014-10-24 21:38:03 +11:00
Andrew Tridgell d84c1cd3e4 AP_OpticalFlow: fixed example build 2014-10-20 08:42:51 +11:00
Randy Mackay eed6a1ce61 OptFlow: fix example sketch so it compiles 2014-10-16 13:52:07 +09:00
Randy Mackay a476a914b0 OptFlow_PX4: check healthy before updating 2014-10-15 16:36:40 +09:00
Randy Mackay f504ea7b30 OptFlow_ADNS3080: check healthy before updating 2014-10-15 16:36:38 +09:00
Randy Mackay d238f48dda OptFlowPX4: fix compile error for APM 2014-10-15 16:36:33 +09:00
Randy Mackay a9cfbb71b8 OptFlowPX4: use ORB to pull data from sensor
This change is required because PX4Firmware has changed the method used
to pull data from the sensor.
2014-10-15 16:36:25 +09:00
Randy Mackay ec4581b35a OptFlow: add ground_distance_m 2014-10-15 16:35:48 +09:00
Randy Mackay 4b0548973a OptFlow: add PX4Flow support 2014-10-15 16:35:33 +09:00
Randy Mackay 3c4be75487 OptFlow: reorganise ADNS3080 to simplified interface 2014-10-15 16:35:31 +09:00
Randy Mackay b64f9ed964 OptFlow: rename and restructure OpticalFlow class
AP_OpticalFlow.h becomes simply a file that includes all other optical
flow header files.
OpticalFlow class simplified to only return surface quality, raw output
and velocity vector.
2014-10-15 16:35:29 +09:00
Andrew Tridgell 5025f04cb1 AP_OpticalFlow: fixed example build 2014-08-13 22:12:14 +10:00
Kevin Hester a7820e6c71 OptFlow: fixup line endings 2014-04-15 15:57:33 +09:00
Randy Mackay d19b566d97 OptFlow: remove unused variables
Saves 24bytes RAM by removing several static variables that were used
only for internal calculations
2014-02-10 13:53:49 +09:00
Bill Bonney 82ea5926a8 OptFlow: update function added to fix compiler error 2014-02-08 11:53:04 +09:00
Randy Mackay 3823eed865 OptFlow: update example sketch to work with shrunken library 2014-01-09 12:31:51 +09:00
Randy Mackay 8caa5159f8 OptFlow: shrink lib by removing unused functions
Saves 46bytes of RAM and 1k of flash
2014-01-09 12:31:48 +09:00
Andrew Tridgell b178ad7344 AP_OpticalFlow: updates for AP_HAL::MemberProc 2013-09-30 21:06:42 +10:00
Andrew Tridgell f53afaa5ac AP_OpticalFlow: use new scheduler API 2013-09-28 21:24:03 +10:00
Andrew Tridgell d64660739e AP_OpticalFlow: fixed example build 2013-09-24 11:57:14 +10:00
Andrew Tridgell 36ea705956 AP_OpticalFlow: fixed build with print() API change 2013-09-23 18:10:22 +10:00
Andrew Tridgell 97b7130bb9 libraries: update license header to GPLv3
we switched to GPLv3 a long time ago, but neglected to update the
per-file license headers
2013-08-30 13:01:39 +10:00