Commit Graph

229 Commits

Author SHA1 Message Date
Randy Mackay 398f427830 AP_Proximity: fix rangefinder backends cm to m conversion 2019-09-19 08:43:11 +09:00
Randy Mackay 2d128e0079 AP_Proximity: remove unused var from AriSimSITL 2019-09-10 09:15:56 +10:00
Andrew Tridgell a4258639c8 AP_Proximity: use strtol instead of sscanf 2019-08-27 15:40:43 +10:00
Rajat Singhal 4af8813014 AP_Proximity: Add license info in Airsim lidar backend 2019-08-15 20:03:31 +10:00
Rajat Singhal 8f1c9759b8 AP_Proximity: Add AirSimSITL lidar sensor 2019-08-04 07:57:46 +10:00
Tom Pittenger 6d1362d569 AP_Proximity: allow MAV driver to accept negative increments and sanity check distances 2019-08-02 09:50:13 -06:00
Tom Pittenger b8dcdca909 AP_Proximity: add Object Avoidance Database, remove old Sector->Location converter 2019-08-02 09:50:13 -06:00
Pierre Kancir 5b745aa1f1 AP_Proximity: pass mavlink_message_t by const reference 2019-07-16 20:51:42 +10:00
Randy Mackay 9c3812e384 AP_Proximity: move copy_locations to backend
also remove unused get_locations
also fix comment for copy_locations method
2019-06-11 13:13:22 +09:00
Tom Pittenger b792fe4b26 AP_Proximity: add Location* object and accessors 2019-06-11 13:13:22 +09:00
Peter Barker d617904726 AP_Proximity: remove dangling update_instance declaration 2019-06-04 19:36:57 +09:00
Tom Pittenger c67a585b68 AP_Proximity: increase angular resoluion to mavlink packet OBSTACLE_DISTANCE 2019-05-29 18:22:53 -07:00
Randy Mackay 2061621951 AP_Proximity: default YAW_CORR to 0
The default of 22 was good when the Lightware SF40C was our only proximity sensor but not good now that we have numerous options
2019-05-29 11:17:28 +09:00
Randy Mackay ff3d3d256c AP_Proximity: RPLidarA2 supports yaw-correction and orientation params 2019-05-29 11:17:28 +09:00
Peter Barker dbbf09d018 AP_Proximity: minor performance enhancements 2019-05-28 09:19:48 +10:00
Peter Barker b086b39f89 AP_Proximity: add AP::proximity() singleton getter 2019-05-22 07:48:02 -06:00
Pierre Kancir 72e4e69add AP_Proximity: move location_update to Location and rename to offset_bearing 2019-04-06 09:10:28 +11:00
murata fb544cab78 AP_Proximity: Change from method reference to macro 2019-03-28 12:02:55 +11:00
Peter Barker 19d8ffb4e4 AP_Proximity: stop passing through old fence contains_return_point parameter 2019-02-04 16:52:42 +09:00
Dmitri Ranfft 221c4ca3cc AP_Proximity: Removed the 3 bit limitation for the enumeration 2019-02-04 11:08:54 +09:00
Randy Mackay 12d6799aaa AP_Proximity: fix morse sector calc 2018-12-14 09:18:23 +09:00
Randy Mackay f7f50d84c9 AP_Proximity: minor typo fix 2018-12-14 09:18:23 +09:00
Peter Barker 3a7ab5f67e AP_Proximity: rename send_extended_status1 to send_sys_status 2018-12-10 12:52:41 +09:00
Andrew Tridgell e883c6392f AP_Proximity: added a MorseSITL sensor
this interfaces with the laser scanner in morse
2018-12-04 18:29:41 +11:00
Peter Barker e0ab431ebd AP_Proximity: add override keyword where required 2018-11-08 11:30:12 +11:00
Randy Mackay 7fa592e673 AP_Proximity: increase MAV driver timeout to 500ms
this comes after testing with ROS/mavros and discovering the update rate is only 4hz
2018-10-26 14:38:04 +09:00
Raouf 8bfb1d2445 AP_Proximity: add support for OBSTACLE_DISTANCE message 2018-10-02 10:37:13 +09:00
pierre-louis.k bf274cd9db AP_Proximity: Change min and max range to support both 60m and 600Hz 2018-08-25 10:22:11 +09:00
Mateusz Sadowski 08332102fe AP_Proximity: Fix sensor order on TeraRanger Tower Evo 2018-08-25 10:22:11 +09:00
Mateusz Sadowski 4b8b8347f2 AP_Proximity: Correctly handle TeraRanger Tower Evo initialization 2018-08-25 10:22:11 +09:00
Mateusz Sadowski f1b550647d AP_Proximity: Change TeraRanger Tower Evo sequence mode to Tower 2018-08-25 10:22:11 +09:00
Mateusz Sadowski 2ca567f409 AP_Proximity: Add support for TeraRanger Tower Evo 2018-08-25 10:22:11 +09:00
Peter Barker e7e0ee0b50 AP_Proximity: add methods covering sensor health, enable and present 2018-06-26 10:25:28 +10:00
Patrick José Pereira 50613c3800 AP_Proximity: Use SITL singleton
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2018-06-26 00:02:01 +01:00
Michael du Breuil f8b10aaa53 AP_Proximity: Make singleton and add an interface to check what type is loaded 2018-05-16 23:21:41 +01:00
Randy Mackay 436f514142 AP_Proximity: resolve compiler warning and format fix 2018-05-15 10:16:30 +09:00
Michael du Breuil 636782375e AP_Proximity: Revert an excessive scan introduced in #8375
Also removes 2 unneeded initilizers, and removes an unneeded runtime
check
2018-05-14 10:53:21 +09:00
Michael du Breuil 00c512c7e2 AP_Proximity: Small fixups to the rangefinder backend 2018-05-12 09:24:04 +09:00
Peter Barker 0c14a309f7 AP_Proximity: correct debugginf for RPLidarA2 2018-04-10 16:25:54 +09:00
Peter Barker 51991fdd76 AP_Proximity: fix compilation warning in LightWare driver
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp: In member
function ‘void AP_Proximity_LightWareSF40C::request_new_data()’:
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp:235:6:
warning:
‘__builtin___snprintf_chk’ output may be truncated before the last
format
character [-Wformat-truncation=]
 void AP_Proximity_LightWareSF40C::request_new_data()
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from ../../libraries/AP_Common/AP_Common.h:179,
                 from ../../libraries/AP_HAL/UARTDriver.h:5,
                 from ../../libraries/AP_HAL/HAL.h:11,
                 from ../../libraries/AP_HAL/AP_HAL_Main.h:19,
                 from ../../libraries/AP_HAL/AP_HAL.h:8,
                 from
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp:16:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:65:44: note:
‘__builtin___snprintf_chk’ output between 10 and 16 bytes into a
destination
of size 15
        __bos (__s), __fmt, __va_arg_pack ());
                                            ^
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp: In member
function ‘bool
AP_Proximity_LightWareSF40C::send_request_for_distance()’:
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp:275:6:
warning:
‘__builtin___snprintf_chk’ output may be truncated before the last
format
character [-Wformat-truncation=]
 bool AP_Proximity_LightWareSF40C::send_request_for_distance()
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:862:0,
                 from ../../libraries/AP_Common/AP_Common.h:179,
                 from ../../libraries/AP_HAL/UARTDriver.h:5,
                 from ../../libraries/AP_HAL/HAL.h:11,
                 from ../../libraries/AP_HAL/AP_HAL_Main.h:19,
                 from ../../libraries/AP_HAL/AP_HAL.h:8,
                 from
../../libraries/AP_Proximity/AP_Proximity_LightWareSF40C.cpp:16:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:65:44: note:
2018-04-04 18:04:57 +09:00
Holger Steinhaus 5af02dde59 AP_Proximity: fix possible overflow/truncation issue 2018-03-16 22:37:16 +01:00
Peter Barker e7d48977ba AP_Proximity: compiler warning fixes
In file included from
../../libraries/AP_Proximity/AP_Proximity_RPLidarA2.cpp:30:
../../libraries/AP_Proximity/AP_Proximity_RPLidarA2.h:88:10: warning:
private field '_payload_data' is not used [-Wunused-private-field]
    bool _payload_data;
         ^
../../libraries/AP_Proximity/AP_Proximity_RPLidarA2.h:91:10: warning:
private field '_skip' is not used [-Wunused-private-field]
    bool _skip;
         ^
../../libraries/AP_Proximity/AP_Proximity_RPLidarA2.h:92:10: warning:
private field '_rp_reset' is not used [-Wunused-private-field]
    bool _rp_reset;
         ^
../../libraries/AP_Proximity/AP_Proximity_RPLidarA2.h:95:13: warning:
private field '_element_len' is not used [-Wunused-private-field]
    uint8_t _element_len[2];
            ^
../../libraries/AP_Proximity/AP_Proximity_RPLidarA2.h:96:13: warning:
private field '_element_num' is not used [-Wunused-private-field]
    uint8_t _element_num;
            ^
5 warnings generated.
2018-03-02 09:26:37 +09:00
Steven Josefs 6e0ff8b169 AP_Proximity: add support for RP Lidar A2
This is a 360degree lidar with up to 16m range
2017-09-18 08:28:11 +09:00
Peter Barker e0bea597c0 AP_Proximity: use rangefinder backend accessors 2017-08-15 18:30:45 +01:00
khancyr f60e7df309 AP_Proximity: correct missing use of PROXIMITY_MAX_DIRECTION 2017-07-14 18:59:36 +01:00
Randy Mackay d636e85eac AP_Proximity: SF40c driver treats zero distances as invalid 2017-07-08 14:09:17 +09:00
Pierre Kancir 38540b4dcc AP_Proximity: add PROXIMITY_MAX_DIRECTION and PROXIMITY_SENSOR_ID_START 2017-06-08 01:22:07 +01:00
Randy Mackay 33ef3bd51d AP_Proximity: MAV driver gets distance validity check 2017-06-06 20:41:54 +09:00
Randy Mackay 0b7ec0dc64 AP_Proximity: validate range finder distances 2017-05-31 16:26:42 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas adc919c7fc AP_Proximity: 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
Dr.-Ing. Amilcar Do Carmo Lucas 6c14f498f7 AP_Proximity: Add missing @RebootRequired: True 2017-05-15 21:51:19 +09:00
Randy Mackay 3ad5c3775e AP_Proximity: rename get_distances to get_horizontal_distances
Also fix existing bug in return
2017-04-20 18:11:43 +09:00
Randy Mackay 09e3d6b7f0 AP_Proximity_MAV: healthy if either horiz or vert positions received 2017-04-20 18:11:43 +09:00
Randy Mackay fd94ab43fa AP_Proximity: minor fix to param description
No functional change
2017-03-01 14:59:44 +09:00
Randy Mackay a093bcb05f AP_Proximity: add rangefinder driver
This allows avoidance using upward or forward facing range finders
2017-02-27 15:18:09 +09:00
Luis Rodrigues 27c5aca6b5 AP_Proximity: add support for TeraRangerTower 2017-02-03 14:27:52 +09:00
Randy Mackay a47e215a8e AP_Proximity: add get_upward_distance
This allow support for upward facing proximity sensor received through a DISTANCE_SENSOR message.
Also added SITL test
2017-01-18 09:35:47 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas bebb128d22 AP_Proximity: Add missing parameter units 2017-01-16 19:07:27 +00:00
Randy Mackay 6aeef76768 AP_Proximity: fix get_boundary_points in case of multiple sensors 2017-01-16 16:38:18 +09:00
Randy Mackay 7c7144fd8f AP_Proximity: minor comment spelling fix 2017-01-11 21:48:23 +09:00
Randy Mackay 74f1899aeb AP_Proximity: boundary_points requires only one valid distance
Object avoidance is possible with just one valid distance
Boundary is initialised in new init_boundary function to be 100m from
vehicle
If sectors do not have valid distance measurements, we use the distance
from adjacent sectors.  This conveniently leads to a concave shaped
boundary that keeps the vehicle from travelling into the dataless sector.
2017-01-11 21:48:23 +09:00
Randy Mackay a0a8472a44 AP_Proximity: fix consumption of distance-sensor messages 2017-01-11 21:48:23 +09:00
Randy Mackay d4daa10045 AP_Proximity: add MAV type to parameter descriptions 2017-01-10 11:00:00 +09:00
murata c2521dd650 AP_Proximity: Change sprintf method to secure snprintf method. 2017-01-07 02:33:46 +00:00
Dr.-Ing. Amilcar Do Carmo Lucas 8419045aea Spell in comments 2017-01-06 10:57:39 -08:00
Randy Mackay e497dedf35 AP_Proximity: add MAV type
This accepts DISTANCE_SENSOR messages from eight sectors around the vehicle
2016-12-27 08:37:48 +09:00
Randy Mackay 2076da3a72 AP_Proximity: minor comment fix
No functional change
2016-12-24 13:55:28 +09:00
Randy Mackay fbbd13db75 AP_Proximity: add get_object methods for use with non-GPS avoidance 2016-12-20 19:47:56 +09:00
Randy Mackay 54a87ad35c AP_Proximity: set minimum boundary distance
AC_Avoidance will not stop if it thinks the vehicle is on or outside the polygon.  Setting a minimum distance ensures the vehicle is always within the polygon.
2016-11-27 15:05:48 +09:00
Randy Mackay 57ae14ab4c AP_Proximity: add get distances, distance_max, distance_min
These are used to send distance-sensor messages to the ground station
2016-11-27 15:05:45 +09:00
Randy Mackay 6293fa1595 AP_Proximity: add boundary points for object avoidance
This returns a fence which can be used for object avoidance by AC_Avoidance
2016-11-27 15:05:35 +09:00
Randy Mackay 26332251f5 AP_Proximity: add ignore areas
Only SF40c uses these ignore areas for now at least.
It is safe to increase the eeprom locations for the 2nd proximity instance because we only define a single instance.
2016-11-27 15:05:27 +09:00
Randy Mackay 87dea46f5d AP_Proximity: add get_closet_object for use in pre-arm checks 2016-11-27 12:03:06 +09:00
Randy Mackay a56c9545bd AP_Proximity: SITL driver filles in backend sector data 2016-11-27 12:03:04 +09:00
Randy Mackay f594a5a7d6 AP_Proximity: move sectors to backend
This prepares for sectors to be re-used by the SITL driver
2016-11-27 12:03:01 +09:00
Andrew Tridgell ae2dc5570e AP_Proximity: added SITL proximity backend
using fence points for avoidance
2016-11-14 15:53:43 +09: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
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
Randy Mackay c3087edbe8 AP_Proximity: add library and SF40C driver 2016-10-13 20:21:07 +09:00