Commit Graph

30744 Commits

Author SHA1 Message Date
Andrew Tridgell e2041b0ae7 AP_Scripting: fixed float register save/restore in setjmp/longjmp
the register save must happen before the setjmp() call, which means
outside of the LUAI_TRY() macro. We also should be saving all 32
floating point registers
2024-05-31 09:44:38 +10:00
Peter Barker 763712a04a AP_GPS: correct uBlox M10 configuration on minimised boards 2023-11-14 10:35:03 +11:00
Andrew Tridgell 7055abc269 AP_BattMonitor: fixed reset_remaining() for INAxxx and LTC2946
these can use the generic reset_remaining() call in the backend
2023-08-16 08:24:06 +09:00
Andrew Tridgell 544e38cf82 AP_GPS: fixed RTK injection when first module is a BASE
this is a partial backport of #24132 which fixes RTK injection when
the 1st GPS module is a DroneCAN RTK rover. Without this change RTCM
injection for RTK fix on the base will only work if it happens to come
up as the first module
2023-08-16 08:24:06 +09:00
Andrew Tridgell 16d617c62d AP_Arming: fixed auto-enable of fence with forced arm
when a user forced armed and had FENCE_AUTOENABLE=3 for enable on
arming then the fence did not enable
2023-08-16 08:24:06 +09:00
bugobliterator e6280e6d37 AP_Scripting: stash and restore FPU register context in LUAI_TRY
this fixes an issue where a lua library function triggers an exception
after it does a math operation which changes the floating point
registers on M7 MCUs (such as STM32H7). An example is math.random()
which calls math_random(), which pre-calculates a double value before
checking if the arguments to the call are valid. When it then checks
and finds invalid values the exception longjmp does not restore the
floating point registers.
2023-08-16 08:24:06 +09:00
Andrew Tridgell b1505a5f7a AP_NavEKF3: fixed race condition in updateFilterStatus()
filter status was initially set to zero then updated. This interacts
with the IMU filtering code which checks filter status from a
different thread to determine active_EKF_type(). When the race
condition is hit then the IMU we are running notch filters on changes
for a single sample, causing a notch filter glitch
2023-08-16 08:24:06 +09:00
Andrew Tridgell ffdbf532c4 AP_BoardConfig: fixed documentation of safety options
on and off were reversed
2023-05-31 09:51:29 +09:00
Andrew Tridgell ab43186189 AP_ICEngine: fixed a bug engine control when running
if you have a mission item for engine control with delayed start at
height and the engine is already running them it would put the ICE
subsystem into a state where it would no longer start the engine

It was actually 2 bugs:

 - an engine control to do a height delayed start should be ignored if
   the engine is already running. This prevents an engine control to
   start the engine from stopping the engine

 - a start_chan high should always try to start the engine
   immediately, even if in the wait state
2023-05-25 11:33:10 +10:00
Andrew Tridgell c868ac5fe4 AP_RCProtocol: return true on initial protocol detection
we need to tell the IO firmware that a byte was consumed when we first
detect a protocol as otherwise the next bad byte on DSM will lock us
on the DSM port
2023-05-25 11:33:10 +10:00
Andrew Tridgell 71cbcb49f5 AP_IOMCU: fixed issue with not regaining RC input
this fixes an issue where when you lose R/C input on IOMCU that you
may not regain it when R/C comes back.

The issue stems from us still processing the DSM uart when we are
using the SD3 "SBUS" uart for RC input, and still doing the switch of
the SD3 config every 2 seconds.

When we are not searching for a new protocol we should not be changing
UART config
2023-05-25 11:33:10 +10:00
bugobliterator 99ff763995 AP_InertialSensor: fix hardfault in BatchSampler 2023-05-25 11:33:10 +10:00
Paul Riseborough 255df7c8b5 AP_NavEKF3: Increase delta velocity bias state process noise
Required due to state variance collapse on ground with some systems using RTK GPS.
2023-05-25 11:33:10 +10:00
Paul Riseborough b6b5a0121a AP_NavEKF3: Strengthen recovery from bad delta velocity bias learning 2023-05-25 11:33:10 +10:00
Paul Riseborough 119a8bb357 AP_NavEKF3: Increase default value of EK3_ABIAS_P_NSE
This is required because some hardware setups with RTK GPS have experienced a collapse of the delta velocity state variances.
2023-05-25 11:33:10 +10:00
Paul Riseborough 96546804b4 AP_NavEKF3: Retune and fix delta velocity bias state variance protection 2023-05-25 11:33:10 +10:00
Andy Piper fc7f182214 AP_NavEKF: ensure gyro biases are numbers
avoid errors during compass mot
2023-05-25 11:33:10 +10:00
Peter Barker 708124183d AP_EFI: use uint16_t to store offset
prevents infinite loop if there are exactly 255 bytes ready to read
2023-05-25 11:33:10 +10:00
Andy Piper a86e18a09d AP_HAL_ChibiOS: ensure the rcout TIM_UP DMA request source is re-instated after cancellation
This fixes a bug in bdshot whereby dma cancellation could result in the wrong DMA channel
being used for dshot output and hence motors stopping
2023-03-27 11:11:53 +09:00
Andy Piper b936b474ed AP_HAL_ChibiOS: ensure that DMA source is correct on DMA send for rcout 2023-03-27 11:11:53 +09:00
Andrew Tridgell 411a15699a HAL_ChibiOS: switched to 64 bit maths for DShot timings
this fixes a timer wrap bug at 71 minutes after boot that impacts
bdshot
2023-03-26 11:53:36 +09:00
bugobliterator 3d1e280e84 AP_HAL_ChibiOS: add CubeOrangePlus-bdshot hwdef 2023-03-22 18:29:17 +11:00
Peter Barker 9fcb678b93 AP_Mount: rename local _chan to chan in Gremsy methods
based on PR feedback
2023-03-02 14:56:47 +09:00
Peter Barker 3c8e89f540 GCS_MAVLink: add method to get link (not just channel number) for mavtype and compid 2023-03-02 14:56:47 +09:00
Peter Barker a613ae8d1d AP_Mount: correct double-mapping of port to channel number
set_message_interval takes a port number, not a channel number (it was originally written as an internal function, after all).  Before this patch we were double-mapping from one to the other.  That works so long as the port you are mapping also corresponds to the chanel number - which it will, for example, if you are using serial2 with both serial0 and serial1 also set to mavlink.  If you set serial5_protocol to 2 an attempt to use it for controlling a gremsy it will *not* work because we map into backwards twice.
2023-03-02 14:56:47 +09:00
Reilly Callaway 865da3a0f0 AP_PiccoloCAN: Fix ESC voltage and current telem scaling 2023-03-02 14:56:47 +09:00
bugobliterator 0458d424af AP_HAL_ChibiOS: add HAL_WITH_MCU_MONITORING define for H757 2023-03-02 14:56:47 +09:00
Randy Mackay 71361ac598 AP_Mount: servo mount yaw handling fix 2023-03-02 14:56:47 +09:00
Andrew Tridgell 0989273250 AP_AHRS: fixed earth frame accel for EKF3 with significant trim 2023-03-02 14:56:47 +09:00
Andy Piper 15b9bf6820 AP_HAL_ChibiOS: enable VTX power on MambaF405 2022 2023-03-02 14:56:47 +09:00
Iampete1 969ee8be2c AP_TECS: protect against low airspeed in reset 2023-03-02 14:56:47 +09:00
Andrew Tridgell 6978df3348 AP_GPS: don't try and configure M10 options on non-M10 GPS
this fixes a pre-arm failure "GPS 1 failing configuration checks" on
non-M10 GPS modules, including AP_Periph

it also adds the ublox unconfigured msgs to the DroneCAN GNSS.Status
errors field for easier diagnosis of this type of issue in the future
2023-03-02 14:56:47 +09:00
Andrew Tridgell 92f9b7e11f AP_Scripting: disable PWMSource in scripts for 4.3.4
this avoids the interrupt handling bug. Proper fix in 4.4.x
2023-03-01 11:57:54 +09:00
Andy Piper 2ce8005f22 AP_HAL_ChibiOS: probe external compasses on foxeer reaper f745 2023-02-14 16:30:46 +09:00
Andy Piper 79e1f4eca1 AP_HAL_ChibiOS: enable VTX power on MambaH743v4 2023-02-14 16:29:45 +09:00
bugobliterator 57e702ae31 AP_HAL_ChibiOS: add support for CubeOrangePlus BG edition 2023-02-14 16:22:17 +09:00
Andrew Tridgell daec6e6ee3 AP_IOMCU: fixed an issue with double reset of IOMCU
if the IOMCU resets twice in quick succession then the code that
restores the safety state while flying can fail, leading to the
aircraft trying to continue flying with safety on

This results from two issues:

- a race in handling the last_safety_off variable
- the fact that plane sets the soft_armed state based on safety state
2023-02-14 16:22:17 +09:00
Bob Long 3fbeda3e1d AP_Baro: fix bug in alt error arming check
get_altitude_difference already subtracts MSL altitude
2023-02-11 09:42:55 +09:00
Andrew Tridgell a4835634e0 RC_Channel: disable FFT notch tune feature
See https://github.com/ArduPilot/ardupilot/pull/22686
2023-02-11 09:42:55 +09:00
Andy Piper 7408b46fdb AP_HAL: ensure the DSP tracked peaks do not overflow the buffer 2023-02-11 09:42:55 +09:00
rishabsingh3003 4fd2288082 AC_Precland: Add option to resume precland after manual override 2023-02-11 09:42:55 +09:00
Andrew Tridgell 886210f8f1 AP_CANManager: add an output buffer for MAVCAN
this fixes firmware update of peripheral nodes using MAVCAN
2023-02-11 09:42:55 +09:00
Peter Barker fd84805f68 AP_Logger: avoid logging duplicate FMT/UNIT/FMTU/MULT messages
Failing due to being out of time meant we wouldn't incremement the counter, even though we'd emitted the item.

it is important we try to send something, so move this check to be after we increment whichever counter we are using.
2023-02-11 09:42:55 +09:00
Andrew Tridgell 12721f37b7 AP_OpenDroneID: set EMERGENCY status on crash or chute deploy
RemoteID modules are required to set EMERGENCY status on uncontrolled
descent or crash. This fixes our implementation to do that, either via
existing vehicle crash checking code or via a parachute release
2023-02-11 09:42:55 +09:00
Andrew Tridgell c483b26737 AP_Compass: fixed zero compass diagonals
this fixes a regression from 4.2 to 4.3.

previously we automatically set the diagnoals to 1,1,1 if they were
0,0,0. We don't do that any more. I was helping a user who had copied
an old config with 0,0,0 for diagonals and did not understand two
things:

- the compass did not work in 4.3
- large vehicle mag cal didn't work
2023-02-11 09:42:55 +09:00
Randy Mackay 81813f8015 GCS_MAVlink: send_autopilot_state_for_gimbal_device sends ef z-axis rate target 2023-02-11 09:42:55 +09:00
Randy Mackay e678a9666d AP_Vehicle: replace get_rate_bf_targets with get_rate_ef_targets 2023-02-11 09:42:55 +09:00
Randy Mackay f8414200c7 AC_AttitudeControl: add get_rate_ef_targets accessor 2023-02-11 09:42:55 +09:00
Andrew Tridgell 518388c9c3 AP_RCProtocol: on IOMCU don't allow protocol to change once detected
this prevents a crash where in-flight noise causes an incorrect
protocol detection, such as DSM for a SBUS input
2023-02-11 09:42:55 +09:00
Andrew Tridgell af3f492473 AP_Scripting: fixed alt frame error in ship landing
if terrain follow is enabled then this would result in mixing a
terrain alt with an absolute alt, resulting in attempts to descend to
a negative alt
2023-01-20 09:58:14 +09:00