Commit Graph

503 Commits

Author SHA1 Message Date
Randy Mackay 85efab1ec8 AP_RangeFinder: reduce MaxsonarI2C update to 10hz 2018-05-24 13:37:03 +09:00
Randy Mackay fd2e5741ce AP_RangeFinder: MaxsonarI2C formatting fixes 2018-05-24 13:37:00 +09:00
Randy Mackay 3f749051d3 AP_RangeFinder: NMEA sonar driver 2018-05-24 12:46:38 +09:00
Michael du Breuil 7d6c3ec683 AP_RangeFinder: Make singleton 2018-05-16 23:21:41 +01:00
Michael du Breuil 9e551350a4 AP_RangeFinder: Remove unneeded state member 2018-05-16 23:21:41 +01:00
Dmitri Ranfft 8fa281fa5b RangeFinder: fixed a crash when VL53L0X was enabled in the software but not connected. 2018-05-07 11:47:39 +10:00
Peter Barker c627ed6ae3 RangeFinder: remove divide-by-zero possibility 2018-03-31 16:14:09 +09:00
Francisco Ferreira 146143ff2e AP_Rangefinder: adapt to new serial manager enum name
Lidar is now called Rangefinder
2018-02-28 08:04:16 +09:00
Francisco Ferreira 45531775cd AP_Rangefinder: support multiple serial rangefinders 2018-02-28 08:04:16 +09:00
Francisco Ferreira 5999421c72 AP_RangeFinder: uLanding now uses the Lidar protocol
uLanding was using a specific protocol in serial manager, but that's not needed and would break following work
As previously, baudrate is hardcoded
2018-02-28 08:04:16 +09:00
LukeMike 721f55e93c VRBRAIN / AP_RangeFinder: removed AP_RangeFinder_PX4_PWM for VR Brain boards 2018-02-05 08:26:49 +11:00
Pierre Kancir 6728598099 AP_Rangefinder: don't include Bebop rangefinder by default 2017-12-21 04:13:09 +00:00
Andrew Tridgell ffced7d591 AP_RangeFinder: removed create() method for objects
See discussion here:

  https://github.com/ArduPilot/ardupilot/issues/7331

we were getting some uninitialised variables. While it only showed up in
AP_SbusOut, it means we can't be sure it won't happen on other objects,
so safest to remove the approach

Thanks to assistance from Lucas, Peter and Francisco
2017-12-14 08:12:28 +11:00
Francisco Ferreira 02586b0a2e
AP_Rangefinder: search buses 0 and 1 for Maxbotix I2C driver 2017-10-09 11:57:02 +01:00
Francisco Ferreira bb46eaedaa
AP_Rangefinder: look in buses 0/1 when Lightware I2C bus isn't defined 2017-10-09 11:57:02 +01:00
Lucas De Marchi 72fd2d6f05 global: use static method to construct AP_SerialManager 2017-09-26 03:01:21 +01:00
Lucas De Marchi 9027a55696 global: use static method to construct RangeFinder 2017-09-26 03:01:21 +01:00
Lucas De Marchi 2e80b2e1d0 AP_RangeFinder: add static create method 2017-09-26 03:01:21 +01:00
davidaroyer cb270a9acf AP_RangeFinder: cleanup variable names in uLanding driver 2017-09-22 18:08:27 +01:00
davidaroyer 8284fb1093 AP_RangeFinder: update uLanding driver for new firmware data format 2017-09-22 18:08:27 +01:00
Lucas De Marchi 7b0d6166e1 AP_RangeFinder: use FALLTHROUGH define
When falling through on a case switch, allow to add an empty statement
with the correct attribute to tell the compiler this behavior is
intended.
2017-08-22 23:59:13 -07:00
Mateusz Sadowski eb56a010b3 AP_RangeFinder: TeraRangerI2C: use address from parameter instead of hardcoded 2017-08-15 19:42:10 +01:00
Mateusz Sadowski 0993300506 AP_Rangefinder: rename trone to TeraRangerI2C 2017-08-15 19:27:49 +01:00
Peter Barker 30c4ea8123 AP_RangeFinder: stop storing sensor type as a variable
And change method name
2017-08-15 18:58:16 +01:00
Peter Barker c0aa10d84b AP_RangeFinder: move rangefinder backend data accessors to backend 2017-08-15 18:30:45 +01:00
Peter Barker 127edce39e AP_RangeFinder: move prearm checks into backend 2017-08-09 13:58:53 +01:00
Peter Barker 0b1c67d170 AP_RangeFinder: remove unused parameters from detect and constructors 2017-08-09 13:58:53 +01:00
Peter Barker 08cd3f4a77 AP_RangeFinder: move instance parameters into instance state 2017-08-09 13:58:53 +01:00
Pierre Kancir ccbf281137 AP_RangeFinder: allow to set rangefinder type for mavlink 2017-06-22 16:17:58 +01:00
Francisco Ferreira a960c6526c
AP_Rangefinder: set type for VL53L0X 2017-06-08 01:32:11 +01:00
Pierre Kancir 8b38bd2e33 AP_RangeFinder: add sensor type to backend 2017-06-08 01:22:07 +01:00
Andrew Tridgell b29db0aa5b AP_RangeFinder: implement VL53L0X rangefinder 2017-06-07 23:05:01 +01:00
Dr.-Ing. Amilcar Do Carmo Lucas 78b7207ab4 AP_RangeFinder: Use SI units conventions in parameter units
Follow the rules from:
http://physics.nist.gov/cuu/Units/units.html
http://physics.nist.gov/cuu/Units/outside.html
and
http://physics.nist.gov/cuu/Units/checklist.html
one further constrain is that only printable (7bit) ASCII characters are allowed
2017-05-17 18:07:25 +10:00
murata 46cba2c970 libraries: Delete the setting value for specific editor. 2017-05-11 13:18:41 -07:00
Pierre Kancir 4a2b90b707 AP_Rangefinder: example fix travis warning
missing function declaration
implicit cast
some style fix
2017-04-13 19:56:16 +01:00
Grant Morphett 792bf70c40 RangeFinder: Fixed the value labels for LidarLite
LidarLiteV2 ---> LidarLiteV2-I2C
LidarLiteV3 ---> LidarLiteV3-I2C
2017-04-11 20:54:19 +09:00
Lucas De Marchi b17acfee12 Add aerofc support
Flight Controller board that comes on Intel Aero RTF Drone.
2017-03-24 12:06:19 +11:00
Andrew Tridgell 05cbc19ad6 AP_RangeFinder: added type 15 for LidareLiteV3 2017-03-01 22:44:37 +11:00
Randy Mackay c98e598ae2 AP_RangeFinder: fix example sketch 2017-02-27 15:18:08 +09:00
Randy Mackay e7dd21a0bb AP_RangeFinder: remove primary, add orientation 2017-02-27 15:18:03 +09:00
Andrew Tridgell df1da3c14e AP_RangeFinder: setup for split I2C transfers
this fixes PulsedLight Lidar on Linux
2017-02-23 22:38:15 -08:00
Jacob Walser d3442ae16b AP_RangeFinder: Bugfix for mavlink rangefinders to include out of range low/high 2017-02-21 11:26:14 +11:00
murata d9dbf6e1eb AP_OpticalFlow: Change from magic number 0 to definition name. 2017-02-18 14:12:36 +00:00
priseborough bf51da224a AP_RangeFinder: Update min value for RNGFND_GNDCLEAR parameter 2017-02-15 07:04:38 +09:00
murata 17c62ffe4c AP_RangeFinder: Unify from print or println to printf. 2017-01-27 18:20:22 +11:00
Andrew Tridgell 848c03650b AP_RangeFinder: removed old PX4 rangefinder drivers 2017-01-27 18:12:20 +11:00
Andrew Tridgell 3b42289475 AP_RangeFinder: added doc listing for TrOneI2C 2017-01-27 18:11:29 +11:00
Andrew Tridgell 683e549ed7 AP_RangeFinder: added WHOAMI and crc check
thanks to Francisco for review comments
2017-01-27 18:11:29 +11:00
Andrew Tridgell 68ff71e4c0 AP_RangeFinder: added trone in-tree driver 2017-01-27 18:11:29 +11:00
Julien Beraud b561837b41 RangeFinder_Bebop: Fix mode selection
mistakes in selecting mode
2017-01-17 09:34:25 -08:00
Julien Beraud 8a1f4e048f RangeFinder_Bebop: fix spi speed
Set spi speed. Else 0 will be sent at each transfer.
2017-01-17 09:34:25 -08:00
Lucas De Marchi 5472bc4de1 Global: change Device::PeriodicCb signature
Remove bool return as it's never being used and not supported on PX4.
2017-01-14 10:03:54 +11:00
Randy Mackay 8215b92371 AP_RangeFinder: MAV only accepts DISTANCE_SENSOR with orient 25
25 is  MAV_SENSOR_ROTATION_PITCH_270 meaning downward facing
2016-12-27 08:37:48 +09:00
Randy Mackay 0dd7e78c2b RangeFinder: fix to suppressing comment for case fall through
no functional change
eclipse stops complaining if no-break is used in place of fall-through
2016-12-14 13:22:31 +09:00
Jonathan Challinger 6e47bed97d AP_RangeFinder: fix hard fault with LightWareI2C 2016-12-07 07:52:38 +11:00
Francisco Ferreira 202c33491e RangeFinder: remove useless returns and update comment 2016-12-03 17:44:06 +00:00
murata a99bde9dad RangeFinder: Change type determination from if state to switch state. 2016-12-03 17:33:01 +00:00
ShingoMatsuura e9feb7bdda AP_RangeFilnder: moved the const buffer definition to the header and changed from '8' to 'sizeof(send_request_buffer)' 2016-11-23 10:28:38 -08:00
ShingoMatsuura f97ede9865 AP_RangeFilnder: change send_request_buffer member variable to const and other fixes 2016-11-23 10:28:38 -08:00
ShingoMatsuura e8ff156fa6 AP_RangeFilnder: add clear buffer at INIT state and change send_buffer to member variable to reduce CRC computation for sending request 2016-11-23 10:28:38 -08:00
ShingoMatsuura c1c643e56e AP_RangeFinder: remove clear buffer in send_request 2016-11-23 10:28:38 -08:00
Randy Mackay b7f95d9c25 AP_RangeFinder: remove serial.end and begin
Also some formatting changes
2016-11-21 14:07:01 +09:00
Randy Mackay 99fafcb495 RangeFinder: add uLanding to TYPE parameter description 2016-11-21 13:52:15 +09:00
Ricardo de Almeida Gonzaga 148fa03d6b AP_RangeFinder: support MaxBotix Serial rangefinders
This has been tested with LV-MaxSonar®-EZ1 MB1010
2016-11-21 11:21:56 +09:00
Randy Mackay 44c5fee90d AP_RangeFinder: formatting fixes for uLanding 2016-11-21 11:07:41 +09:00
davidaroyer 69bc4c42c9 AP_RangeFinder: Add support for Aerotenna uLanding radar altimeter 2016-11-21 11:07:41 +09:00
Andrew Tridgell 6c09758447 AP_RangeFinder: removed momentary spikes in PulsedLight I2C Lidar 2016-11-21 10:30:04 +11:00
Andrew Tridgell 5f3c14ea01 AP_RangeFinder: fixed tabs -> spaces 2016-11-12 14:18:15 +11:00
Andrew Tridgell 0c7dd99d7e AP_RangeFinder: support LidarLite V2 using in-tree driver
needs to run in continuous mode
2016-11-12 14:18:14 +11:00
Andrew Tridgell fd7b313e34 AP_RangeFinder: removed pwm_input_main
thanks to Francisco
2016-11-11 15:49:53 +11:00
Andrew Tridgell a69ff34c80 AP_RangeFinder: try bus 0 and 1 for PulsedLightI2C rangefinder 2016-11-11 15:49:53 +11:00
Andrew Tridgell 516141edf3 AP_RangeFinder: start PX4 rangefinder drivers on demand 2016-11-11 15:49:53 +11:00
Andrew Tridgell e88519364f AP_RangeFinder: fixed maxbotix I2C semaphore and bus usage 2016-11-09 17:08:02 +11:00
Andrew Tridgell 0b27478d7b AP_RangeFinder: use thread per bus for LightWareI2C driver 2016-11-09 17:07:55 +11:00
Lucas De Marchi 932d1ae244 AP_RangeFinder: add O_CLOEXEC in places missing it
By opening with O_CLOEXEC we make sure we don't leak the file descriptor
when we are exec'ing or calling out subprograms. Right now we currently
don't do it so there's no harm, but it's good practice in Linux to have
it.
2016-11-07 12:37:30 -03:00
Shingo Matsuura ceaa9474ed AP_RangeFinder: change enum name, add "state" word 2016-11-06 05:22:30 -08:00
Shingo Matsuura 4329cdbf2c AP_RangeFinder: change comment about fall through LEDDARONE_MODBUS_INIT case 2016-11-06 05:22:30 -08:00
Shingo Matsuura 3b8d36314c AP_RangeFinder: add comment about no break at LEDDARONE_MODBUS_INIT case 2016-11-06 05:22:30 -08:00
Shingo Matsuura 0eeca3ee0b AP_RangeFinder: remove case indent 2016-11-06 05:22:30 -08:00
Shingo Matsuura 4ca1eefd50 AP_RangeFinder: change magic numbers to define 2016-11-06 05:22:30 -08:00
Shingo Matsuura 6254787186 AP_RangeFinder: remove break in LEDDARONE_MODOBUS_INIT case and and use () around (read_len == 0) for clarity 2016-11-06 05:22:30 -08:00
Shingo Matsuura 5e5a806979 AP_RangeFinder: modified regarding to advices from @magicrub - san. 2016-11-06 05:22:30 -08:00
Shingo Matsuura 4b127edd5e AP_RangeFinder: fixed LeddarOne busy wait 2016-11-06 05:22:30 -08: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
Andrew Tridgell df23c4857e AP_RangeFinder: disabled LeddarOne driver
this driver is broken and could cause a vehicle to crash. It does busy
waits on a UART from the main thread.

It will be re-enabled when fixed
2016-10-31 13:40:49 +11:00
Peter Barker c1f455f904 AP_RangeFinder: correct parameter metadata 2016-10-27 09:15:03 -07:00
Andrew Tridgell 703ef0ca0e AP_RangeFinder: added get_primary() API 2016-10-27 15:45:07 +11:00
Andrew Tridgell 27cdf220de AP_RangeFinder: use const reference 2016-10-27 14:59:10 +11:00
priseborough f722ddf615 AP_RangeFinder: Update parameter documentation
Add brief description of body frame conventions.
2016-10-27 14:54:45 +11:00
priseborough 4499ed437c AP_RangeFinder: remove space before preprocessor directive 2016-10-27 14:54:44 +11:00
priseborough 3ca6c12344 AP_RangeFinder: Improve consistency of parameter naming 2016-10-27 14:54:44 +11:00
priseborough 24f9e7365d AP_RangeFinder: Add parameters defining 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
ShingoMatsuura 8432c5fb4a AP_RangeFinder: remove number_detections member variable and add number_detections reference argument to parse_response 2016-10-11 07:56:37 -03:00
ShingoMatsuura 43f2482abd AP_RangeFinder: modify spelling and change C type cast to static_cast 2016-10-11 07:56:37 -03:00
ShingoMatsuura 6123fad124 AP_RangeFinder: change error and ok status defines to LeddarOne_Status enum 2016-10-11 07:56:37 -03:00
Lucas De Marchi ae53920e5b build: don't build examples with old build system
We currently check examples are buildable with waf which doesn't need
the libraries to be specified in a make.inc file.  Having the makefiles
there is misleading since people try to build and realize the build is
broken.
2016-10-11 13:03:08 +11:00
murata d58c193c90 AP_RangeFinder: To define the OK status to LEDDARONE status. 2016-09-25 17:46:22 -07:00
murata 3a1cd20f11 AP_RangeFinder: To move to the place that use the variable definition for the first time. 2016-09-22 08:41:21 +09:00
Tom Pittenger 5512b6de02 AP_RangeFinder: Cleanup and added comments
- uart->available(); returns uint32 but was stored locally as int32 and treated as uint32. Now stored correctly as uint32
- some variables were set to zero at start of function, then reset to zero before being used. wasted work
2016-09-21 10:45:25 +09:00
Tom Pittenger e928e20b11 AP_RangeFinder: Ensure no divide by zeros in LeddarOne
Having a critical divide by value as a class member that could change external to the function using it is fragile. It was not very obvious that a divide by zero was not possible in the current design, now it's very obvious and safer in case the code changes later.
2016-09-21 10:45:23 +09:00
Randy Mackay f94f7e2aa0 AP_RangeFinder: add leddarone to TYPE parameter description
No functional change
2016-09-19 14:35:41 +09:00
ShingoMatsuura 3123bd6d7d AP_RangeFinder: add LeddarOne support 2016-09-19 13:25:35 +09:00
Peter Barker 2844190e5b AP_RangeFinder: correct DisplayName comments 2016-08-01 09:55:25 -03:00
Peter Barker 1bb73383ec AP_RangeFinder: group _ADDR with other first-rangefinder params 2016-08-01 09:55:24 -03:00
Peter Barker d5ffc8a863 AP_RangeFinder: define 3_ADDR when we have three rangefinders
Without this patch this field would only be defined when 4 rangefinders
were specified
2016-08-01 09:55:24 -03:00
Lucas De Marchi a159eedd8c AP_RangeFinder: fix bus for Lightware on some boards 2016-07-26 00:52:54 -03:00
Jonathan Challinger 4dfb277683 AP_RangeFinder: fix LightwareI2C conversion to I2CDevice 2016-07-26 00:52:54 -03:00
Lucas De Marchi 4ab1d7cf41 AP_RangeFinder: MaxsonarI2CXL: add some fixes
- coding style changes and some renames
   - fix bus number
   - use be16toh
2016-07-22 13:18:37 -03:00
Murilo Belluzzo f2d5eb9a97 AP_RangeFinder_MaxsonarI2CXL: Fix driver after I2CDevice conversion
* Simplify semaphore releasing logic
* Fix typo
2016-07-22 13:18:37 -03:00
Luiz Ywata c167364fa0 AP_RangeFinder: MaxsonarI2CXL: use I2CDevice interface 2016-07-22 13:18:37 -03:00
Lucas De Marchi ae259bc563 AP_RangeFinder: LightWareI2C: allow detect method to fail
If bus isn't found, allow the detect() method to fail.
2016-07-22 13:18:37 -03:00
Lucas De Marchi 0193517f30 AP_RangeFinder: LightWareI2C: use be16toh
While at it remove some trailing whitespaces and little reformats.
2016-07-22 13:18:36 -03:00
Murilo Belluzzo 66fdfbb850 AP_RangeFinder_LightWareI2C: Fix driver after I2CDevice conversion
* Fix semaphore not being released in ::get_reading
* Simplify semaphore releasing logic
* Fix typo
2016-07-22 13:18:36 -03:00
Luiz Ywata 49d1520850 AP_RangeFinder: LightWareI2C: use I2CDevice interface 2016-07-22 13:18:36 -03:00
Lucas De Marchi a372f33cc0 AP_RangeFinder: fix PulsedLightLRF detection
- Most of the boards use bus 1 for first I2C
    - If the bus doesn't exist, let the detect() method fail when it
      call start_reading(), because _dev would be invalid
2016-07-22 13:18:36 -03:00
Lucas De Marchi d653139c5d AP_RangeFinder: PulsedLightLRF: use be16toh 2016-07-22 13:10:51 -03:00
Lucas De Marchi c8094e2593 AP_RangeFinder: PulsedLightLRF: fix coding style
- sort headers
    - fix constructor
2016-07-22 13:10:51 -03:00
Murilo Belluzzo 0dc33410ff AP_RangeFinder_PulsedLightLRF: Fix driver after I2CDevice conversion
* Fix wrong semaphore->take check in ::get_reading
* Simplify semaphore releasing
* Fix typos and trailing whitespace
2016-07-22 13:10:51 -03:00
Luiz Ywata e1342eb533 AP_RangeFinder: PulsedLightLRF: use I2CDevice interface 2016-07-22 13:10:51 -03:00
Luiz Ywata a7fddc0594 AP_RangeFinder: add method _add_backend()
Wrapper method that saves a detected driver
2016-07-22 13:10:51 -03:00
Andrew Tridgell e0047d81a2 AP_RangeFinder: enable sonar on Disco 2016-07-20 13:38:18 +10:00
Andrew Tridgell 50958bc026 AP_RangeFinder: fixed typo 2016-07-01 15:35:39 +10:00
Ricardo de Almeida Gonzaga 2ee6a85e67 AP_RangeFinder: Fix typos 2016-05-13 19:20:05 -03:00
Randy Mackay 53785d1f72 AP_RangeFinder: add Bebop and MAVLink types
Thanks OXINARF!
2016-05-04 15:00:48 +09:00
Randy Mackay 96f665061e AP_RangeFinder: call handle_msg for all backends 2016-05-04 12:10:58 +09:00
Randy Mackay 9b940687c1 AP_RangeFinder: rename CompanionComputer files to MAVLink 2016-05-04 12:10:58 +09:00
Randy Mackay c541cb27f8 AP_RangeFinder: rename CompanionComputer to MAVLink 2016-05-04 12:10:58 +09:00
Allan Matthew d3831e4a5d RangeFinder: add MAVLink rangefinder 2016-05-04 12:10:58 +09:00
Julien Beraud 33a699f29c AP_RangeFinder: Add support for bebop Rangefinder
This rangefinder uses an spi device to send pulses and an iio driver
in buffer mode to get data
The data is then analyzed and the maximum pulse received is considered to
represent the echo of the pulses that have been sent. The distance in time
between the pulse that is sent and the pulse with the maximum amplitude
is used to calculate the altitude based on the speed of sound.

There is a dependency with libiio, and in order to build, there is a need
to provide a rootfs that includes libiio.a.
The other solution is to build dynamically after having updated the rootfs
to use on compiled with a more recent toolchain and include libiio
2016-05-03 16:43:39 -03:00
Ricardo de Almeida Gonzaga 5bd034a5a8 Global: start using cmath instead of math.h 2016-04-05 21:06:19 -07:00
Tom Pittenger 6718241dad cleanup comments 2016-03-29 05:32:28 -07:00
Lucas De Marchi f6712c8bc4 AP_RangeFinder: replace header guard with pragma once 2016-03-16 18:40:43 +11:00
Tom Pittenger b1ea82079e AP_Rangefinder: compiler warning float to double on atof()
- this is horribly inefficient so better to change the parsing
2016-02-29 10:26:31 -08:00
Tom Pittenger 786d14cd3c AP_RangeFinder: For LightWareSerial, write 'd' to support more devices 2016-02-14 16:05:50 -08:00
Gustavo Jose de Sousa c2e3f05dbf waf: ardupilotwaf: prefix build context methods with ap_
It helps to distinguish between things from waf and things from ardupilotwaf.
2016-01-22 20:10:29 -02:00
Gustavo Jose de Sousa 3d22490397 waf: examples: use methods from bld instead of ardupilotwaf 2016-01-22 20:10:29 -02:00
mirkix 2d9b230be1 AP_RangeFinder: Load .data section for HC-SR04 PRU driver used by BBBMINI
This adds .data section loading to the HC-SR04 range finder driver used by
BBBMINI. The firmware is running inside a PRU. It is necessary to develop more
complex driver software inside the PRU.
2016-01-21 14:02: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
Jonathan Challinger 780d0de4bb AP_RangeFinder: fix example 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
Lucas De Marchi fb24056ca9 AP_RangeFinder: remove unused AP_ADC_AnalogSource 2015-12-03 13:32:44 +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
Caio Marcelo de Oliveira Filho 82a14b183d AP_RangeFinder: use millis/micros/panic functions 2015-11-20 12:34:10 +09:00
Lucas De Marchi 8d86d79c0b AP_RangeFinder: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:13 +11:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +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
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Caio Marcelo de Oliveira Filho 5d2279a554 AP_RangeFinder: remove unnecessary includes from example 2015-10-21 09:16:11 +11:00
Caio Marcelo de Oliveira Filho 6566deff66 AP_RangeFinder: fix compilation for Linux/SITL
Add libraries that those boards depend on. This should be handled in the
future elsewhere (and once for each board), but for now let's make it
compile again.
2015-10-21 09:16:11 +11:00
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
Randy Mackay 2deaf5280e RangeFinder: add User to param descriptions
First sensor appears in standard list, second in advanced
2015-10-07 14:10:24 +09:00
Andrew Tridgell 5800f0c884 AP_RangeFinder: default to two rangefinders
and fixed documentation strings for rangefinder 3 and 4 if enabled
2015-09-22 09:04:47 +10:00
Andrew Tridgell 8538aa9840 AP_Rangefinder: allow for up to 4 rangefinders 2015-09-13 11:29:56 +10:00
Andrew Tridgell 6afb3895c0 AP_RangeFinder: added doc strings for new rangefinder types 2015-09-08 16:46:52 +10:00
Andrew Tridgell 7d30ce2e36 AP_RangeFinder: added lightware serial rangefinder 2015-09-08 16:46:52 +10:00
Grant Morphett bec21a51a4 AP_RangeFinder: Just fixing the parameter name in the description 2015-09-07 17:48:37 +09:00
Andrew Tridgell dff235dc36 AP_RangeFinder: support LightWare I2C laser rangefinders
this has been tested with the SF10/C
2015-09-01 21:09:12 +10:00
Gustavo Jose de Sousa 5d39587469 AP_RangeFinder: 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:23 +10:00
mirkix 1b0f482d37 AP_RangeFinder: Add support for HC-SR04 Range Finder connected to BBB 2015-07-07 08:00:33 +10:00
Andrew Tridgell 2167675b3d AP_RangeFinder: update for upstream merge 2015-06-09 19:44:20 +10:00
Randy Mackay d366c30358 AP_RangeFinder: fix potential out-of-bounds read
Issue found by Coverity
2015-06-08 14:46:21 +09:00
Randy Mackay ac76562638 RangeFinder: init state and drivers
resolves a coverity defect
2015-06-08 14:46:14 +09:00
Andrew Tridgell b2fb2c676e AP_RangeFinder: convert example from .pde to .cpp 2015-06-01 17:07:06 +10:00
Tom Pittenger 6acd92be1e AP_RangeFinder: compiler warnings: compare signed to unsigned 2015-05-05 13:27:02 +10:00
Andrew Tridgell ac43972883 AP_RangeFinder: fix for HAL_SITL rename 2015-05-05 09:45:56 +10:00
Andrew Tridgell 4c4a4f9ea5 AP_RangeFinder: fixed cm to meter comparison
thanks to EShamaev for this fix (see PR #1352)
2015-04-30 11:26:36 +10:00
Tom Pittenger 5ead138917 RangeFinder: fix compile warnings re float constants 2015-04-24 14:04:10 +09:00
Randy Mackay a01fb64f12 RangeFinder: fix example sketch 2015-04-24 10:57:25 +09:00
Randy Mackay 715da653c3 RangeFinder_Analog: set status 2015-04-24 10:57:23 +09:00
Randy Mackay fadfa70e99 RangeFinder_MaxSonar: set status 2015-04-24 10:57:21 +09:00
Randy Mackay e212ebb0d0 RangeFinder_PulsedLight: set status 2015-04-24 10:57:19 +09:00
Randy Mackay aa04bef5af RangeFinder_PX4: set status and consume out of range samples 2015-04-24 10:57:16 +09:00
Randy Mackay 71de0ab815 RangeFinder_PX4_PWM: set status and consume out of range samples 2015-04-24 10:57:12 +09:00
Randy Mackay 7663b8eade RangeFinder: replace healthy with status and no_data methods 2015-04-24 10:57:10 +09:00
Randy Mackay 8ed6207ca8 RangeFinder: add pre-arm checks 2015-04-24 10:57:05 +09:00
Randy Mackay f1cbd1f03b RangeFinder: add ground clearance parameter 2015-04-24 10:57:03 +09:00
Andrew Tridgell 389148ac54 AP_RangeFinder: use RNGFND_OFFSET for distance offset in PWM and I2C 2015-04-04 17:03:00 -07:00
Andrew Tridgell 9c0614c7bb AP_RangeFinder: default test to I2C Lidar 2015-03-15 13:50:59 +11:00
Andrew Tridgell a6d76b4e03 AP_RangeFinder: added PX4-PWM rangefinder
uses PWM input driver to read a rangefinder
2015-02-23 14:15:14 +11:00
Andrew Tridgell 38d63d51a5 AP_RangeFinder: change for new PX4 device paths 2015-02-14 12:25:44 +11:00
Emile Castelnuovo 3e97592e5c AP_Rangefinder: added #if for VRBRAIN boards. 2015-02-02 08:43:59 +11:00
Emile Castelnuovo c38b11eec8 AP_RangeFinder: added VRBRAIN to use PX4 libraries 2015-02-02 08:43:59 +11:00
Emile Castelnuovo b0b892e578 AP_Rangefinder: added support for VRBRAIN boards 2015-02-02 08:43:59 +11:00
Randy Mackay d5f02ec0df RangeFinder: fix example sketch 2015-01-28 17:15:50 +09:00
Randy Mackay 01c669ee15 RangeFinder: minor param description update
Also initialise primary instance to 0.
No functional change.
2015-01-22 14:40:16 +09:00
Andrew Tridgell 2eeec3fabe AP_RangeFinder: fixed oversized parameter RNGFND2_SETTLE_MS 2014-11-10 08:09:41 +11:00
Randy Mackay 41a6393356 RangeFinder: PulsedLight I2C addr to 0x62 2014-10-24 15:08:04 +09:00
Andrew Tridgell 3c7cc5f40c AP_RangeFinder: auto-update PX4 ll40ls max/min distance
this allows the range of the Lidar to be set by the user using
RNGFND_MAX_CM and RNGFND_MIN_CM
2014-10-13 19:07:38 +11:00
Andrew Tridgell 70ca87c4e6 AP_RangeFinder: handle all I2C rangefinder types on PX4 in PX4Firmware 2014-10-09 11:06:16 +11:00
Randy Mackay b3bbec24e4 RangeFinder: TYPE param description to PX4-I2C 2014-10-02 20:24:14 +09:00
Randy Mackay 8ce4893180 RangeFinder: TYPE param description to PX4-MaxbotixI2C
This hopefully reduces confusion for PX4/Pixhawk users with MaxBotix I2C
sonar
2014-10-02 16:49:15 +09:00
Andrew Tridgell 43e8b36e5b AP_RangeFinder: removed use of hrt_absolute_time() 2014-08-20 09:10:25 +10:00
Andrew Tridgell b38c9544f9 AP_RangeFinder: make values clearer for APM2 2014-08-15 20:28:22 +10:00
Andrew Tridgell 8540174854 AP_Rangefinder: fixed example build 2014-08-13 21:48:36 +10:00
akdslr a404404806 AP_RangeFinder: Added a call to sonar.update in RFIND_test 2014-08-04 22:13:16 +10:00
Andrew Tridgell 7bf72d1c2b AP_RangeFinder: fixed example build 2014-07-25 17:55:11 +10:00
akdslr 2c86f5df94 AP_RangeFinder: Updated RFIND_test example to not use Auto and added more device details 2014-07-24 14:41:55 +10:00
akdslr a1861125e6 AP_RangeFinder_PulsedLightLRF: Modified to do a 2 byte transfer for the distance read 2014-07-24 14:41:54 +10:00
akdslr b08e3d0ee4 AP_RangeFinder_PX4: Added the destructor to close the file descriptor 2014-07-24 14:41:54 +10:00
akdslr 54d0db863b AP_RangeFinder: Changed sonar to rangefinder in the parameter descriptions 2014-07-24 14:41:54 +10:00
akdslr 8c6718fe2d AP_RangeFinder: Removed the use of type Auto 2014-07-24 14:41:54 +10:00
Andrew Tridgell c45f1961f6 AP_RangeFinder: removed old test code 2014-07-21 09:39:48 +10:00
Andrew Tridgell fe92ef5c32 AP_RangeFinder: added an example program 2014-07-21 09:39:12 +10:00
Andrew Tridgell fe475a3561 AP_RangeFinder: removed old PulsedLightLRF example 2014-07-14 10:43:17 +10:00
Andrew Tridgell 5d6ef45662 AP_RangeFinder: removed old MaxSonarXL example 2014-07-14 10:42:20 +10:00
Andrew Tridgell c425e7e060 AP_RangeFinder: fixed example build 2014-07-14 10:41:28 +10:00
Andrew Tridgell baa0217bec AP_RangeFinder: trigger a new reading automatically
this fixes Maxbotix I2C
2014-07-08 16:28:18 +10:00
Andrew Tridgell f6d9bc5d7e AP_RangeFinder: fixed detection of multiple types
Pair-Programmed-With: Allyson Kreft
2014-07-08 15:08:18 +10:00
Andrew Tridgell 9386295428 AP_RangeFinder: added SONAR2_TYPE parameter
thanks to Allyson for noticing
2014-07-08 15:08:18 +10:00
Andrew Tridgell 05d4f5fb5a AP_RangeFinder: convert PX4 driver to new API 2014-07-08 15:08:18 +10:00
Andrew Tridgell 4cba48ade2 AP_RangeFinder: removed old style analog drivers
replaced by generic analog driver
2014-07-08 15:07:51 +10:00
Andrew Tridgell ed346fd639 AP_RangeFinder: convert MaxbotixI2C driver to new API 2014-07-08 15:07:51 +10:00
Andrew Tridgell 0063d83dbc AP_RangeFinder: convert the PulsedLight driver to new API
not tested yet
2014-07-08 15:07:50 +10:00
Andrew Tridgell 22b9059647 AP_RangeFinder: have two instances on all platforms
rover needs two sonars for obstacle avoidance
2014-07-08 15:07:50 +10:00
Andrew Tridgell 6f33ca4988 AP_RangeFinder: added SONAR_RMETRIC option
this allows correct support for non-ratiometric rangefinders such as
the SF/02
2014-07-08 15:07:50 +10:00
Andrew Tridgell 92b76b4be4 AP_RangeFinder: converted analog rangefinder backend to new API
this gets analog rangefinders of all types working
2014-07-08 15:07:50 +10:00
Andrew Tridgell cb037f3416 AP_RangeFinder: new rangefinder API ready for its first backend
the backends are setup to have just the minimum functionality needed
for a rangefinder, with all of the higher level logic in the
frontend. This should make writing a new backend easier
2014-07-08 15:07:50 +10:00
Andrew Tridgell 429431157b AP_RangeFinder: disable old rangefinder drivers
these will be re-enabled when they are converted to the new class API
2014-07-08 15:07:50 +10:00
akdslr d759a9dd9b AP_RangeFinder: Seperated the Backend driver functionality into a separate class 2014-07-08 15:07:49 +10:00
akdslr 3f17969b19 AP_RangeFinder: Changes from the May 4th plane test flight 2014-07-08 15:07:49 +10:00
akdslr 2e586ccfb2 AP_RangeFinder_PulsedLightLRF: Updated the value to write to the register to trigger a measurement 2014-07-08 15:07:49 +10:00
akdslr 5f4168d5f8 AP_RangeFinder_PX4_test: Added an example sketch for the PX4 range finder 2014-07-08 15:07:49 +10:00
akdslr 18c06277f8 AP_RangeFinder: Added a new PX4 range finder and modified the RangeFinder parent class to support having multiple devices simultaneously 2014-07-08 15:07:49 +10:00
akdslr a2df275bd9 AP_RangeFinder_PulsedLightLRF: Updated the register definitions for the new hardware 2014-07-08 15:07:49 +10:00
Randy Mackay 4c38999ca6 Maxsonar Test: remove raw from output to user 2014-02-10 15:00:08 +09:00
Randy Mackay e1fabadd3c MaxsonarI2C: read method returns int16_t 2014-02-10 14:59:46 +09:00
Randy Mackay ab22d11110 MaxsonarRFinder: convert_raw returns int16_t 2014-02-10 14:59:27 +09:00
Randy Mackay 32820b4260 PulsedLightRFinder: read method returns int16_t 2014-02-10 14:58:27 +09:00
Randy Mackay bf3fa8b99b RangeFinder: remove raw_value from SharpGP2Y 2014-02-10 14:57:17 +09:00
Randy Mackay 8d54e50897 RangeFinder: remove raw_value, orientation variables
This saves 10bytes of RAM
2014-02-10 14:56:52 +09:00
Randy Mackay e54bf3e87c RangeFinder: reduce PulsedLight max distance
Reduced from 25m to 14m
2013-12-03 20:26:23 +09:00
Randy Mackay 3970c8f038 RangeFinder: add PulsedLight example sketch 2013-12-02 20:06:49 +09:00
Randy Mackay e88251f7e1 RangeFinder: add PulsedLight LRF 2013-12-02 20:06:43 +09:00
Andrew Tridgell 72b97168c9 AP_RangeFinder: improved SONAR_PIN docs 2013-10-14 10:03:52 +11: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
Andrew Tridgell e69e4a5695 AP_RangeFinder: fixed indent-tabs-mode 2013-05-30 09:51:11 +10:00
Andrew Tridgell cec08be9cb AP_Rangefinder: use ratiometric analog input for analog sonar 2013-05-13 15:13:43 +10:00
Andrew Tridgell 223dfe4de5 AP_Rangefinder: added units for settle time 2013-05-08 14:21:32 +10:00
Andrew Tridgell 0e66bac70b AP_RangeFinder: removed special case for APM1
the airspeed port doesn't have enough power for the sonar anyway
2013-05-03 10:09:54 +10:00
Andrew Tridgell 09ca9d4283 AP_Rangefinder_analog: implement settle time and stop_pin 2013-05-03 09:45:19 +10:00
Andrew Tridgell ba83950fc4 libraries: replace constrain() with constrain_float()
this makes the type much more obvious. Thanks to Tobias for the
suggestion.
2013-05-02 10:25:40 +10:00
Andrew Tridgell 5df4796b9a RangeFinder: fixed a warning 2013-04-17 21:33:08 +10:00
Andrew Tridgell 91bbf914f7 RangeFinder: added SONAR_ENABLE boolean to analog sonar object 2013-03-22 07:52:51 +11:00
Christopher Hrabia 744f610409 RangeFinder_I2C: fixed bug with interchanged min max values
- add usage of mode-filter and min-max constrain, similar to MaxsonarXL
2013-03-18 14:28:31 +09:00
Andrew Tridgell 2fc922a251 AP_Rangefinder: use voltage_average() interface for generic analog rangefinder 2013-03-08 08:27:18 +11:00
Andrew Tridgell e4fb54fcc9 RangeFinder: added new AP_RangeFinder_analog
this is a generic analog rangefinder, supporting 3 types of functions
between voltage and distance.
2013-03-01 11:19:02 +11:00
James Bielman 5631f865b2 Update floating point calculations to use floats instead of doubles.
- Allows use of hardware floating point on the Cortex-M4.
- Added "f" suffix to floating point literals.
- Call floating point versions of stdlib math functions.
2013-01-16 13:52:01 +11:00