Commit Graph

626 Commits

Author SHA1 Message Date
Michael du Breuil
d92c4dc892 AP_Rangefinder: Fix bad subgroup pointer for drivers 2020-01-15 12:13:44 +11:00
Rishabh
fd2c6baf5d AP_RangeFinder: added RNGFNDx_TYPE parameter description for the Lanbao lidar 2020-01-13 20:34:48 +11:00
Michael du Breuil
8bd4f2b097 AP_RangeFinder: Allow the VL53L1X to be put into short range mode 2019-12-24 11:40:47 +11:00
Michael du Breuil
224ea744e3 AP_Rangefinder: Reset the VL53L1X before setup
A number of the config steps make the assumption they are running from
the sensors default power on state. If you do a soft reset of the
vehicle without killing power to the sensor this means the second time
you configure the sensor you will start from a state which didn't match
the base assumptions and can lead to the sensor preforming signficantly
differently then it was intended to. This issues a soft reset, and waits
for it to reboot before proceeding with configuration. If it's a
watchdog reset we don't want to spend long enough to have ensured the
sensor reset, so we say the sensor setup completely failed and don't use
it, as not using it will be less erroneous then using a misconfigured
sensor.
2019-12-24 11:40:47 +11:00
Randy Mackay
e12e0d95ae AP_RangeFinder: remove param conversion for 3rd and 4th
3rd and 4th instances were not available to users unless they used their own builds which is rare
this reduces the firmware's flash size a small amount
2019-12-03 13:06:10 +08:00
Randy Mackay
1b84c8132e AP_RangeFinder: param conversion fix
This resolves an issue with the parameter conversion when moving from Copter-3.6.x to 4.0 (and similar moves for other vehicle types)
2019-12-03 13:06:10 +08:00
Randy Mackay
0844077df8 AP_RangeFinder: TYPE param desc clarification for Benewake lidar
This renames some of the TYPE parameter's driver options:

19 :BenewakeTF02 is unchanged
20: BenewakeTFMini becomes BenewakeTFMini/Plus-Serial
25: BenewakeTFMiniPlus becomes BenewakeTFMini/Plus-I2C
27: BenewakeTF03 is unchanged
2019-11-13 10:28:17 +08:00
Randy Mackay
ae8f9a70d0 AP_RangeFinder: update Type and Pin parameter values
The _TYPE change is to remove the "v2" from the LidarLite description because both v2 and v3 are supported
The _PIN change is to make it more clear that any of the auxiliary pwm pins can be used for PWM input
2019-11-12 07:30:55 +08:00
Peter Barker
35e987c663 AP_RangeFinder: adjust for renaming of RangeFinder files 2019-11-12 07:14:37 +08:00
Peter Barker
7c9ab0203d AP_RangeFinder: rename source files to include AP_ prefix
This makes them look like most of our libraries
2019-11-12 07:14:37 +08:00
Peter Barker
b1f8982292 AP_RangeFinder: remove old AP_RangeFinder.h
Making way to move the actual header into place
2019-11-12 07:14:37 +08:00
Peter Barker
d0e62b0e0b AP_RangeFinder: serial subclasses rely on base class for update() 2019-11-09 08:01:53 +11:00
Peter Barker
60cbefc1ae AP_RangeFinder: move update function to serial base class 2019-11-09 08:01:53 +11:00
Peter Barker
b18f1a8e22 AP_RangeFinder: move uLanding to using common serial backend 2019-11-09 08:01:53 +11:00
Peter Barker
9829a1d08b AP_RangeFinder: move wasp to using common serial backend 2019-11-09 08:01:53 +11:00
Peter Barker
62f2f3e19e AP_RangeFinder: factor constructor, use to move Lanbao to serial baseclass 2019-11-09 08:01:53 +11:00
Peter Barker
acc1f955ef AP_RangeFinder: make Benewake backend use new intermediate class 2019-11-09 08:01:53 +11:00
Peter Barker
0246dd990e AP_RangeFinder: make MaxsonarSerialLV backend use new intermediate class 2019-11-09 08:01:53 +11:00
Peter Barker
ff7c5af437 AP_RangeFinder: make LeddarOne backend use new intermediate class 2019-11-09 08:01:53 +11:00
Peter Barker
15d3a59d67 AP_RangeFinder: make NMEA backend use new intermediate class 2019-11-09 08:01:53 +11:00
Peter Barker
82268ab12c AP_RangeFinder: make BLPing backend use new intermediate class 2019-11-09 08:01:53 +11:00
Peter Barker
692c89a972 AP_RangeFinder: make LightWareSerial backend use new intermediate class 2019-11-09 08:01:53 +11:00
Peter Barker
3538fe360b AP_RangeFinder: add intermediate serial backend class to share common code 2019-11-09 08:01:53 +11:00
Peter Barker
82db4383d4 AP_RangeFinder: use enum-class for Status 2019-11-09 08:01:53 +11:00
Peter Barker
1989decbc1 AP_RangeFinder: use enum-class for RangeFinder function 2019-11-09 08:01:53 +11:00
Peter Barker
db36ef3433 Sub: use enum-class for RangeFinder type 2019-11-09 08:01:53 +11:00
Peter Barker
ea26e94f66 AP_RangeFinder: use enum-class for RangeFinder type 2019-11-09 08:01:53 +11:00
Andrew Tridgell
76dd2f0838 AP_RangeFinder: fixed failover between rangefinders
this fixes the case where we have one rangefinder that can handle
short range and another that is good for long range but no good for
short range (quite common, eg radar and lidar)

If possible we want to use the first rangefinder that is in range for
the right orientation. If none are in range then use the first for the
orientation
2019-10-28 21:13:18 +11:00
Andrew Tridgell
5898dc757c AP_RangeFinder: use single precision string to float 2019-10-28 15:53:16 +11:00
Andrew Tridgell
2818151a39 AP_RangeFinder: disable some incompatible drivers for AP_Periph 2019-10-25 09:35:27 +11:00
Andrew Tridgell
ca1bd8be3c AP_RangeFinder: disable logging for AP_Periph 2019-10-21 19:12:01 +11:00
Andrew Tridgell
282936eab2 AP_RangeFinder: allow for less rangefinder instances
for AP_Periph
2019-10-21 19:12:01 +11:00
murata
000aa4f515 AP_RangeFinder: Add TF03-180 2019-10-15 10:07:53 +09:00
Lucas De Marchi
7520cdef2f AP_RangeFinder: update minimum fw version of TFMiniPlus
Version 2.0.3 has important fixes to avoid having the sensor to lock up.
Let's make sure we check for it and warn on console.
2019-09-23 12:56:13 +09:00
Lucas De Marchi
5f65033511 AP_RangeFinder: add missing overrides 2019-09-21 08:01:08 +10:00
Lucas De Marchi
ce877ba40a AP_RangeFinder: fix build 2019-09-21 08:01:08 +10:00
Andrew Tridgell
54b9524c0b AP_RangeFinder: make LightWare I2C native work with more hw versions
this allows the native i2c lightware driver to work with a wide range
of lidars from LightWare, removing the specific version check, and the
version specific config commands
2019-09-12 07:40:32 +10:00
Michael du Breuil
c12652b325 AP_Rangefinder: Remove stop pin usage 2019-09-04 09:54:50 +10:00
Andrew Tridgell
9c900c7176 AP_RangeFinder: added driver for Lanbao CM8JL65 2019-09-03 09:10:48 +10:00
Andrew Tridgell
172c802ffa AP_RangeFinder: support native I2C protocol on LightWare Lidars
this supports both the native and the legacy I2C protocol for
LightWare Lidars. The native protocol is a string based protocol that
is enabled by default on new Lidars. By supporting both protocols we
avoid the need for users to re-configure their new lidar using a
serial cable before using it on I2C.

This driver was originally written by Mitch Koch and Jonathan
Challinger, and ported to master by me (it required only minor
changes)
2019-09-02 07:20:22 +10:00
murata
4754710e60 RangeFinder: Change to coding style (NFC)
RangeFinder: RangeFinder: Change to coding style (NFC)
2019-08-23 10:11:30 +09:00
murata
851ee24c99 AP_RangeFinder: Clarify the purpose of input registers 2019-08-20 14:36:29 +01:00
murata
0b1987ae36 AP_RangeFinder: Use common hexadecimal to character number conversion method 2019-08-06 10:14:12 +10:00
Randy Mackay
01a713a812 AP_RangeFinder: param desc rename from PX4-PWM to just PWM
the PWM driver is available for many boards
2019-08-04 21:15:49 +10:00
Andrew Tridgell
0f6b8375bb AP_RangeFinder: added a 1.5 delay to probe of LW20 I2C
the LW20 takes a long time to boot and be ready to probe
2019-07-30 13:32:36 +10:00
Michael du Breuil
3202a2e0a6 AP_Rangefinder: Add arming checks 2019-07-30 10:42:16 +10:00
Randy Mackay
84b502b0c4 AP_RangeFinder: resolve gcs::send_text compiler warning 2019-07-30 09:02:39 +09:00
Randy Mackay
480a3ebb03 AP_RangeFinder: LightwareSerial driver handles invalid distances
reports the longer of 100m or RNGFNDx_MAX_CM+1m
2019-07-30 08:05:35 +09:00
Pierre Kancir
c4ec373b20 AP_RangeFinder: pass mavlink_message_t by const reference 2019-07-16 20:51:42 +10:00
Peter Barker
ac96461c6c AP_RangeFinder: use AP_SerialManager singleton 2019-07-16 09:29:48 +10:00
murata
d7b2271197 AP_RangeFinder: Common modbus crc method 2019-07-12 15:33:21 +10:00
Pierre Kancir
209b0300a5 AP_Rangefinder: fix compilation for Bebop 2019-06-14 18:56:05 -07:00
Peter Barker
68d7e0c22f AP_RangeFinder: correct macro being used for parameter definition 2019-06-11 12:47:56 +10:00
Peter Barker
8cd5e3103f AP_RangeFinder: remove use of removed AP_PARAM_FLAG_IGNORE_ENABLE 2019-06-11 11:38:10 +09:00
Peter Barker
4c88a1e9de AP_RangeFinder: remove dangling update_instance declaration 2019-06-04 19:36:57 +09:00
Tatsuya Yamaguchi
18a43601cd RangeFinder: Add up to 10 RangeFinder logs 2019-06-04 19:11:11 +10:00
Lucas De Marchi
4f73881c4b AP_RangeFinder: TFMiniPlus: enforce minimum version 1.7.6
On this version of the firmware the command changed - support the new
command and only that one: it's not expected to have devices with the
older versions.
2019-05-24 01:47:04 -07:00
Lucas De Marchi
b3a8496613 AP_RangeFinder: add support for Benewake TFMini Plus on I2C
This was tested with firmware 1.7.0 on the sensor.
2019-05-24 01:47:04 -07:00
alancaro2013
a1557184d5 AP_RangeFinder: Modified uLanding parse to check device version.
US-D1 version ID was changed to 2 from 0. This alteration will prevent
past US-D1s, with version ID 0, from being 3-byte parsed.
2019-05-22 08:20:42 +10:00
Peter Barker
93c33fda1d RangeFinder: correct bad include of old semaphore library 2019-05-15 19:34:31 +09:00
Siddharth Purohit
479c238177 RangeFinder: add support for rangefinder sensor over can 2019-05-15 16:01:53 +09:00
Andrew Tridgell
09792d3056 AP_RangeFinder: removed unusued AP_Common/Semaphore.h 2019-05-15 15:33:48 +10:00
Michael du Breuil
85da4955b6 AP_Rangefinder: Enforce checking I2C status on VL53L1X 2019-05-05 12:12:05 -07:00
Michael du Breuil
b31cd1adb5 AP_RangeFinder: Remove pre arm distance check 2019-04-16 11:00:32 +09:00
Michael du Breuil
6dd05db3b7 AP_Rangefinder: Fix VL53L1X ignoring return status 2019-04-12 17:23:19 +10:00
murata
49b0a00182 AP_RangeFinder: Delete unnecessary judgment 2019-04-11 06:11:47 -07:00
Peter Barker
dd567ad18a AP_RangeFinder: handle RFND logging 2019-04-09 22:17:58 +10:00
Adolfo
428d4d4574 AP_RangeFinder: fixed TeraRangerI2C refresh rate and status 2019-04-09 12:22:19 +10:00
Randy Mackay
5e9aebd678 AP_RangeFinder: BlueRobotics Ping driver 2019-04-08 09:43:41 +09:00
Randy Mackay
65966ac957 AP_RangeFinder: add LidarLitev3HP and PWM to TYPE param desc 2019-04-08 09:43:41 +09:00
Michael du Breuil
21b64ad19b AP_Rangefinder: Remove parameter manipulation from initializer 2019-04-06 09:15:22 +11:00
Michael du Breuil
49d20d4b4f AP_Rangefinder: Remove unused AP_Math header 2019-04-05 20:12:53 +11:00
Pierre Kancir
37d121ae02 AP_RangeFinder: remove useless includes 2019-03-26 10:27:54 +11:00
Andrew Tridgell
ccfaaca82b AP_RangeFinder: fixed lightware serial with LW20 lidar
it needs a longer serial write to force it to serial mode from i2c
2019-02-23 11:01:07 +11:00
Peter Barker
b0c65b9014 AP_RangeFinder_PWM: correct integer division issue 2019-02-20 17:50:46 +11:00
Andrew Tridgell
bf4dc2d3b7 AP_RangeFinder: probe all I2C buses for rangefinders
we now have flight boards with up to 4 I2C buses, and probing only 2
of them causes user confusion
2019-02-12 13:07:24 +11:00
Randy Mackay
a72477590f AP_RangeFinder: format fixes 2019-02-04 11:32:13 +09:00
Dmitri Ranfft
f8af5afc53 RangeFinder: Removed the 3 bit limitation for the enumeration 2019-02-04 11:08:50 +09:00
Dmitri Ranfft
5eff01a86f RangeFinder: allow up to 10 range finders to be used at once 2019-02-04 11:08:47 +09:00
Peter Barker
d71244dd23 APM_RangeFinder: remove PX4 backend type 2019-01-17 12:30:56 +11:00
Peter Barker
f037629fc3 RangeFinder: understand stop pin for AP_RangeFinder_PWM backend 2019-01-10 16:28:14 +11:00
Julien Beraud
e165e9c323 AP_RangeFinder: fix bebop rangefinder
Fix Backend constructor call
2018-12-22 08:44:50 +09:00
Nghia Nguyen
60250e4c49 AP_Rangefinder: Add support for ST VL53L1X 2018-12-17 14:00:31 +09:00
Randy Mackay
fbf072d84b AP_RangeFinder: add range to POS param description 2018-12-13 20:14:05 +09:00
Michael du Breuil
52d6353e33 AP_Rangefinder: Remove unused members 2018-11-27 07:36:17 +11:00
Randy Mackay
6816262e3d AP_RangeFinder: benewake tfmini always provide cm distances
a misunderstanding of the datasheet led to the mistaken idea that while in short-range-mode the distances were returned in millimeters
2018-11-21 08:38:31 +09:00
Randy Mackay
f5a9fdaf42 RangeFinder: benewake buffer uses uint8_t 2018-11-19 11:33:48 +09:00
Randy Mackay
e9c1abfc3c AP_RangeFinder: fix benewake checksum check 2018-11-15 09:18:45 +09:00
Randy Mackay
123e10c058 AP_RangeFinder: benewake returns at least 12m or 22m when out-of-range
value logged and shown to the user will be at least 12m for TFmini or 22m for TF02 which ensure the user won't see the range drop even if they have configured a very short useable distance
2018-11-15 09:18:45 +09:00
Randy Mackay
35be68348d AP_RangeFinder: benewake logic reordering
this should be a non-functional change
2018-11-10 12:20:27 +09:00
Randy Mackay
a09cd8411d AP_RangeFinder: benewake lidar returns max range + 1m when out-of-range
also returns out-of-range when signal is weak
2018-11-10 12:20:27 +09:00
Peter Barker
c2b334eaad AP_RangeFinder: PWM: take an average of any readings accumulated in irq 2018-11-08 21:03:35 +11:00
Andrew Tridgell
76a2cd1540 AP_RangeFinder: set pin to input before attaching interrupt
this fixes input on AUX6 on CubeBlack
2018-11-08 18:25:14 +11:00
Peter Barker
94e0485bdf AP_RangeFinder: add override keyword where required 2018-11-08 11:30:12 +11:00
Peter Barker
6e84a31613 AP_RangeFinder: use new ChibiOS driver if user attempts to use PX4 PWM driver 2018-11-07 08:59:19 +11:00
Peter Barker
186ce80827 AP_RangeFinder: add pwm backend 2018-11-07 08:59:19 +11:00
Randy Mackay
7fdd0bd996 AP_RangeFinder: Benewake driver discards distances over 327m 2018-11-06 11:58:32 +11:00
murata
c8f93a3ddc RangeFinder: Added statement FALLTHROUGH 2018-10-30 09:13:29 +09:00
Nghia Nguyen
513eb1f5db AP_Rangefinder: Add support for Garmin LidarLite-V3HP 2018-10-27 11:22:57 +01:00
Randy Mackay
82a28dc0fc AP_RangeFinder: check I2C dev during detect 2018-10-26 13:33:27 +09:00
Andrew Tridgell
b1e4434332 AP_RangeFinder: use WITH_SEMAPHORE()
and removed usage of hal.util->new_semaphore()
2018-10-17 12:54:22 +11:00
Peter Barker
3be9f35264 AP_RangeFinder: remove rangefinder prearm requirements for SITL
Getting the virtual rangefinder to move in prearm would be better, much
much more involved.
2018-10-09 10:47:38 +11:00
Randy Mackay
3e8d9f4131 RangeFinder: shorten comment 2018-08-28 09:23:38 +09:00
Randy Mackay
1b0f0a7559 AP_RangeFinder: support last_reading_ms
Benewake, LeddarOne, LightWareSerial, MAVLink, MaxsonarI2CXL, MaxsonarSerialLV, NMEA, PX4_PWM, uLanding and Wasp already stored the last read time so for these drivers, this change just moves that storage to the state structure
analog, BBB_PRU, Bebop, LightWareI2C, PulsedLightLRF, TeraRangerI2C, VL53L0X did not store the last read time so this was added
2018-08-28 09:23:38 +09:00
Randy Mackay
9e27b93538 AP_RangeFinder: move some backend implementations to cpp file 2018-08-28 09:23:38 +09:00
Randy Mackay
9a7b378ddd AP_RangeFinder: minor format change
lines up with parameter variables below
2018-08-28 09:23:38 +09:00
pierre-louis.k
e62ed19759 AP_RangeFinder: Remove range enforcement on out of range 2018-08-27 10:25:51 +09:00
pierre-louis.k
5577b8b33c AP_RangeFinder: Rework function structure in TeraRanger driver 2018-08-27 10:25:49 +09:00
pierre-louis.k
b6f1647c31 AP_RangeFinder: Rename function in TeraRanger driver 2018-08-27 10:25:47 +09:00
pierre-louis.k
1b990c116d AP_RangeFinder: Give back semaphore on whoami error 2018-08-27 10:25:45 +09:00
pierre-louis.k
4d45b68fa3 AP_RangeFinder: Clean TeraRanger driver 2018-08-27 10:25:43 +09:00
pierre-louis.k
d162afb790 AP_RangeFinder: Add error codes rejection for TeraRanger sensors 2018-08-27 10:25:41 +09:00
Michael du Breuil
f0a4059d73 AP_Rangefinder: Remove APM doc references 2018-08-01 09:24:26 +10:00
Andrew Tridgell
a8647f834e AP_RangeFinder: fixed VL53L0X semaphore usage 2018-07-27 09:15:32 +10:00
Patrick José Pereira
32fa7e2c2a AP_RangeFilter: Fix equality comparison with extraneous parentheses
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2018-06-27 14:59:33 -07:00
Michael du Breuil
fb99ea0446 AP_Rangefinder: Update WASP defaults 2018-06-01 15:08:35 +09:00
Randy Mackay
99cf279dff AP_RangeFinder: remove unused definitions from MaxSonarI2C 2018-06-01 15:06:13 +09:00
Randy Mackay
98e87db274 AP_RangeFinder: MaxsonarI2C reports no data after 300ms 2018-06-01 15:04:40 +09:00
Randy Mackay
e520d4fe42 AP_RangeFinder: Benewake TF02 and TFmini lidar driver 2018-05-30 11:16:35 +09:00
Michael du Breuil
b2d8f6e788 AP_Rangefinder: Fix bad fallthrough from NMEA driver 2018-05-29 00:10:40 +01:00
Andrew Tridgell
08228efc72 AP_Rangefinder: fixed param docs for Wasp backend 2018-05-28 11:44:29 +01:00
Andrew Tridgell
3b8d5ea4cf AP_Rangefinder: fixed param handling for Wasp backends 2018-05-28 11:44:29 +01:00
Michael du Breuil
b678302aed AP_Rangefinder: Add WASP 200 LRF backend 2018-05-28 11:44:29 +01:00
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