Commit Graph

43716 Commits

Author SHA1 Message Date
Harshit Kumar Sankhla 8507c7d3b9 SITL: add some airspeed, baro, gps noise simulation parameters
also some rearrangements in the parameter
lists to make things look better
2020-08-27 20:20:51 +10:00
Harshit Kumar Sankhla 09620ee1e7 AP_HAL_SITL: use airspeed noise as pressure noise
this emulates real sensors that have higher airspeed noise at
lower speeds, also change airspeed offset to a sitl parameter
2020-08-27 20:20:51 +10:00
Andrew Tridgell 505953bdb2 AP_Airspeed: added get_num_sensors() 2020-08-27 20:20:51 +10:00
Andrew Tridgell 326ab0d7b8 AP_Baro: added get_primary() method 2020-08-27 20:20:51 +10:00
Harshit Kumar Sankhla edc3709653 AP_NavEKF3: implement sensor affinity using EK3_AFFINITY parameter
this allows the EKF core index to be used to select a GPS/baro/mag
instance. This is an alternative to GPS blending that allows EKF lane
switching to be used to select the right combination of GPS and IMU
add logging to XKFS message
2020-08-27 20:20:51 +10:00
Harshit Kumar Sankhla 9588a68e1b AP_Logger: added logging of baro, gps, airspeed to XKFS
new XKFS message for "XKF Sensor"
2020-08-27 20:20:51 +10:00
Harshit Kumar Sankhla d7edc946b6 AP_NavEKF3: Relative Error based Lane-Switching
Improvments to the lane selection logic, we accumulate error for each
EKF lane relative to the primary for a more robust core selection
2020-08-27 20:20:51 +10:00
Harshit Kumar Sankhla 56cbcb42ee AP_NavEKF2: Add core relative error and errorscore logging in NKF3 packet
TODO : Port lane switching logic from EKF3 to make use of these terms
Since both share the same NKF3 log structure, needed to do this.
Just log 0 as of.
2020-08-27 20:20:51 +10:00
Harshit Kumar Sankhla 775a40e4cc AP_Logger: Add RErr and ErSc fields to NKF3 log
RErr (Core Relative Errors) and ErSc (Core Error Scores)
2020-08-27 20:20:51 +10:00
Pierre Kancir 16b499d0f6 Autotest: allow to select which GPS flags we want to wait for 2020-08-27 09:11:13 +10:00
Iampete1 c265a38344 Copter: add gripper release FS_Option 2020-08-26 17:58:24 +09:00
Pierre Kancir af1bdcfdfc AP_Scipting: fix memleak on generator 2020-08-26 17:06:23 +10:00
Rishabh caf5bfed59 AC_Avoid: Added new OA type (Dijkstra + BendyRuler fusion) 2020-08-26 15:43:46 +09:00
Peter Barker 80bee19bc9 autotest: correct race condition in button test
A BUTTON_CHANGE may have been emitted after we send the parameter but before it is processed by the autopilot
2020-08-26 13:22:14 +10:00
Peter Barker 3ae83d70b1 autotest: ensure df log is present for rangefinder tests
there may not be a current onboard log present if we've just rebooted
2020-08-26 11:59:11 +10:00
Patrick José Pereira 6e24880f87 AP_Common: missing: Add definition for strndupa
`strndupa` is only available when using the GNU GCC suite.
With this definition is possible to use the MUSL compiler.

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-08-25 07:15:00 -07:00
Patrick José Pereira 5746943f50 AP_HAL_Linux: Use pthread_self in place of _ctx
Avoid aproblem where _ctx is initialized in a race condition.

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-08-25 07:15:00 -07:00
Patrick José Pereira 248daa85a1 AP_HAL_Linux: Scheduler: Use pthread_* over sched_* calls for setschedparam
musl implements `sched_*` following the posix standard,
where `sched_setschedule` is used for process scheduling.
Linux implementation defines `sched_*` functions based in
the thread scheduler and not with the process.

Using `pthread_*` should be used to follow such standard.

Ref: https://pubs.opengroup.org/onlinepubs/9699919799/

From: https://www.openwall.com/lists/musl/2016/03/01/5

> ... Linux does not provide a way
> to set scheduling parameters for a _process_, only for threads. The
> sched_setscheduler syscall is documented as taking a pid but actually
> takes a thread id and only operates on that thread. glibc just ignores
> this and provides sched_* functions that do the wrong thing.

This can be fixed by using `pthread_setschedparam` and requesting the current
thread id via `pthread_self`.

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-08-25 07:15:00 -07:00
Patrick José Pereira 11c19a2dde AP_HAL: RCOutput_Tap_Linux: Include arm/ioctls.h
Add missing include for TCGETS2 while compile with MUSL

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-08-25 07:15:00 -07:00
Pierre Kancir 420587fb68 Tools: logger_metadata fix relative dir search 2020-08-25 20:01:27 +10:00
Pierre Kancir a181fcf8a2 Autotest: common: put generated parameter and LogMessage files into buildlogs directory 2020-08-25 20:01:27 +10:00
Pierre Kancir f6f418605f .gitignore: add LogMessages output to ignore list 2020-08-25 20:01:27 +10:00
Peter Barker a523868b33 autotest: fix Beacon test 2020-08-25 17:21:50 +10:00
Andrew Tridgell 155b39bab3 autotest: added loiter-to-alt test mission 2020-08-25 10:39:18 +10:00
Andrew Tridgell bf0f359445 Plane: fixed LOITER_TO_ALT with terrain target
many thanks to Pompecukor for finding this!

Fixes #14951
2020-08-25 10:39:18 +10:00
Randy Mackay 46a7e96c48 AP_NavEKF3: readRngBcnData avoids array overflow from beacon count 2020-08-25 09:38:10 +09:00
Randy Mackay 660579f2f4 Tools: fix copter beacon test params 2020-08-25 09:38:10 +09:00
Randy Mackay b314195f6e AP_NavEKF3: minor spelling fix 2020-08-25 09:38:10 +09:00
Randy Mackay b86e16e927 AP_NavEKF3: readRngBcnData gets minor formatting fix 2020-08-25 09:38:10 +09:00
Randy Mackay 384029d278 AP_NavEKF3: rngBcnDataNew made local 2020-08-25 09:38:10 +09:00
Randy Mackay 8c877f02af AP_NavEKF3: shrink beacon arrays and add assert 2020-08-25 09:38:10 +09:00
Randy Mackay d292ba028a AP_NavEKF3: increase beacon buffer to imu + 1 2020-08-25 09:38:10 +09:00
Randy Mackay ce55af4d95 AP_Beacon: fix sitl position to be NED 2020-08-25 09:38:10 +09:00
Randy Mackay 276e56e618 AP_Beacon: update comments to clarify frame
also minor formatting fix
2020-08-25 09:38:10 +09:00
Peter Barker 716e7622be AP_Logger: log RCIN channels 14 and 15 in RCI2 2020-08-25 10:27:00 +10:00
Andrew Tridgell e5e092d077 AP_AHRS: check EKF status for having horizontal position estimate
this will allow a fixed wing to fall back to DCM if the EKF stops
providing an absolute position while we have 3D GPS lock. The
using_gps flag is not enough, as lagged GPS data can lead to the EKF
stopping fusing when the data is behind the fusion time horizon. In
that case EKF3 gives using_gps=1 but sets horiz_pos_abs=0
2020-08-25 10:22:05 +10:00
Andrew Tridgell 87c7781be2 AP_GPS: show GPS as unhealthy if it is lagged too much
this detects GPS data lag, and if 5 samples in a row are lagged by
more than 50ms beyond the expected lag for the GPS then we declare the
GPS as unhealthy.

This is useful to detect users who have asked for more data from the
GPS then it can send at the baudrate that is being used. The case that
led to this path was a F9 GPS with GPS_RAW_DATA=1 at 115200 baud. In
that case the UART data is quickly lagged by over 1s
2020-08-25 10:22:05 +10:00
Andrew Tridgell 3f630d3d43 HAL_SITL: use GPS accuracy params 2020-08-25 10:22:05 +10:00
Andrew Tridgell 91b4830801 SITL: added SIM_GPS_ACC parameters 2020-08-25 10:22:05 +10:00
Andrew Tridgell 36442dc9b0 HAL_ChibiOS: added Matek CAN GPS
supports GPS, baro, mag and airspeed
2020-08-25 09:59:15 +10:00
Andrew Tridgell 4c4c3d467b HAL_ChibiOS: added f103-Airspeed sensor
for Matek CAN airspeed sensor
2020-08-25 09:59:15 +10:00
Andrew Tridgell a1b5953927 Tools: added bootloader for f103-Airspeed 2020-08-25 09:59:15 +10:00
Andrew Tridgell 61f06f089e Tools: added bootloader for f303-MatekGPS 2020-08-25 09:59:15 +10:00
Andrew Tridgell a20d3fed94 AP_Airspeed: allow hwdef override of airspeed default type 2020-08-25 09:59:15 +10:00
Andrew Tridgell fdff355a8a AP_IOMCU: fixed handling of RC ignore failsafe option
this allows for ignoring SBUS failsafe on boards using an IOMCU
2020-08-25 09:53:26 +10:00
Siddharth Purohit 5cd6175d94 AP_Compass: fix reordering compass devid by priority at boot 2020-08-25 08:30:04 +10:00
Peter Barker 69d246d63e autotest: add test for priority-based compass reordering 2020-08-25 08:30:04 +10:00
Peter Barker bb697dd4b9 autotest: avoid using mavproxy for testing message intervals 2020-08-24 19:33:37 +10:00
Randy Mackay 886a7d44a7 AP_NavEKF3: allow switch to ExtNav from optflow 2020-08-24 16:52:34 +09:00
Andrew Tridgell 10eeea31e8 Tools: rebuild IO firmware 2020-08-24 16:32:35 +10:00