Commit Graph

14628 Commits

Author SHA1 Message Date
Peter Barker
b445313bf1 AP_Scheduler: remove loop-period argument from load_average
This now comes from a parameter rather than being hard-set
in the vehicle code

Also adds a method returning the max loop period based on the
loop rate
2017-08-01 19:39:27 +01:00
Michael du Breuil
efe70c8d3a AP_NavEKF3: Fix possible compass nullptr dereference 2017-08-01 15:25:05 +01:00
Michael du Breuil
dffa3d3b40 AP_NavEKF2: Fix possible compass nullptr dereference 2017-08-01 15:25:05 +01:00
Andrew Tridgell
99f5229a34 SRV_Channel: added copy_radio_in_out_mask() 2017-08-01 08:25:32 +10:00
Andrew Tridgell
1f1b4241c3 SRV_Channel: added get/set for reversed and function
these are needed in plane for auto-conversion of old elevon code
2017-08-01 08:25:32 +10:00
Andrew Tridgell
75999dbb39 SRV_Channel: prevent negative slew rate
thanks to Michael for pointing this out
2017-08-01 08:25:32 +10:00
khancyr
15398f8b0e AP_Math: correct variable init and remove define in polygon 2017-07-31 17:35:08 +09:00
Randy Mackay
f5f6ec5238 AP_Arming: rename _MIN_VOLT to _VOLT_MIN
Also _MIN_VOLT2 to _VOLT2_MIN
2017-07-31 17:19:55 +09:00
Randy Mackay
2f3a57e0aa AP_Arming: minor variable type change
no functional change
2017-07-31 17:19:55 +09:00
Randy Mackay
330a6065ca AP_Arming: Copter gets MIN_VOLT parameters 2017-07-31 17:19:55 +09:00
Michael du Breuil
2894b7cbea L1_Control: Ensure that LIM_BANK passes a sea level sanity check
This fixes #6637 where the LIM_BANK can be set such that the vehicle demands a radius at sea level that is much higher then the loiter radius was configured to be. This effectively feels like a fly away and is due to bad parameters usually. If this happens just fall back to the simple EAS2TAS scaling of the radius.
2017-07-30 12:42:21 -07:00
Peter Barker
975d2fd0d1 DataFlash: add debug for io thread failure 2017-07-28 17:06:49 +01:00
Peter Barker
b4688bd3d4 GCS_MAVLink: move common mavlink camera handling up 2017-07-28 14:32:58 +01:00
Peter Barker
bb06b02df6 AP_Camera: add const to some parameters 2017-07-28 14:32:58 +01:00
Peter Barker
a94bf851eb AP_Camera: use multiplication in place of division 2017-07-28 14:27:53 +01:00
Peter Barker
9390539231 AP_Camera: tidy up usage of trigger_pic 2017-07-28 14:27:53 +01:00
Peter Barker
84ef63edc7 AP_Camera: camera is responsible for taking distance-based-images and logging 2017-07-28 14:27:53 +01:00
Peter Barker
7f59279670 AP_GPS: make time_epoch_usec const 2017-07-28 14:27:53 +01:00
priseborough
db7c8439c6 AP_NavEKF3: Fix bug in wheel odometry timestamp correction 2017-07-28 12:48:38 +09:00
Matt
5b605d6e1c AP_Notify: Fix for Oreo LED gyro init inidication
If parameter INS_GYRO_CAL is disabled, usually because operator is
arming on a moving vehicle such as a boat, the Oreo LEDs would wait
indefinitely for a gyro calibration that will never happen.  This
removes that dependency.  The LEDs will strobe blue only when gyros are
actually initializing. Not before.  Consequently, this greatly
simiplifies that portion of the code.
2017-07-27 20:43:58 +09:00
khancyr
f583121433 AC_Fence: reset fences breach on disable
Also rename enable function parameter
2017-07-27 20:41:40 +09:00
Peter Barker
e7ff5107fb AP_GPS: tidy mavlink message handling using switch statement 2017-07-27 12:03:25 +01:00
Peter Barker
2ad453fc89 AP_GPS: handle inject packets as part of handle_msg 2017-07-27 12:03:25 +01:00
Peter Barker
60ffe00164 GCS_MAVLink: move gps inject handling up
Also, make AP_GPS responsible for decoding inject packets
2017-07-27 12:03:25 +01:00
priseborough
c7f6d52065 AP_NavEKF3: Add wheel encoder odometry
Uses the existing body frame odometry observation model.
Handles each sensored wheel as a separate sensor.
2017-07-27 16:52:27 +09:00
priseborough
cbe8f97489 AP_NavEKF3: rename struct used for velocity odometry observations
Do this so we can add other odometry observation types.
2017-07-27 16:52:26 +09:00
priseborough
08a3f55c90 AP_NavEKF3: Fix error in scaling of observation error 2017-07-27 16:52:25 +09:00
priseborough
593437ca95 AP_NavEKF3: Add tuning of visual odometry observation error
Also adjust default values based on replay analysis.
2017-07-27 16:52:25 +09:00
Randy Mackay
eaf8aad5ad AP_WheelEncoder: last_reading is last update time instead of system time 2017-07-27 14:19:08 +09:00
Randy Mackay
2c7b9d9cf7 AP_WheelEncoder: add get_delta_angle
The total angular change measured by the wheel encoder in radians
2017-07-27 14:19:08 +09:00
Randy Mackay
a53e254bd0 AP_WheelEncoder: replace scaling with CPR and radius
CPR is the wheel encoder's counts per revolution of the wheel
radius is the radius of the wheel in meters
2017-07-27 14:19:08 +09:00
Randy Mackay
cd71984705 AP_WheelEncoder: 3d position offset 2017-07-27 14:19:08 +09:00
Randy Mackay
1ddf38869a AP_AHRS: set AP_Notify gps_glitching flag 2017-07-27 14:16:23 +09:00
Randy Mackay
0d5c98ad45 AP_Notify: add gps glitch notification 2017-07-27 14:16:23 +09:00
Randy Mackay
9123b6034e SRV_Channel: update_aux_servo_function first checks function is valid
This resolves a bug in which the board could become unresponsive if an invalid function is selected
2017-07-27 11:09:57 +09:00
Patrick José Pereira
1eeea82e31 AP_Parachute: Add function to return _release_in_progress status
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2017-07-26 17:51:34 +01:00
Randy Mackay
572df8b859 SRV_Channel: minor formatting fixes
no functional change
2017-07-26 13:28:07 +09:00
Randy Mackay
298eaaeb3e SRV_Channels: rename SERVO_DEF_RATE to SERVO_RATE 2017-07-26 13:28:07 +09:00
Randy Mackay
687ec98e5d AP_HAL_PX4: set default servo update rate only when changed
This removes the chance a small switch occurring whenever this function is called
2017-07-26 13:28:07 +09:00
Peter Barker
85a0da6178 GCS_MAVLink: handle common GPS messages in base GCS_MAVLINK class 2017-07-25 14:00:45 +01:00
Randy Mackay
a657daf635 Compass: disable QMC5883 compass driver by default
This driver causes occasional heading issues so disabling until these are resolved
2017-07-25 09:27:29 +09:00
khancyr
2d0bce18a8 AP_Baro: rename all local variable with prefix
fix last missing spaces
2017-07-24 10:15:15 -07:00
khancyr
35ac86ff8d AP_Baro: fix some style and const correctness 2017-07-24 10:15:15 -07:00
khancyr
0e895f5c74 AP_Baro: fix instance shadowing 2017-07-24 10:15:15 -07:00
khancyr
42516f7079 DataFlash: simplify Log_Write_Proximity 2017-07-24 13:44:43 +01:00
khancyr
8abcb7a0e3 GCS_MAVLink: simplify send_proximity 2017-07-24 13:44:43 +01:00
khancyr
603621f2c4 DataFlash: move proximity log from Copter (NFC) 2017-07-24 13:44:43 +01:00
khancyr
ec2ea1c903 GCS_MAVLink: move send_proximity to GCS common code (NFC)
Also clean two comments
2017-07-24 13:44:43 +01:00
Andrew Tridgell
4ca3546551 SRV_Channel: added SERVO_DEF_RATE parameter
this allows for the default rate of servo outputs to be set. This is
needed for some planes where 50Hz isn't enough (eg. tailsitters)
2017-07-24 14:07:28 +10:00
Andrew Tridgell
5b43698e25 HAL_PX4: added rcout set_detault_rate() 2017-07-24 14:07:28 +10:00
Andrew Tridgell
0188d6463d AP_HAL: added rcout set_detault_rate() 2017-07-24 14:07:28 +10:00
Kevin Lopez Alvarez
df406c4389 AP_Compass : increase max possible offset 2017-07-24 13:48:20 +10:00
Kevin Lopez Alvarez
17f2393c1b AP_Compass: Decrease LIS3MDL ODR and timer 2017-07-24 13:48:20 +10:00
Kevin Lopez Alvarez
16a96b0643 HAL_PX4: Adjust SPI params for ppro
Add SPI prescalers for 180 MHz and decrease LIS3MDL SPI speed
2017-07-24 13:48:20 +10:00
Kevin Lopez Alvarez
08b531e6a8 AP_Compass: LIS3MDL correct orientation 2017-07-24 13:48:20 +10:00
Kevin Lopez Alvarez
cf8c1c2665 AP_Compass: Remove comments and use correct board number 2017-07-24 13:47:44 +10:00
Kevin Lopez Alvarez
a5a5bd3a95 AP_BoardConfig: Remove comments and use correct board number 2017-07-24 13:47:06 +10:00
Kevin Lopez Alvarez
ca3627c140 AP_InertialSensor: add ppro support 2017-07-24 13:47:06 +10:00
Kevin Lopez Alvarez
88958b2dbf HAL_PX4: add ppro support 2017-07-24 13:47:06 +10:00
Kevin Lopez Alvarez
1467daee2a AP_Compass: add ppro support
disable lis3mdl for now
2017-07-24 13:47:06 +10:00
Kevin Lopez Alvarez
d6d1a3e08c AP_HAL_PX4: initial FMUv4pro support 2017-07-24 13:45:37 +10:00
Kevin Lopez Alvarez
fb6f368575 AP_HAL: initial FMUv4pro support 2017-07-24 13:45:37 +10:00
Kevin Lopez Alvarez
a51bf8c918 AP_BoardConfig: initial FMUv4pro support 2017-07-24 13:45:37 +10:00
Kevin Lopez Alvarez
d0ec5a6111 AP_BattMonitor: initial FMUv4pro support 2017-07-24 13:45:37 +10:00
Kevin Lopez Alvarez
18dab4829a AP_Baro: initial FMUv4pro support 2017-07-24 13:45:37 +10:00
Andrew Tridgell
401a6f5373 AP_BoardConfig: fixed FMUv1 IO update
when doing an IO firmware update uartC is used to talk to the IO
bootloader. We need to close uartC to prevent corruption of the
bootloader protocol. The uart is automatically re-opened when it is
needed
2017-07-22 16:25:17 +10:00
Michael du Breuil
126296b61d AP_Arming: Compass calibration running is a pre arm failure, rather then an arming failure 2017-07-21 13:38:50 +09:00
Peter Barker
1fd4eb4bfb DataFlash: do not send in-progress messages back to streaming GCSs 2017-07-20 14:57:54 +01:00
Peter Barker
90c2db119e DataFlash: send log data on requesting channel only 2017-07-20 14:57:54 +01:00
Peter Barker
954eda990a AP_Arming: prepare log for arming and check it is ready
Also add comment that this should be the last check to be made
2017-07-19 16:37:28 +01:00
Peter Barker
0769432e63 DataFlash: move log-write-started logic to be backend-specific 2017-07-19 16:37:28 +01:00
Peter Barker
1f0a14ab33 DataFlash: add PrepForArming method 2017-07-19 16:37:28 +01:00
Peter Barker
31083653b2 DataFlash: examples: move starting of new logs into DataFlash 2017-07-19 16:37:28 +01:00
Francisco Ferreira
a1115ba5d0
DataFlash: move some code from WritesOK into a new ShouldLog method 2017-07-19 16:37:21 +01:00
Peter Barker
b572c13ca9 DataFlash: move starting of new logs into DataFlash 2017-07-19 16:37:16 +01:00
Peter Barker
4234f4ef7a DataFlash: move _initialised into DataFlash_Backend 2017-07-19 16:37:16 +01:00
Peter Barker
999a5e6cda AP_Arming: correct bit used to indicate blended-gps-checking 2017-07-19 16:34:57 +01:00
Peter Barker
b8ddf8a289 AP_Arming: use HAL_HAVE_BOARD_VOLTAGE rather than magic-0 2017-07-19 16:34:57 +01:00
Dr.-Ing. Amilcar Do Carmo Lucas
b791fef7cb AP_GPS: Publish the number of satellites in the RTK correction messages, and the age of the RTK correction messages 2017-07-19 20:42:23 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas
ae47ac5a09 AP_GPS: implement missing "RTK number of satellites" and "RTK correction age" information in the GPS2_RAW MAVLink message 2017-07-19 20:42:23 +09:00
Dr.-Ing. Amilcar Do Carmo Lucas
059c213d19 AP_GPS: Improve comments and documentation (NFC) 2017-07-19 20:42:23 +09:00
Randy Mackay
cf47a0d563 AP_AdvancedFailsafe: minor formatting fix 2017-07-19 15:24:21 +09:00
Andrew Tridgell
732dc5984a AP_Compass: added COMPASS_TYPEMASK parameter
this allows driver type to be disabled, to avoid probing them and
wasting CPU on sensors that are not being used

This also moves UAVCAN compass to be detected last, as discussed in the
dev call
2017-07-19 15:53:22 +10:00
Michael du Breuil
5684a5dd36 AP_GPS: Only setup state's instance field during init 2017-07-18 21:21:50 +01:00
Michael du Breuil
52ddaa3e72 DataFlash: POS.RelOriginAlt should be NaN if unknown 2017-07-18 21:21:17 +01:00
Andrew Tridgell
82e7e44cc3 AP_GPS: fixed UAVCAN as 2nd GPS
This fixes the issue here:

  https://discuss.ardupilot.org/t/ac3-6-dev-dual-gps-issues/19172

thanks to Francisco for spotting the issue

this is tested with UAVCAN as 2nd GPS, ublox as primary
2017-07-18 18:57:55 +01:00
Peter Barker
eb1cf0e73a GCS_MAVLink: remove MSG_STATUSTEXT entirely 2017-07-18 16:12:59 +01:00
Michael du Breuil
e092a83ca2 AP_Landing: Deepstall: Allow requiring a minimum altitude to abort a landing 2017-07-17 08:43:50 -07:00
Michael du Breuil
202b40562f Landing: Fix bad deepstall parameter group 2017-07-17 08:43:50 -07:00
Michael du Breuil
8de96ee4a1 AP_Param: Check for duplicate group id's before handling groups 2017-07-17 08:43:50 -07:00
Peter Barker
06647cde2c GCS_MAVLink: move handling of PREFLIGHT_SET_SENSOR_OFFSETS up 2017-07-17 14:17:19 +01:00
Peter Barker
bd28bdd907 GCS_MAVLink: move handling of MAG_CAL command longs up 2017-07-17 14:17:19 +01:00
Peter Barker
6b53b5b5f3 AP_Compass: make handle_mag_cal_command return type stricter 2017-07-17 14:17:19 +01:00
Peter Barker
a7e57aa3fc GCS_MAVLink: move MAV_CMD_START_RX_PAIR handling to base class 2017-07-17 14:17:19 +01:00
priseborough
58d58b4eac AP_NavEKF3: Initialise EKF origin height to field elevation
Enables copters to set bit position 2 in the EK3_OGN_HGT_MASK parameter without having a large jump in reported local position height.
2017-07-17 02:22:02 +01:00
priseborough
ac568bae53 AP_NavEKF2: Initialise EKF origin height to field elevation
Enables copters to set bit position 2 in the EK2_OGN_HGT_MASK parameter without having a large jump in reported local position height.
2017-07-17 02:22:02 +01:00
priseborough
0827b13feb AP_NavEKF3: Fix default behaviour for height origin corrections
Previous default was to apply in-flight height origin changes to local position instead of to reported origin height. This caused problems with copters that took off before getting GPS lock.
2017-07-17 02:22:02 +01:00
priseborough
027552ef44 AP_NavEKF2: Fix default behaviour for height origin corrections
Previous default was to apply in-flight height origin changes to local position instead of to reported origin height. This caused problems with copters that took off before getting GPS lock.
2017-07-17 02:22:02 +01:00
Peter Barker
318861e824 GCS_MAVLink: move mavlink support for servo/relay up 2017-07-16 23:56:00 +01:00
Peter Barker
cfc8d7feba GCS_MAVLink: add common handling of mavlink command messages 2017-07-16 23:56:00 +01:00