Commit Graph

37 Commits

Author SHA1 Message Date
Randy Mackay a517db4b5e AP_OpticalFlow: resolve compiler warning 2016-11-30 18:00:15 +09:00
Andrew Tridgell 06dfbc3e09 AP_OpticalFlow: added common driver for PX4Flow
used on Linux and NuttX boards
2016-11-28 08:26:57 +11:00
Andrew Tridgell 0be1b1aac2 AP_OpticalFlow: give access to AHRS from all backends 2016-11-28 08:26:56 +11:00
Andrew Tridgell 2e2f8ad8cf AP_OpticalFlow: added SITL flow driver as normal driver
move away from HAL_SITL embedded drivers
2016-11-28 08:26:56 +11:00
Andrew Tridgell 0889b25afa AP_OpticalFlow: initial code for Pixart optical flow chip 2016-11-28 08:26:56 +11:00
Julien Beraud d50fd3a6cd AP_OpticalFlow: fix onboard init
mistake in patch to avoid segfault which enabled
AP_OpticalFlow_Linux instead of AP_OpticalFlow_Onboard.
Store a reference to ahrs in order to execute init later, when
ahrs is initialized.
2016-11-21 16:38:59 -02:00
Julien Beraud dc86a53862 OpticalFlow: move onboard alloc to init()
No reason to keep it in the constructor
2016-11-16 20:38:00 +11:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
priseborough 1bde180f98 AP_OpticalFlow: Update parameter documentation
Add brief description of body frame conventions.
2016-10-27 14:54:45 +11:00
priseborough 9c7ab639a1 AP_OpticalFlow: Add parameters for flow sensor position offset 2016-10-27 14:54:41 +11:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
LukeMike 9f8b66758c VRBRAIN / AP_OpticalFlow: enabled OpticalFlow_PX4 for all VirtualRobotix boards 2016-08-07 20:31:51 +10:00
Lucas De Marchi 388a6683ad AP_OpticalFlow: fix optical flow initialization
This fixes the initialization for Linux boards using the PX4Flow module.
The problem is that after the conversion to use I2CDevice we now need to
use I2CDeviceManager, which is statically constructed after the vehicle
object.

So, if we try to call hal.i2c_mgr->get_device(), it will call the
get_device() method before the constructor is called and receive a
SIGSEGV:

Program received signal SIGSEGV, Segmentation fault.
0x000b06c0 in OpticalFlow::OpticalFlow (this=0x140914 <copter+4980>, ahrs=...)
    at ../../libraries/AP_OpticalFlow/OpticalFlow.cpp:54
54      ../../libraries/AP_OpticalFlow/OpticalFlow.cpp: No such file or directory.
2016-05-13 11:22:12 -03:00
Lucas De Marchi 6839ee4f37 AP_OpticalFlow: remove trailing whitespaces 2016-04-29 12:10:52 -03:00
Lucas De Marchi 5a52533084 AP_OpticalFlow: move bus definition to AP_HAL header 2016-04-29 12:10:21 -03:00
Ricardo de Almeida Gonzaga 46fb57fcf1 AP_OpticalFlow: use I2CDevice interface 2016-04-29 12:01:04 -03:00
mirkix d1babdb0fb AP_OpticalFlow: Enable optical flow onboard for BBBMINI 2016-02-08 08:52:10 -02:00
Ricardo de Almeida Gonzaga 7adbccac9a AP_HAL_Linux: add support for OpticalFlow to MinnowBoardMax
This commit adds support for OpticalFlow to MinnowBoardMax trying to
leave the OpticalFlow implementation as generic as it already is.

We had to add some format conversion and software crop to the cameras that
do not have this features.
2016-01-11 15:31:27 -02:00
Julien BERAUD c5cca02bc8 AP_OpticalFlow: Add support for onboard optflow
Onboard Optical flow needs to have access to the ahrs to get
correct gyro values.
Therefore the constructor takes the ahrs as a param like it is done
for other classes that need to have access to these datas
2015-12-18 17:56:05 +11:00
Caio Marcelo de Oliveira Filho 5b06924779 AP_OpticalFlow: use millis/micros/panic functions 2015-11-20 12:33:19 +09:00
Lucas De Marchi 5244559010 Minimize AP_Progmem.h includes
Most of AP_Progmem is already gone so we can stop including it in most
of the places. The only places that need it are the ones using
pgm_read_*() APIs.

In some cases the header needed to be added in the .cpp since it was
removed from the .h to reduce scope. In those cases the headers were
also reordered.
2015-10-30 14:35:32 +09:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09: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
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 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
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
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 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 cb4d5986e0 AP_OpticalFlow : Update PX4Flow interface
Interface now uses the integral of flow and body rates
2014-12-06 18:16:43 +11:00
Randy Mackay ec4581b35a OptFlow: add ground_distance_m 2014-10-15 16:35:48 +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