Commit Graph

17552 Commits

Author SHA1 Message Date
Phillip Kocmoud
da8ecbe389 AP_Baro: support DPS280 on SPI 2019-07-10 17:00:40 +10:00
Andrew Tridgell
14ea46eaba AP_HAL: added DPS280 on SPI / added board type for mRoControlZeroF7 2019-07-10 17:00:40 +10:00
Phillip Kocmoud
46fca0d94c HAL_ChibiOS: added hwdef for mRoControlZeroF7 2019-07-10 17:00:40 +10:00
Andrew Tridgell
0cdd41cb35 HAL_ChibiOS: added missing pins for F777 2019-07-10 17:00:40 +10:00
Andrew Tridgell
2123117fe7 HAL_ChibiOS: switch to new IO firmware for fmuv5 2019-07-08 10:18:09 +09:00
Andrew Tridgell
45e994c1fb RC_Channel: added get_type() method 2019-07-08 10:18:09 +09:00
Andrew Tridgell
eaeebeba53 AP_IOMCU: fixup 2019-07-08 10:18:09 +09:00
Andrew Tridgell
7382fc6316 HAL_ChibiOS: support DSM bind on IOMCU 2019-07-08 10:18:09 +09:00
Andrew Tridgell
604da2d63e AP_IOMCU: sync with master IOMCU firmware
this has been well tested on master, and gives us support for DSM bind
among other things
2019-07-08 10:18:09 +09:00
Andrew Tridgell
c75862d0e6 AP_NavEKF3: don't use disabled gyros in opticalflow takeoff detection 2019-07-08 09:16:22 +09:00
Andrew Tridgell
0e4aad27c5 AP_NavEKF2: don't use disabled gyros in opticalflow takeoff detection 2019-07-08 09:16:22 +09:00
Andrew Tridgell
b74ae60058 AP_Mount: don't use disabled IMUs in solo gimbal code 2019-07-08 09:16:22 +09:00
Andrew Tridgell
33d0c5c08f AP_AHRS: only use enabled IMUs in DCM
honor the INS_USE parameters for DCM
2019-07-08 09:16:22 +09:00
Andrew Tridgell
00fa6b3666 AP_InertialSensor: zero accumulators on time step
this zeros the delta angle and delta velocity accumulators when a
sensor is unavailable for a period of 0.1s. This prevents garbage
values being passed into the EKF when a sensor dies and then becomes
available again some time later
2019-07-08 09:16:22 +09:00
Andrew Tridgell
e77471e2b3 AP_InertialSensor: added RC switch for killing IMUs 2019-07-08 09:16:22 +09:00
Andrew Tridgell
04e7baa4cd HAL_ChibiOS: cope with calling delay_microseconds_boost() multiple times
needed for updated IMU wait code
2019-07-08 09:16:22 +09:00
Andrew Tridgell
cfa0ccf672 AP_InertialSensor: try much harder to get all IMU samples
this we ensures we get new data for all active IMUs on each loop,
rather than sometimes returning with some IMUs not having data.

This matters as not having a sample on an IMU for a single loop can
cause an EKF IMU failover, which will degrade the learned bias
variances

The issue is usually only seen under high load, such as requesting a
loop rate beyond what the hardware is capable of
2019-07-08 09:16:22 +09:00
Andrew Tridgell
dbe09d68c2 AP_NavEKF3: added inactive bias learning
this allows for biases on inactive IMUs to be learned so that an IMU
switch within an EKF lane does not cause a jump in the IMU data
2019-07-08 09:16:22 +09:00
Andrew Tridgell
c53aaab0ca AP_NavEKF2: learn gyro biases for inactive gyros
this allows us to learn the gyro biases each lane would need if it had
to switch to another gyro due to a sensor failure. This prevents a
sudden change in gyro bias on IMU failure
2019-07-08 09:16:22 +09:00
Andrew Tridgell
7d4adf21eb AP_GPS: fixed u-blox F9 auto configuration
# Conflicts:
#	libraries/AP_GPS/AP_GPS_UBLOX.cpp
2019-07-06 08:42:37 +10:00
Andrew Tridgell
a53877ac43 AP_GPS_UBLOX: add support for TIMEGPS message. used to get gps week 2019-07-06 08:42:34 +10:00
Andrew Tridgell
eaa391d5bc AP_NavEKF3: force first EKF lane when disarmed
this ensures we consistently fly with EKF lane1 if it is healthy at
the point we arm. Otherwise the choice of lane will be a lottery.

This is important as many systems have quite different filtering and
vibration characteristics on their different IMUs. We by default
enable fast sampling only on the first IMU for example, which means
the 2nd and 3rd IMUs are more vulnerable to high freq causing
aliasing.
2019-07-04 09:51:13 +10:00
Andrew Tridgell
04602180ef AP_NavEKF2: force first EKF lane when disarmed
this ensures we consistently fly with EKF lane1 if it is healthy at
the point we arm. Otherwise the choice of lane will be a lottery.

This is important as many systems have quite different filtering and
vibration characteristics on their different IMUs. We by default
enable fast sampling only on the first IMU for example, which means
the 2nd and 3rd IMUs are more vulnerable to high freq causing
aliasing.
2019-07-04 09:51:13 +10:00
Andrew Tridgell
9dd60035a2 AP_NavEKF2: default EK2_MAG_EF_LIM to 50
this was supposed to be part of the original PR (agreed with Paul to
enable by default)
2019-06-11 13:25:08 +09:00
Andrew Tridgell
1930103002 AP_NavEKF2: constrain field by table after fusion
this should make for faster convergence
2019-06-11 13:25:08 +09:00
Andrew Tridgell
5ac757ad3a AP_NavEKF2: added EK2_MAG_EF_LIM parameter
this sets a limit on the difference between the earth field from the
WMM tables and the learned earth field inside the EKF. Setting it to
zero disables the feature. A positive value sets the limit in mGauss.
2019-06-11 13:25:08 +09:00
Andrew Tridgell
b752b62fbf AP_Compass: use new get_earth_field_ga() API 2019-06-11 13:25:08 +09:00
Andrew Tridgell
2284af577b AP_Declination: added get_earth_field_ga() interface
this gives a more convenient API for getting the earth field as a
vector
2019-06-11 13:25:08 +09:00
Andrew Tridgell
59669209fe HAL_ChibiOS: end scheduler boost on expected delay
we want timer thread to be higher priority than main thread while in a
long operation
2019-05-28 17:47:19 +09:00
Andrew Tridgell
9f26ae5e8c HAL_ChibiOS: fixed LEDs on new CUAVv5 revision
# Conflicts:
#	libraries/AP_HAL_ChibiOS/hwdef/CUAVv5/hwdef.dat
2019-05-28 17:47:19 +09:00
Andrew Tridgell
f167b65b1f HAL_ChibiOS: fixed LEDs on CUAVv5Nano
need to be opendrain
2019-05-28 17:47:19 +09:00
Andrew Tridgell
004ce407f4 AP_Notify: don't use pinMode for pixracer LEDs
this is needed for LEDs that are driven by 5V, which means they need
to use OPENDRAIN.
2019-05-28 17:47:19 +09:00
Jaaaky
ea4d34b75f AP_InertialSensor: fix accelcalsimple watchdog 2019-05-28 17:47:19 +09:00
Andrew Tridgell
06d796a2c8 HAL_PX4: added empty flash driver 2019-05-28 17:47:19 +09:00
Andrew Tridgell
c1000cfe2a HAL_ChibiOS: fixed merge errors with hal.flash usage 2019-05-28 17:47:19 +09:00
Andrew Tridgell
0e3183b3cf HAL_ChibiOS: use hal.flash API
# Conflicts:
#	libraries/AP_HAL_ChibiOS/Storage.cpp
#	libraries/AP_HAL_ChibiOS/Util.cpp
2019-05-28 17:47:19 +09:00
Andrew Tridgell
51223409be HAL_ChibiOS: fixed iomcu build with flash driver 2019-05-28 17:47:19 +09:00
Andrew Tridgell
25aaefa0e6 HAL_SITL: added empty flash driver 2019-05-28 17:47:19 +09:00
Andrew Tridgell
33eecbb696 HAL_Linux: added empty flash driver 2019-05-28 17:47:19 +09:00
Andrew Tridgell
c9eb9d8076 HAL_Empty: added empty flash driver 2019-05-28 17:47:19 +09:00
Andrew Tridgell
e4aae50e44 HAL_ChibiOS: implement flash driver 2019-05-28 17:47:19 +09:00
Andrew Tridgell
608fd54f62 AP_HAL: added hal.flash driver
needed for semaphore
2019-05-28 17:47:19 +09:00
Andrew Tridgell
2fbe6edf47 AP_HAL: added save/restore of attitude in backup registers 2019-05-28 17:47:19 +09:00
Andrew Tridgell
952ef7c361 HAL_ChibiOS: added save/restore of attitude in backup registers 2019-05-28 17:47:19 +09:00
Andrew Tridgell
46bb88173e AP_AHRS: added save/restore of attitude in backup registers 2019-05-28 17:47:19 +09:00
Andrew Tridgell
3bd1a08c5e HAL_ChibiOS: fixed build with older gcc 2019-05-28 17:47:19 +09:00
Andrew Tridgell
4fc4573f81 AP_AHRS: save/restore home to backup registers
restore on watchdog reset
2019-05-28 17:47:19 +09:00
Andrew Tridgell
db35064c95 HAL_ChibiOS: save/restore home position in backup registers 2019-05-28 17:47:19 +09:00
Andrew Tridgell
a42293b986 AP_HAL: added save/restore of home to backup registers 2019-05-28 17:47:19 +09:00
Andrew Tridgell
12dfccf65a AP_InertialSensor: prevent watchdog in accelcal 2019-05-28 17:47:19 +09:00
Andrew Tridgell
020ce245b9 HAL_ChibiOS: allow for delay in bootloader flash 2019-05-28 17:47:19 +09:00
Andrew Tridgell
3222084f2d HAL_ChibiOS: fixed watchdog timeout setting 2019-05-28 17:47:19 +09:00
Andrew Tridgell
756a629b24 GCS_MAVLink: added method to lockup autopilot
used for watchdog testing

# Conflicts:
#	libraries/GCS_MAVLink/GCS_Common.cpp
2019-05-28 17:47:19 +09:00
Andrew Tridgell
27aba29109 AP_Logger: prevent log erase from triggering watchdog
# Conflicts:
#	libraries/DataFlash/DataFlash_File.cpp
2019-05-28 17:47:19 +09:00
Andrew Tridgell
a378f2b8fa AP_Logger: force logging on an armed watchdog reset
and don't clear sdcard space
2019-05-28 17:47:19 +09:00
Andrew Tridgell
f217f504e5 HAL_ChibiOS: implement was_watchdog_armed() 2019-05-28 17:47:19 +09:00
Andrew Tridgell
44e3b20038 AP_HAL: added was_watchdog_armed()
allow decisions to be based on whether this is a watchdog reset and we
were armed
2019-05-28 17:47:19 +09:00
Andrew Tridgell
682362945c AP_BoardConfig: auto-restore safety state on watchdog reset
# Conflicts:
#	libraries/AP_BoardConfig/board_drivers.cpp
2019-05-28 17:47:19 +09:00
Andrew Tridgell
4edd270bd9 HAL_ChibiOS: added ability to restore safety state on watchdog reset
# Conflicts:
#	libraries/AP_HAL_ChibiOS/hwdef/common/stm32_util.c
2019-05-28 17:47:19 +09:00
Andrew Tridgell
92f12deb51 AP_HAL: added was_watchdog_safety_off()
used to restore safety state on watchdog reset
2019-05-28 17:47:19 +09:00
Andrew Tridgell
6c7fd8e9ed HAL_ChibiOS: change to 2s timeout on watchdog
a bit more of a safety net against false positives for stable release
2019-05-28 17:47:19 +09:00
Andrew Tridgell
6361482ba6 HAL_ChibiOS: fixed watchdog on H7 2019-05-28 17:47:19 +09:00
Andrew Tridgell
f4d8026d6d AP_Compass: flag compass cal as long expected delay 2019-05-28 17:47:19 +09:00
Andrew Tridgell
de2ae7ad24 HAL_ChibiOS: implement scheduler->expect_delay_ms()
# Conflicts:
#	libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp
#	libraries/AP_HAL_ChibiOS/Scheduler.h
2019-05-28 17:47:19 +09:00
Andrew Tridgell
2590457c75 AP_Logger: handle long delays in opening log files 2019-05-28 17:47:19 +09:00
Andrew Tridgell
a341eebe69 AP_HAL: added expect_delay_ms() to Scheduler
used to notify scheduler of long expected delay in main thread
2019-05-28 17:47:19 +09:00
Andrew Tridgell
8cd0133a4d HAL_ChibiOS: added commented out test code for watchdog 2019-05-28 17:47:19 +09:00
Andrew Tridgell
43dfc67b96 AP_Baro: skip cal on watchdog reset 2019-05-28 17:47:19 +09:00
Andrew Tridgell
69528a9892 AP_Airspeed: skip cal on watchdog reset 2019-05-28 17:47:19 +09:00
Andrew Tridgell
e105bf258c AP_InertialSensor: skip gyro cal on watchdog reset 2019-05-28 17:47:19 +09:00
Andrew Tridgell
0f0fdf1398 HAL_ChibiOS: implement was_watchdog_reset()
# Conflicts:
#	libraries/AP_HAL_ChibiOS/Util.h
2019-05-28 17:47:19 +09:00
Andrew Tridgell
44b6a70377 AP_HAL: added was_watchdog_reset()
# Conflicts:
#	libraries/AP_HAL/Util.h
2019-05-28 17:47:19 +09:00
Andrew Tridgell
4858506a0b HAL_ChibiOS: record reason for reset
allows us to tell if reset was due to watchdog
2019-05-28 17:47:19 +09:00
Andrew Tridgell
96923da60c HAL_ChibiOS: use BRD_OPTIONS to enable watchdog
# Conflicts:
#	libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp
2019-05-28 17:47:19 +09:00
Andrew Tridgell
78e234bb6f AP_BoardConfig: added BRD_OPTIONS
used to enable STM32 watchdog

# Conflicts:
#	libraries/AP_BoardConfig/AP_BoardConfig.cpp
#	libraries/AP_BoardConfig/AP_BoardConfig.h
2019-05-28 17:47:19 +09:00
Andrew Tridgell
a7906f9e42 HAL_ChibiOS: added IWDG watchdog support
this resets the MCU if the main loop stops for 1 second

# Conflicts:
#	libraries/AP_HAL_ChibiOS/HAL_ChibiOS_Class.cpp
2019-05-28 17:47:19 +09:00
Guglielmo
234b3391a9 AP_HAL_SITL: fix pthread SITL build on MacOS 2019-05-28 17:47:19 +09:00
Andrew Tridgell
d58bb700a3 HAL_ChibiOS: fixed brick2 valid status in POWR flags for fmuv5
and fixed sense of VBUS
2019-05-03 10:34:08 +10:00
Phillip Kocmoud
57f2f1488e AP_Compass: Increase default MAX compass offset
After discussing the @tridge and @rmackay9 it was suggested that raising the maximum allowable compass offset value would allow users of the LIS3MDL and possibly others with larger compass offsets to fly with the default setting. 

This has been deemed a fairly safe change that still allows for sufficient overhead to prevent saturation.
2019-04-30 12:42:14 +09:00
Michael du Breuil
35706def4d AP_GPS: Log reciever status to GPS SD card
This improves log analysis of bad GPS health messages when you have a
report of bad GPS health but lost the MAVLink message, or didn't have
access to the autopilot log with the information for some reason.
2019-04-30 10:48:59 +09:00
Michael du Breuil
94cc27a2f6 AP_GPS: Remove external event from GPS data stream
If the event pin floats, this can lead to UART congestion, causing the
EKF to reject the GPS data, and the vehicle will drift around the sky in
a most disturbing manner
2019-04-30 10:48:56 +09:00
Francisco Ferreira
09c210e10f AP_GPS: use proper macro in array sizes 2019-04-30 10:48:54 +09:00
Francisco Ferreira
75527ef567 AP_GPS: correct blending check 2019-04-30 10:48:51 +09:00
Francisco Ferreira
d88d8fc178 AP_GPS: fix out-of-bounds array access 2019-04-30 10:48:49 +09:00
Michael du Breuil
958b7866c9 AP_GPS: Ensure a lag value is always provided
The value may not be the optimal value for the driver, but we should
always try to provide a value for the caller
2019-04-30 10:48:46 +09:00
Andrew Tridgell
b1f441abd4 HAL_ChibiOS: mark SDIO and SDMMC IO as pullup
this is needed for boards such as PixhackV3 which don't have hardware
pullups. Thanks to Hongle for reporting this.
2019-04-30 10:48:00 +09:00
Randy Mackay
2d1e02fada AP_OpticalFlow: support cx-of on all boards 2019-04-30 10:47:49 +09:00
Andrew Tridgell
b26ae4594f HAL_ChibiOS: change CUAVv5Nano default PWM count to 11 2019-04-30 10:47:38 +09:00
Andrew Tridgell
fc86a7db11 HAL_ChibiOS: fixed CUAVv5Nano uarts 2019-04-30 10:47:36 +09:00
Andrew Tridgell
a9c868a154 HAL_ChibiOS: support for CUAVv5Nano board
F765 with no IOMCU
2019-04-30 10:47:34 +09:00
Andrew Tridgell
06cfdedfb2 HAL_ChibiOS: fixed fallback to microSD for storage
this is used when FRAM fails on a board with microSD support. The
double init caused the validate() in the FATFS code to fail
2019-04-30 10:47:31 +09:00
Andrew Tridgell
481a6ea570 AP_Rangefinder: probe all I2C buses for rangefinders 2019-04-30 10:47:28 +09:00
Andrew Tridgell
87ae7ac422 AP_InertialSensor: don't set INS_ENABLE_MASK to found IMUs
this is needed for detection of failed cubes
2019-04-24 12:24:12 +10:00
Andrew Tridgell
edffc3001b AP_AHRS: ensure AHRS never uses an unhealthy gyro 2019-04-24 11:47:56 +10:00
Jonathan Challinger
c630a87e37 AP_BoardConfig: add targetted check for cube black internal sensors 2019-04-24 11:47:56 +10:00
Jonathan Challinger
10c930d62d AP_Baro: make crc4 a static member of AP_Baro_MS56xx 2019-04-24 11:47:56 +10:00
Jonathan Challinger
b02d58444f AP_HAL_ChibiOS: add define HAL_CHIBIOS_ARCH_CUBEBLACK to cubeblack hwdef 2019-04-24 11:47:08 +10:00
Andrew Tridgell
a9b5a0fea0 AC_WPNav: prevent I term buildup during landing
this prevents I term buildup in the XY velocity controller during
landing. This to account for the EKF giving a non-zero horizontal
velocity when we have touched down. The I term buildup in the XY
velocity controller can lead to the attitude error going above the
level for disabling the relax function as the throttle mix is
changed. That results in large motor outputs which can tip over the
vehicle after touchdown.

Thanks to Leonard for the suggestion
2019-02-27 20:06:15 +09:00
Andrew Tridgell
6668a2e602 AP_RangeFinder: fixed lightware serial with LW20 lidar
it needs a longer serial write to force it to serial mode from i2c
2019-02-27 20:06:06 +09:00
Andrew Tridgell
f04efe7985 HAL_ChibiOS: allocate threads from any heap
this fixes a failure on MatekF405-Wing where it fails to allocate the
SPI thread for the IMU
2019-02-27 11:59:45 +11:00