Commit Graph

20393 Commits

Author SHA1 Message Date
Peter Barker 7b52c41287 AP_Compass: fix example by instantiating serial_manager 2019-07-01 19:11:03 +10:00
Peter Barker ef2589738d AP_NavEKF3: use beacon singleton 2019-07-01 07:20:58 +09:00
Peter Barker 82df167ad4 AP_NavEKF2: use beacon singleton 2019-07-01 07:20:58 +09:00
Peter Barker d9c30f489f AP_Logger: use beacon singleton 2019-07-01 07:20:58 +09:00
Peter Barker 2bcaaf5aaf AP_AHRS: remove handling of beacon 2019-07-01 07:20:58 +09:00
Peter Barker 04ebb9de0b AP_Airspeed: use send_to_active_channels for airspeed_autocal 2019-06-29 16:04:26 +10:00
bugobliterator 7d4a758059 hwdef: fix default battery monitor pins for CubeOrange 2019-06-28 14:18:11 +10:00
bugobliterator 71ee4d573f AP_BattMonitor: add battery pin config for CubeOrange 2019-06-28 14:18:11 +10:00
Michael du Breuil cfa54d4ca4 AP_Module: update example baro include 2019-06-27 14:56:21 +10:00
Michael du Breuil ca65b214af AP_TECS: Include needed AP_Baro.h 2019-06-27 14:56:21 +10:00
Michael du Breuil 99ff84168c AP_Terrain: Remove unneeded includes 2019-06-27 14:56:21 +10:00
Michael du Breuil e43605cc9b AP_Airspeed: Remove a number of unneeded top level includes 2019-06-27 14:56:21 +10:00
Michael du Breuil a6623bfad3 AP_HAL_SITL: Fix missing include for logger.h 2019-06-27 14:56:21 +10:00
Michael du Breuil b7bca441e5 SITL: Fix a number of includes that were coming in via AP_Airspeed 2019-06-27 14:56:21 +10:00
Michael du Breuil 1226eb825a AP_AHRS: Reduce scope of AP_Baro.h 2019-06-27 14:56:21 +10:00
Michael du Breuil 1a7502b413 AP_VisualOdom: Remove uneeded include 2019-06-27 14:56:21 +10:00
Michael du Breuil 7a03b8faac AP_InertialNav: Remove undeeded includes 2019-06-27 14:56:21 +10:00
Michael du Breuil 9b162563d6 AP_Advanced_Failsafe: Reduce scope of AP_Baro.h 2019-06-27 14:56:21 +10:00
Michael du Breuil b624f6f008 AP_NavEKF3: Reduce scope of AP_Baro.h 2019-06-27 14:56:21 +10:00
Michael du Breuil f04e47fc17 AP_NavEKF2: Reduce scope of AP_Baro.h 2019-06-27 14:56:21 +10:00
Michael du Breuil 6385e3ceac AP_TempCalibration: Include needed AP_Baro.h 2019-06-27 14:56:21 +10:00
Michael du Breuil 9ed3242c06 AP_Tuning: Reduce header scope 2019-06-27 14:56:21 +10:00
Michael du Breuil 18e979fd4f GCS_MAVLink: Include needed AP_Baro.h 2019-06-27 14:56:21 +10:00
Michael du Breuil 631b4380e1 AP_OSD: Include needed AP_Baro.h 2019-06-27 14:56:21 +10:00
Michael du Breuil 6480786ab2 AP_Mount: Cleanup SoloGimalEKF headers further 2019-06-27 14:56:21 +10:00
Michael du Breuil eeca59d1ef AP_Arming: Include needed AP_Baro.h 2019-06-27 14:56:21 +10:00
Michael du Breuil 2dcbe5a49b AP_ADSB: Include needed AP_Baro.h 2019-06-27 14:56:21 +10:00
Peter Barker 61e261caf5 AP_Soaring: remove definition of 'N' macro in favour of scoped variable 2019-06-27 14:40:44 +10:00
Peter Barker 54ba686855 AP_InternalError: add bit for asking for a non-existant gcs backend 2019-06-27 07:54:45 +10:00
Michael du Breuil 67898d7320 AP_FrSky_Telem: Don't statically allocate the statustext_queue
This saves 280 bytes of RAM
2019-06-26 11:59:41 +10:00
Michael du Breuil f955a4e4d5 GCS_MAVLink: Don't retain a FrSky instance if we aren't using it
Saves 96 bytes of RAM
2019-06-26 11:59:41 +10:00
Michael du Breuil 59e62ca2fc AP_FrSky_Telem: Make init return false if we failed to init 2019-06-26 11:59:41 +10:00
Peter Barker 278ac5e6ed GCS_MAVLink: correct deferred body timing debug 2019-06-25 19:59:49 +10:00
Peter Barker feddaabc42 GCS_MAVLink: handle out-of-time to send messages in parent class 2019-06-25 10:29:40 +10:00
Andrew Tridgell 88111ef81a AP_BattMonitor: reset failsafe flags when we reset battery remaining 2019-06-25 09:56:25 +10:00
Andrew Tridgell f28df4dff1 GCS_MAVLink: support MAV_CMD_BATTERY_RESET command 2019-06-25 09:56:25 +10:00
Andrew Tridgell 11518857b6 AP_BattMonitor: added reset_remaining() API
used to allow battery swap before takeoff
2019-06-25 09:56:25 +10:00
Peter Barker a55c40949b GCS_MAVLink: remove pointless protocol parameter to setup_uart 2019-06-25 09:47:08 +10:00
Peter Barker ca449cd979 GCS_MAVLink: stop pointlessly passing serial manager around 2019-06-25 09:47:08 +10:00
Peter Barker 45fab82345 GCS_MAVLink: eliminate redundant static pointer to serialmanager 2019-06-25 09:47:08 +10:00
Randy Mackay 0b62641a46 AC_Avoidance: fix Dijkstra's iteration through polygon fence points 2019-06-25 00:32:18 +08:00
Peter Barker afd63c05ec AP_Tuning: ignore tuning selector switch unless valid RC input 2019-06-25 00:31:54 +08:00
Peter Barker 288b13868b AP_Tuning: debounce RC input 2019-06-25 00:31:54 +08:00
Andrew Tridgell b6dbb8f464 GCS_MAVLink: always show AHRS healthy with EKF type 10
this fixes an issue noticed by Marco with xplane
2019-06-25 00:28:45 +08:00
Andrew Tridgell 5ac2aad2f8 AP_Mission: fixed valgrind error on writing mission items 2019-06-24 18:19:14 +08:00
Andrew Tridgell 0ca71ba725 AP_HAL: added get_last_armed_change() Util function 2019-06-21 11:40:53 +10:00
Andrew Tridgell 8fc8bc4d84 AP_Arming: notify logging system of an arming failure 2019-06-21 11:40:53 +10:00
Andrew Tridgell dd3eec2a38 AP_Logger: persist logging for 15s after disarm or arming failure
this will provide useful information in logs on disarms in flight or
reasons for arming failure
2019-06-21 11:40:53 +10:00
Randy Mackay df6c666740 AP_Common: add AP_ExpandingGeneric to reduce code size 2019-06-20 15:09:23 +09:00
Randy Mackay 4ef3005d2c AP_Common: add AP_ExpandingArray delete 2019-06-20 15:09:23 +09:00
Randy Mackay 578023483c AC_Avoidance: Dijkstra's expanding arrays use 32 elements per chunk 2019-06-20 15:09:23 +09:00
Randy Mackay 2cb89d9a02 AP_Common: expanding array uses realloc
also make chunk_size const and recommend factor of 2
also reduce top level array's initial size to 32 elements
2019-06-20 15:09:23 +09:00
Randy Mackay da645c32ff AC_Avoidance: Dijkstra's specifies expanding array chunk sizes
also add check that number of polygon points is less than 255
2019-06-20 15:09:23 +09:00
Randy Mackay 073ce8c3db AP_ExpandingArray: add class description and remove default constructor
also made the following changes:
replaced delete with free
renamed chunk_ptr typedef to chunk_ptr_t
2019-06-20 15:09:23 +09:00
Randy Mackay 48a7f468bf AC_Avoidance: AP_OADijkstra and OAVisGraph use AP_ExpandingArray 2019-06-20 15:09:23 +09:00
Randy Mackay 528e7c60b0 AP_Common: add AP_ExpandingArray class 2019-06-20 15:09:23 +09:00
Peter Barker 1ff3cd442d AP_Mission: fix example by instantiating a GCS object 2019-06-20 13:40:28 +10:00
Peter Barker c11da6a85d GCS_MAVLink: routing example: use GCS_Dummy in place of custom GCS 2019-06-20 11:41:19 +10:00
Jaaaky 061b4b7e70 AP_Airspeed: convert to unix style end-of-line 2019-06-19 16:39:09 +09:00
Andrew Tridgell 767968026a AP_AdvancedFailsafe: added docs for AFS output pins 2019-06-18 17:20:55 +01:00
Michael du Breuil 75c62154b5 AP_HAL_SITL: Add missing override declarations 2019-06-18 00:06:32 -07:00
Michael du Breuil a34ac14ec5 AP_HAL_ChibiOS: Make BOARD_FLASH_SIZE available at configure time 2019-06-18 00:06:32 -07:00
Michael du Breuil 0a7cf77de4 AP_AHRS: Update function descriptions in header 2019-06-18 00:06:32 -07:00
Michael du Breuil 0ed3c547fd AP_Scripting: Disable by default, fix a nullable type, update README 2019-06-18 00:06:32 -07:00
Peter Barker ccbf3234f7 AP_HAL_SITL: return RC protocol being decoded 2019-06-18 11:35:38 +10:00
Peter Barker a9c4f1d0d5 AP_HAL_Linux: return RC protocol being decoded 2019-06-18 11:35:38 +10:00
Peter Barker 1f4de871da AP_HAL_ChibiOS: return RC protocol being decoded 2019-06-18 11:35:38 +10:00
Peter Barker 92111eea61 AP_HAL: require HALs implement rcin.protocol() to return RC protocol 2019-06-18 11:35:38 +10:00
Peter Barker 7bca6d5ec0 AP_Logger: log RC protocol each time a log is opened 2019-06-18 11:35:38 +10:00
Peter Barker 0963957b31 GCS_MAVLink: correct GCS_Dummy firmware version 2019-06-18 10:54:01 +10:00
Peter Barker c39a622653 GCS_MAVLink: take sw_version from AP_FWVersion struct 2019-06-18 10:54:01 +10:00
Peter Barker b48c729bb1 AP_Common: add os_sw_version to AP_FWVersion 2019-06-18 10:54:01 +10:00
Peter Barker 8f8851271a RC_Channel: add mode-changing options to Plane RC channel options 2019-06-18 10:48:47 +10:00
Peter Barker a2c4bfea0c GCS_MAVLink: use send_to_active_channels for parameters 2019-06-18 10:27:56 +10:00
vierfuffzig 7780e8ed00 AP_HAL_ChibiOS: add support for AIO and OSD board types
this allows init on board variant without onboard baro
2019-06-18 10:10:22 +10:00
Michael du Breuil 6e0cceff0d AP_Common: Remove extra comparison from longitude_scale() 2019-06-18 10:09:09 +10:00
Peter Barker 4e5842a150 AP_Common: add initialised() method to Location
Sometimes code paths are crossed when they shouldn't be.  This method
can help in the short term if a codepath is calling methods on a
Location when it is not initialised, but generally a vehicle should be
calling position_ok() and other methods rather than this one.
2019-06-18 09:07:56 +09:00
Michael du Breuil 4aa33bec49 AP_AHRS: Remove AP_GPS.h from AP_AHRS.h 2019-06-18 10:02:05 +10:00
Michael du Breuil 197804412a APM_Control: Fix AP_GPS include 2019-06-18 10:02:05 +10:00
Michael du Breuil a09ead5819 AP_ADSB: Fix AP_GPS include 2019-06-18 10:02:05 +10:00
Michael du Breuil 3194b073ca AP_AdvancedFailsafe: Use AP_GPS singleton 2019-06-18 10:02:05 +10:00
Michael du Breuil 157a3b1e34 AP_Airspeed: Fix AP_GPS.h include and use the singleton 2019-06-18 10:02:05 +10:00
Michael du Breuil c70107cabb AP_Arming: Fix AP_GPS.h include 2019-06-18 10:02:05 +10:00
Michael du Breuil 889d9b7348 AP_Frsky: Fix AP_GPS.h include 2019-06-18 10:02:05 +10:00
Michael du Breuil f6f432a785 AP_Landing: Fix AP_GPS.h include, use a ref to the singleton 2019-06-18 10:02:05 +10:00
Michael du Breuil f8750a6d18 AP_Logger: Fix AP_GPS.h include 2019-06-18 10:02:05 +10:00
Michael du Breuil 459e6704b9 AP_Module: Fix AP_GPS.h include 2019-06-18 10:02:05 +10:00
Michael du Breuil fbd19f30e7 AP_Mount: Reduce header includes 2019-06-18 10:02:05 +10:00
Michael du Breuil 892b687c09 AP_NavEKF2: Fix AP_GPS.h include 2019-06-18 10:02:05 +10:00
Michael du Breuil be74b631fe AP_NavEKF3: Fix AP_GPS.h include 2019-06-18 10:02:05 +10:00
Michael du Breuil 2ab8a2318e AP_OSD: Fix AP_GPS.h include 2019-06-18 10:02:05 +10:00
Michael du Breuil cbcd959290 AP_Terrain: Fix AP_GPS.h include 2019-06-18 10:02:05 +10:00
Michael du Breuil be7afe346b GCS_MAVLink: Fix AP_GPS include 2019-06-18 10:02:05 +10:00
Michael du Breuil 6317355390 RC_Channel: Fix AP_GPS include 2019-06-18 10:02:05 +10:00
Michael du Breuil 23439de39a AP_Logger: Don't include AP_BattMonitor which we don't need 2019-06-18 10:02:05 +10:00
Michael du Breuil ba4c589ff2 AP_OSD: Fix depending upon AP_Logger for AP_BattMonitor header 2019-06-18 10:02:05 +10:00
Michael du Breuil f6b8bf49a1 AP_Motors: Simplify the example includes 2019-06-18 10:02:05 +10:00
Michael du Breuil 8c00102259 GCS_MAVLink: Reduce scoping on AP_BattMonitor include 2019-06-18 10:02:05 +10:00
Michael du Breuil eed710db5f AP_GPS: Fix a lot of unneded example includes 2019-06-18 10:02:05 +10:00
Michael du Breuil 9fc954b030 AP_Compass: Reduce scope of BattMonitor include 2019-06-18 10:02:05 +10:00
Michael du Breuil 03a4dda810 AP_Mount: Remove unneeded dependency on AP_Airspeed, and bad example 2019-06-18 10:02:05 +10:00
Peter Barker b902316139 AP_HAL: remove buggy write implementation 2019-06-17 17:20:57 +10:00
Pierre Kancir 209b0300a5 AP_Rangefinder: fix compilation for Bebop 2019-06-14 18:56:05 -07:00
Randy Mackay bba81b2794 AC_Avoidance: Dijkstra's exits early if polygon fence disabled 2019-06-14 08:06:17 +09:00
Peter Barker da5d5c9203 AP_Math: add tests for Vector2 2019-06-13 19:36:49 +10:00
Jaaaky fb311208ab AP_AHRS: Fix DCM gndVelADS on groundspeed_vector() with airspeed_use 2019-06-13 16:31:12 +10:00
Randy Mackay fb284ff26a AP_ServoRelayEvents: minor formatting fix 2019-06-13 09:51:21 +09:00
Tatsuya Yamaguchi 012fcae388 AP_ServoRelayEvents: allow DO_SET_SERVO commands while rc pass-thru 2019-06-13 09:51:21 +09:00
Tatsuya Yamaguchi f9547fa28e SRV_Channel: allow DO_SET_SERVO commands while rc pass-thru 2019-06-13 09:51:21 +09:00
Rishabh ce48b82500 AC_WPNav: remove brake 2019-06-13 09:02:46 +09:00
Peter Barker c59dde78c6 AP_HAL_SITL: dump stack trace as part of panic() 2019-06-13 09:25:42 +10:00
Peter Barker dd68b14f46 AP_HAL_SITL: move dump_strack_trace into HAL 2019-06-13 09:25:42 +10:00
Peter Barker c3a99c8eb0 AP_HAL: move dump_strack_trace into HAL
Use a weak definition to allow subclasses to override
2019-06-13 09:25:42 +10:00
Randy Mackay cceab9c88f AC_Avoidance: fix BendyRuler when outside polygon fence 2019-06-12 14:54:33 +09:00
Peter Barker cc7044b360 AP_Scheduler: include internal error count in PM log message 2019-06-12 10:05:59 +10:00
Peter Barker 733b7b7f1a AP_Logger: include internal error count in log structure 2019-06-12 10:05:59 +10:00
Peter Barker 5f877294c9 AP_Logger: re-add lost validate_structure loop
Lost with bad rebase
2019-06-12 10:05:59 +10:00
Peter Barker cd0265644d AP_Logger: disable float-mult-zero sanity check for the time being 2019-06-12 10:05:59 +10:00
Peter Barker ae85994c59 GCS_MAVLink: include internal error count as errors4 in SYS_STATUS 2019-06-12 10:05:59 +10:00
Peter Barker 256b6703f1 AP_InternalError: keep count of number of errors having occured 2019-06-12 10:05:59 +10:00
Andrew Tridgell 99316a191c AP_AHRS: added check_lane_switch() 2019-06-12 09:52:20 +10:00
Andrew Tridgell 60831c2878 AP_NavEKF3: added checkLaneSwitch()
this allows the vehicle code to ask the EKF to change lanes if it is
about to do an EKF failsafe
2019-06-12 09:52:20 +10:00
Andrew Tridgell 3073c4da7a AP_NavEKF2: added checkLaneSwitch()
this allows the vehicle code to ask the EKF to change lanes if it is
about to do an EKF failsafe
2019-06-12 09:52:20 +10:00
Peter Barker f385a4a329 GCS_Common: fix compiler warnings on missing parentheses 2019-06-11 21:50:53 +10:00
Randy Mackay 6ed09d83f3 GCS_MAVLink: send_home_position uses const Location reference 2019-06-11 13:13:22 +09:00
Randy Mackay 0a86bbdc9a AC_Avoidance: add license to cpp file 2019-06-11 13:13:22 +09:00
Randy Mackay 70e9881880 AR_WPNav: integrate OAPathPlanner 2019-06-11 13:13:22 +09:00
Randy Mackay af80070ed9 AP_OAPathPlanner: path planning around obstacles
implements both bendy ruler and dijkstra's algorithms

includes many changes after peer review including:
removed unused airspeed and turn-rate arguments
renamed constants to start with OA_BENDYRULER_
removed fence_ptr check from update function that could cause bendy ruler to fail when fences were disabled
AC_Fence's fence-margin is not used and instead we always use a hard-coded 2m limit
vehicle's heading is used instead of ground-course when speed is below 0.2m/s
static assert added to ensure OA_BENDYRULER_BERAING_INC constant is defined correctly
replace BAD_MARGIN/GOOD_MARGIN with FLT_MAX/-FLT_MAX
use calc_margin_from_xxx function's return values
calc-margin-from-proximity-sensors fails if copy-locations fails
remove debug
remove unused singletons

and other changes including:
integrate fence rename to get_boundary_points
adapt to fence return point and duplicate final point from not being returned
create bendyrule and dijkstra objects on init
add pre-arm-check to ensure they've been created successfully
Dijkstra's detects polygon fence changes
minor fix to Dijkstra's return path
allow update_visgraph to accept 0,0 as extra point

and these fixes from peer reviews:
remove unused methods
add note about dangers of operator[]
reduce memory consuption of ShortPathNode
remove unused methods including print_all_nodes and print_shortest_path
replace OA_DIJKSTRA_POLYGON_VISGRAPH_INFINITY_CM with FLT_MAX
update method gets check that ekf origin has been set
fix indexing bug in inner fence creation
fix whitespace error
find-node-from-id uses switch statement instead of 3 IF statements
update_visgraph comments added to clarify usage of extra_position argument
find-closest-node-idx always uses node_index instead of int16_t
static assert that OA_DIJKSTRA_POLYGON_FENCE_PTS < 255
some looping style changes
AP_OABendyRuler: fix to ground course calculation
AP_OAPathPlanner: pre_arm_check writes to caller's buffer
remove unnecessary hal and stdio.h includes
rename fence_ptr local variable to fence
add sanity check to OADijkstra's set_fence_margin
add sanity check to OABendyRuler's set_config
BendyRuler's test_bearing local constants changed to be float constants
BendyRuler's ahrs_home made local constant
BendyRuler's proximity margin calcs lose margin_found local variable (use FLT_MAX instead)
BendyRuler's calc-margin-from-circular-fence performance improvement by removing one sqrt
AP_OABendyRuler: fix probe directions to be 5deg offsets from dir to destination
AP_OADijkstra: fixes after peer review
remove unnecesary initialisations
replace safe_sqrt(sq()) with length()
remove unnecessary block
comment fixes
AP_OAPathPlanner: add logging of final an intermediate location
2019-06-11 13:13:22 +09:00
Randy Mackay c7b1ad3443 AP_Logger: add Write_OA 2019-06-11 13:13:22 +09:00
Randy Mackay beb9ecbdcb AC_Fence: add get_boundary_update_ms
this allows callers to detect changes in the underlying polygon fence
2019-06-11 13:13:22 +09:00
Randy Mackay 0f6e61bc33 AC_Fence: add is_polygon_valid accessor 2019-06-11 13:13:22 +09: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
Randy Mackay c2bcc0d5f0 AP_Math: define Vector2f::perpendicular 2019-06-11 13:13:22 +09:00
Randy Mackay 071e340827 AP_Math: Polygon_closest_distance_line returns neg numbers
value is negative distance from intersection to p2
2019-06-11 13:13:22 +09:00
Andrew Tridgell 6eb816fd3b AP_Math: add Polygon_closest_distance_line
Also add optimisations
2019-06-11 13:13:22 +09:00
Andrew Tridgell a5fd7ac5ca AP_Math: add vector2f::closest_distance_between_line_and_point_squared
also add vector2f::closest_distance_between_line_and_point and vector2f::closest_distance_between_lines_squared
2019-06-11 13:13:22 +09:00
Andrew Tridgell 2457bf71d4 AP_Math: add simplified vector2f::closest_point
this simpler version assumes the line segment originates at the origin
2019-06-11 13:13:22 +09:00
Andrew Tridgell c8e49259a0 AP_Math: add vector2f::closest_distance_between_radian_and_point_squared 2019-06-11 13:13:22 +09:00
Andrew Tridgell dbf337e1b3 AP_Math: move closest_point to cpp 2019-06-11 13:13:22 +09:00
Andrew Tridgell bfc28dfde9 AP_Math: move normalize, reflect, project and perpendicular to cpp 2019-06-11 13:13:22 +09:00
Andrew Tridgell 01e541b7d1 AP_Math: minor formatting changes to length method 2019-06-11 13:13:22 +09:00
Andrew Tridgell 4c4de1f021 AP_Math: vector2f::length_squared always returns float 2019-06-11 13:13:22 +09:00
Andrew Tridgell 46617e6c72 AP_Math: remove unused include from Vector2 2019-06-11 13:13:22 +09:00
Andrew Tridgell 69781cda42 AP_Math: add Vector2::angle 2019-06-11 13:13:22 +09:00
Rajat Singhal bc22aeb4da GCS_Mavlink: Correct format specifier in UART panic message 2019-06-11 13:36:03 +10: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
Michael du Breuil 40753ab14e AP_Param: Remove non functional AP_Param ignore flags 2019-06-11 10:28:45 +10:00
Michael du Breuil cc7d13e9ef AP_BattMonitor: Remove param ignore flags 2019-06-11 10:28:45 +10:00