Compare commits

...

421 Commits

Author SHA1 Message Date
Andrew Tridgell
3e039eb372 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-29 10:12:32 +10:00
Andrew Tridgell
d23247b901 Tools: force pymonocypher version 2024-05-29 10:11:25 +10:00
Andrew Tridgell
16b7838229 Plane: prepare for 4.4.4 release 2023-12-19 15:06:27 +11:00
Andrew Tridgell
65bcfb6b27 Plane: release notes for 4.4.4 2023-12-19 15:05:45 +11:00
Randy Mackay
aa330b436f Copter: version to 4.4.4 2023-12-19 15:05:03 +11:00
Randy Mackay
6a1c6b370a Copter: 4.4.4 release notes 2023-12-19 15:05:03 +11:00
Randy Mackay
636a285216 Rover: version to 4.4.0 2023-12-19 15:05:03 +11:00
Randy Mackay
e443bde8fc Rover: 4.4.0 release notes 2023-12-19 15:05:03 +11:00
Randy Mackay
788d5fd1a5 Copter: version to 4.4.4-beta1 2023-12-05 20:23:49 +11:00
Randy Mackay
bb9f20c9c5 Copter: 4.4.4-beta1 release notes 2023-12-05 20:23:49 +11:00
Randy Mackay
8a1fc6d507 Rover: version to 4.4.0-beta11 2023-12-05 20:23:49 +11:00
Randy Mackay
d10e6174bc Rover: 4.4.0-beta11 release notes 2023-12-05 20:23:49 +11:00
Randy Mackay
58ef9b3755 Plane: version to 4.4.4-beta1 2023-12-05 20:23:49 +11:00
Randy Mackay
5c68af36f9 Plane: 4.4.4-beta1 release notes 2023-12-05 20:23:49 +11:00
Peter Barker
a96c9efe93 Tools: clamp empy to version 3
API and syntax hanges make 4 problematic
2023-12-05 20:23:49 +11:00
Peter Barker
d6666caa29 .github: clamp empy to version 3
API and syntax hanges make 4 problematic
2023-12-05 20:23:49 +11:00
Andrew Tridgell
610b7135bd AP_UAVCAN: don't update hobbywing ESC table while armed
some hobbywing ESCs have a bug where requesting the ID table can cause
the ESC to stutter
2023-12-05 20:23:49 +11:00
Andy Piper
378d586feb AP_HAL_ChibiOS: return success status from serial_led_send and set_serial_led_rgb_data 2023-12-05 20:23:49 +11:00
Andy Piper
586e8f756f AP_HAL: return success status from serial_led_send and set_serial_led_rgb_data 2023-12-05 20:23:49 +11:00
Andy Piper
a333587b58 AP_SerialLED: return success status from send and set_RGB 2023-12-05 20:23:49 +11:00
Andy Piper
2750bda430 AP_Scripting: add success status to serialLED:send and serialLED:set_RGB 2023-12-05 20:23:49 +11:00
Andy Piper
7d5b86958b AP_HAL_SITL: return success status from serial_led_send and set_serial_led_rgb_data 2023-12-05 20:23:49 +11:00
Andy Piper
a4b543e4ea AP_HAL_ChibiOS: correct neopixel bitwidth
Use 64-bit timestamps for dshot send checks
2023-12-05 20:23:49 +11:00
Andy Piper
204a993963 AP_HAL: correct neopixel bitwidth 2023-12-05 20:23:49 +11:00
Randy Mackay
df7c432c2e Copter: fix 440-beta1 release notes
TKOFF_TH_MAX was not included in Copter-4.4.0
2023-12-05 20:23:49 +11:00
Andy Piper
f398756ffe AP_HAL_ChibiOS: fix race condition in sending serial LED data 2023-12-05 20:23:49 +11:00
bugobliterator
0f18844c7a AP_Stats: initialise parameter defaults 2023-12-05 20:23:49 +11:00
Randy Mackay
6e124fda8f Rover: boats keep navigating at WP if loiter fails 2023-12-05 20:23:49 +11:00
Randy Mackay
bc61e2ab61 AR_WPNav: pos control updated during pivots 2023-12-05 20:23:49 +11:00
Randy Mackay
b4b58a90a1 Rover: auto navigates while stopped 2023-12-05 20:23:49 +11:00
Randy Mackay
218ba75bbb AR_PosControl: no min speed when stopping 2023-12-05 20:23:49 +11:00
Randy Mackay
fa6a7abe8a AP_Scripting: simplify Rover quick tune
Only tunes FF.  P and I are set as ratio to FF
2023-12-05 20:23:49 +11:00
Iampete1
926896eb3a AP_Param: check dynamic param tables are avalable before adding a param 2023-12-05 20:23:49 +11:00
Andy Piper
3748192173 hwdef: fixes for SpeedyBee F4 v4 on 4.4 2023-12-05 20:23:49 +11:00
Andy Piper
f9fac9093f bootloaders: SpeedyBeeF405v4 2023-12-05 20:23:49 +11:00
Andy Piper
e6aa357fb4 AP_HAL_ChibiOS: add support for SpeedyBeeF405v4 2023-12-05 20:23:49 +11:00
Peter Barker
cc115a661f hwdef: correct compilation of CubeOrange-SimOnHW
../../libraries/AP_InertialSensor/AP_InertialSensor_config.h:20:2: error: #error "INS_AUX_INSTANCES must be zero if INS_MAX_INSTANCES is less than 3"
   20 | #error "INS_AUX_INSTANCES must be zero if INS_MAX_INSTANCES is less than 3"
      |  ^~~~~
2023-12-05 20:23:49 +11:00
Randy Mackay
b6d607c2b0 AP_Torqeedo: error code reporting fix 2023-12-05 20:23:49 +11:00
Martin Luessi
9fab634f7a RADIX2HD: Set HAL_I2C_INTERNAL_MASK 2023-12-05 20:23:49 +11:00
Andrew Tridgell
e2ccb1d49c AP_BattMonitor: fixed battery percentage with aux info
when we have aux battery information we had assumed the CAN device
would provide the battery remaining percentage. We should obey the "do
not use CAN SoC" with or without an AUX message

This fixes CAN battery monitors with a cell monitor
2023-12-05 20:23:49 +11:00
Martin Luessi
df1d9e0e7a AP_HAL_ChibiOS: RADIX2HD Probe external I2C compasses 2023-12-05 20:23:49 +11:00
Andy Piper
d4f8bc2ba3 Copter: make sure takeoff check checks the right ESC channels 2023-12-05 20:23:49 +11:00
Randy Mackay
dd1ecec79c Copter: version to 4.4.3 2023-12-05 20:23:49 +11:00
Randy Mackay
0faadb11b6 Copter: 4.4.3 release notes 2023-12-05 20:23:49 +11:00
Randy Mackay
d3b7dd24e7 Rover: version to 4.4.0-beta10 2023-12-05 20:23:49 +11:00
Randy Mackay
b5467ca03f Rover: 4.4.0-beta10 release notes 2023-12-05 20:23:49 +11:00
Peter Barker
b1219f5bef AP_Notify: add IS31FL3195 to default LED types 2023-11-16 17:59:38 +11:00
Peter Barker
d4f62e30b2 AP_Notify: document IS31FL3195 LED type for LED_TYPES parameter 2023-11-16 17:59:38 +11:00
Andrew Tridgell
8305ba6009 Plane: prepare for 4.4.3 release 2023-11-14 12:49:15 +11:00
Andrew Tridgell
db5515c60e Plane: update release notes for 4.4.3 2023-11-14 12:49:15 +11:00
Peter Barker
936e0ab1be AP_GPS: correct uBlox M10 configuration on minimised boards 2023-11-14 12:49:15 +11:00
Randy Mackay
3e19cf19b8 Copter: version to 4.4.3-beta1 2023-11-14 12:47:56 +11:00
Randy Mackay
26a3388f22 Copter: 4.4.3-beta1 release notes 2023-11-14 12:47:56 +11:00
Randy Mackay
8060b9a445 Rover: version to 4.4.0-beta9 2023-11-14 12:47:56 +11:00
Randy Mackay
061c188342 Rover: 4.4.0-beta9 release notes 2023-11-14 12:47:56 +11:00
Iampete1
fb50240723 Copter: verison to 4.4.2 2023-11-14 12:47:56 +11:00
Iampete1
8b5dd7bee4 Copter: 4.4.2 stable release notes 2023-11-14 12:47:56 +11:00
Randy Mackay
c48fc52e89 Copter: update 4.4.2-beta1 release notes 2023-11-14 12:47:56 +11:00
Randy Mackay
22d059f354 Rover: update 4.4.2-beta1 release notes 2023-11-14 12:47:56 +11:00
Andrew Tridgell
8fd36cb5e7 Plane: prepare for 4.4.3-beta1 2023-11-07 11:17:04 +11:00
Andrew Tridgell
8b3554c591 Plane: release notes for 4.4.3-beta1 2023-11-07 11:17:04 +11:00
yjuav
6797625bc6 hwdef: add YJUAV_A6SE_H743 board support (4.4 backport) 2023-11-07 11:17:04 +11:00
Andrew Tridgell
f24ee8f800 AP_ESC_Telem: expose update_telem_data for scripting 2023-11-07 11:17:04 +11:00
Andrew Tridgell
0852044e9e AP_Scripting: added bindings for telemetry data for ESCs
allows more complete ESC protocol implementation in scripting
2023-11-07 11:17:04 +11:00
Peter Barker
ae0fada9e6 GCS_MAVLink: correct mavlink result when airspeed not available
only in progress if we have started a task running
2023-11-07 11:17:04 +11:00
Peter Barker
f7767d9068 Plane: use origin-relative altitudes rather than home-relative 2023-11-07 11:17:04 +11:00
Andy Piper
a89c2cda6e bootloaders: BETAFPV-F405 bootloaders 2023-11-07 11:17:04 +11:00
Andrew Tridgell
763bbc509e hwdef: bugfixes for BETAFPV-F405 2023-11-07 11:17:04 +11:00
bugobliterator
8242a10e44 AP_HAL_ChibiOS: enable save/restore of SPI SCK pin during spiStop Start for CubeOrangePlus 2023-11-07 11:17:04 +11:00
bugobliterator
14093ab2a0 AP_HAL_ChibiOS: add option to set HAL_SPI_SCK_SAVE_RESTORE 2023-11-07 11:17:04 +11:00
bugobliterator
1f1c0714df AP_HAL_ChibiOS: fix mode setting for ICM45686 on CubeOrangePlus 2023-11-07 11:17:04 +11:00
bugobliterator
829fcf5f33 AP_HAL_ChibiOS: add support for saving and restoring SCK pin state
when SPI goes into undefined state during reset
2023-11-07 11:17:04 +11:00
Andrew Tridgell
6a97817fa6 AP_Mount: fixed SIYI parser bug
this caused lots of lost packets
2023-11-07 11:17:04 +11:00
Andrew Tridgell
36dabc0985 AP_GPS: implement the GPS_DRV_OPTION for ellisoid height in mode drivers
this allows a lot more drivers to use the GPS_DRV_OPTION but to use
ellisoid height. Particularly useful for DroneCAN GPS modules

using ellisoid height instead of AMSL is useful in some specialised
application
2023-11-07 11:17:04 +11:00
Hayden
4bc82e4b3e AP_Compass: fix AK09916 hangup issue 2023-11-07 11:17:04 +11:00
Andrew Tridgell
2ab583d80b AP_InertialSensor: fix for ICM42688 stuck gyro issue
these undocumented bits in register 0x4d control the "adaptive full
scale range" mode of the ICM42688. The feature is enabled by default
but has a bug where it gives "stuck" gyro values for short periods
(between 1ms and 2ms):, leading to a significant gyro bias at longer
time scales, enough to in some cases cause a vehicle to crash if it is
unable to switch to an alternative IMU

this fixes https://github.com/ArduPilot/ardupilot/issues/25025
2023-11-07 11:17:04 +11:00
Andrew Tridgell
0bbea732a0 Filter: protect against extremely low notch filter frequencies
an incorrectly configured ESC telemetry source can lead to a notch
running at very low frequencies. A simple example is a lua script like
this:

function update()
   esc_telem:update_rpm(12, 0, 0)
   return update, 10
end
return update()

where motor 12 is unused.

with that script in place we get a 1.0078 Hz filter which leads to
massive phase lag and a crashed aircraft

this is a safety protection. We should also try to find out why the
INS_HNTCH_FREQ lower limit is not working
2023-11-07 11:17:04 +11:00
Andrew Tridgell
def89ea600 Plane: prepare for 4.4.2 release 2023-10-23 07:36:44 +11:00
Andrew Tridgell
f56ce445b1 Plane: update release notes for 4.4.2 2023-10-23 07:36:34 +11:00
Randy Mackay
f307f3c26f Plane: version to 4.4.2-beta1 2023-10-13 16:40:51 +11:00
Randy Mackay
810b1e300d Plane: 4.4.2-beta1 release notes 2023-10-13 16:40:51 +11:00
Andrew Tridgell
8aa0efb962 Plane: use deadzone in stick mixing
this prevents small RC input deviations from impacting non-pilot
controlled modes via stick mixing
2023-10-13 16:40:51 +11:00
Andrew Tridgell
dadffef92c AP_GPS: allow GPS moving baseline rover at 3Hz
users with busy CAN bus often get significiantly lower GPS rates on a
moving baseline rover, preventing arming. This PR relaxes the required
frame rate as the EKF is quite happy with 3Hz yaw and the yaw is the
only data consumed from a moving baseline rover
2023-10-13 16:40:51 +11:00
Andrew Tridgell
cf6fe59a7a AP_Logger: added build directory to VER message
this allows log review tools to use right parameter and mode map when vendor has changed the
vehicle type strings
2023-10-13 16:40:51 +11:00
Andrew Tridgell
38b1c526b4 Tools: rebuild IO firmware for SBUS change 2023-10-13 16:40:51 +11:00
Andrew Tridgell
65ef005ea5 AP_RCProtocol: protect against invalid data in SBUS 2023-10-13 16:40:51 +11:00
Andrew Tridgell
5384ab3b3b Plane: fixed terrain RTL with rally points
this fixes a bug where if the terrain database cache does not have the
tile for the location of a rally point then RTL to the rally point
with TERRAIN_FOLLOW=1 will not track terrain

The underlying issue is that Location::loc.change_alt_frame() will
return false if the location is not in the terrain memory cache. We
can't just extrapolate as the rally point could be in a totally
different terrain area to the current location. So instead we set it
as terrain_following_pending and fix it as soon as the terrain cache
is filled.

fixes https://github.com/ArduPilot/ardupilot/issues/25157
2023-10-13 16:40:51 +11:00
Andrew Tridgell
ddfa4c0ed7 AP_OpenDroneID: only load from persistent memory in init()
we do not want to do this from update() as it is an expensive call
2023-10-13 16:40:51 +11:00
Randy Mackay
993ca4665d Copter: version to 4.4.2-beta1 2023-10-13 16:40:51 +11:00
Randy Mackay
47c367da92 Copter: 4.4.2-beta1 release notes 2023-10-13 16:40:51 +11:00
Randy Mackay
cf0dc14e31 Rover: version to 4.4.0-beta8 2023-10-13 16:40:51 +11:00
Randy Mackay
a4ba1c7ec1 Rover: 4.4.0-beta8 release notes 2023-10-13 16:40:51 +11:00
Henry Wurzburg
f1cc021b1c AP_OSD:Update/correct DisplayPort BF MSP symbols 2023-10-13 16:40:51 +11:00
Henry Wurzburg
f2d9e3aa5b AP_OSD:add option to convert home,wind,waypoint and gndspd arrows for BF font set 2023-10-13 16:40:51 +11:00
Andrew Tridgell
1280e469f1 AP_BattMonitor: added SHUNT parameter to INS2xx driver
some vendors want different shunt resistors
2023-10-13 16:40:51 +11:00
Andrew Tridgell
0b7552e6f8 Tools: allow Ohm units in parameters
# Conflicts:
#	Tools/autotest/param_metadata/param.py
#	libraries/AP_BattMonitor/AP_BattMonitor_INA2xx.cpp
2023-10-13 16:40:51 +11:00
Andrew Tridgell
799ccb32e2 AP_InertialSensor: fixed the error value for BMI088
the bad value is -32768 not 0xffff (which is -1)

-32768 badly corrupts the low-pass filter, and is what we see in logs
(a large negative spike on all 3 axes)

update to bug fix from:
https://github.com/ArduPilot/ardupilot/pull/23033
2023-10-13 16:40:51 +11:00
alexklimaj
26b6a1b7b8 hwdef: arkv6x default to no IO MCU 2023-10-13 16:40:51 +11:00
Henry Wurzburg
3a5b99f0d4 hwdef:add VTX power control to SpeedyBeeF405-Wing 2023-10-13 16:40:51 +11:00
Peter Barker
6a17a605d4 AP_TECS: ensure good TECS state before running update_pitch_throttle
update_pitch_throttle can be called when update_50hz hasn't run in a very long time, or ever.  This requires a main loop rate >50Hz, and for the mode change to occur in the same loop that update_50Hz doesn't run but update_pitch_throttle does.
2023-10-13 16:40:51 +11:00
Andrew Tridgell
bfc9b6e389 AP_TECS: fixed descent or lack of climb bug
this fixes a state where we either cannot climb or descend in an
uncontrolled manner in a TECS controlled mode

the conditions under which this happened were:

- _use_synthetic_airspeed_once was true due to quadplane takeoff
- we left _thr_clip_status as MAX from previous use of synthetic airspeed
- then run without airspeed

note that this can also impact users with an airspeed sensor if they
disable it or it fails in flight, particularly during a climb
2023-10-13 16:40:51 +11:00
Peter Barker
9b44444a28 autotest: CI fixes for 4.4 2023-10-13 16:40:51 +11:00
Peter Barker
fcd00f65e9 SITL: fix balancebot yaw reset to be kinimatically consistent
... or at least closer to it.

We were hard-resetting the yaw to zero when the vehicle was upright.  That makes for huge simulated gyro rates, and that means the differences between the gyros can be huge sample-to-sample, so we can get gyros-inconsistent errors.

Fix things so we don't reset yaw at the same time as pitch, and also twist the vehicle to point North again when disarmed.
Backport of PR https://github.com/ArduPilot/ardupilot/pull/25046
2023-10-13 16:40:51 +11:00
Peter Barker
2b211dcfaf SITL: reset balancebot to vertical in a kinmetically consistent manner
The hard-reset of all state variables means we feed the EKF inconsistent gyro data.  Attempt to upright the vehicle with a simple p-gain when it is disarmed, as if someone is pushing the thing back upright
Backport of PR https://github.com/ArduPilot/ardupilot/pull/24314
2023-10-13 16:40:51 +11:00
Peter Barker
99491d2436 autotest: give Rover longer to arrive home
vagaries of interaction with Python script means we need to give this more time when running balancebot
Backport of PR https://github.com/ArduPilot/ardupilot/pull/23442
2023-10-13 16:40:51 +11:00
Tom Pittenger
a98678a0f9 Tools/autotest: fix Deepstall CI
Backport from PR https://github.com/ArduPilot/ardupilot/pull/24667
2023-10-13 16:40:51 +11:00
Peter Barker
4f44760912 autotest: allow more time for deepstall text
intermittent failures in CI - perhaps due to Plane dynamics changes
Backport of PR https://github.com/ArduPilot/ardupilot/pull/23524
2023-10-13 16:40:51 +11:00
Peter Barker
c37557736c autotest: add an epsilon for achieved servo output for speed scaling test
right on the threshold
backport from PR https://github.com/ArduPilot/ardupilot/pull/23823
2023-10-13 16:40:51 +11:00
Peter Barker
c2f384ec48 autotest: remove unnecessary try/except from Sprayer test
backport from https://github.com/ArduPilot/ardupilot/pull/23823
2023-10-13 16:40:51 +11:00
Tom Pittenger
c6c4a3d355 Tools/autotest: extend WindEstimates duration
backport from PR https://github.com/ArduPilot/ardupilot/pull/24666
2023-10-13 16:40:51 +11:00
bugobliterator
f95e16bca6 AP_OpenDroneID: ensure Persistent memory is not read continuously 2023-10-13 16:40:51 +11:00
bugobliterator
54db689b0f GCS_MAVLink: move sysid_my_gcs to be public 2023-10-13 16:40:51 +11:00
bugobliterator
47908cb185 AP_Periph: move sysid_my_gcs to be public 2023-10-13 16:40:51 +11:00
bugobliterator
e36ab2e51b Blimp: move sysid_my_gcs to be public 2023-10-13 16:40:51 +11:00
bugobliterator
88f4e4e33f ArduSub: move sysid_my_gcs to be public 2023-10-13 16:40:51 +11:00
bugobliterator
72809eea03 ArduPlane: move sysid_my_gcs to be public 2023-10-13 16:40:51 +11:00
bugobliterator
f5568d7ce5 ArduCopter: move sysid_my_gcs to be public 2023-10-13 16:40:51 +11:00
bugobliterator
962c2c35cf AntennaTracker: move sysid_my_gcs to be public 2023-10-13 16:40:51 +11:00
bugobliterator
bfbae2d8e6 AP_HAL_ChibiOS: remove Chip ID as Basic ID mechanism 2023-10-13 16:40:51 +11:00
bugobliterator
371ebe8afc AP_OpenDroneID: remove Chip ID as Basic ID mechanism 2023-10-13 16:40:51 +11:00
bugobliterator
c2ca9d6ea1 AP_HAL_ChibiOS: explain DID_OPTIONS config in CubeOrange-ODID/defaults.parm 2023-10-13 16:40:51 +11:00
bugobliterator
9b30602515 AP_OpenDroneID: add support for persistent storage of UAS ID 2023-10-13 16:40:51 +11:00
bugobliterator
06c2c02dc0 AP_HAL: add support for get_persistent_param_by_name 2023-10-13 16:40:51 +11:00
bugobliterator
3b7352d3a7 AP_HAL_ChibiOS: add support for get_persistent_param_by_name 2023-10-13 16:40:51 +11:00
bugobliterator
c75fba3d21 AP_HAL_ChibiOS: add support for storing OpenDroneID in bootloader sector 2023-10-13 16:40:51 +11:00
Andy Piper
3bc082211b hwdef: ensure SpeedyBeeF405Mini builds on plane 2023-10-13 16:40:51 +11:00
Andy Piper
53bf4e9e8e hwdef: adjust serial protocol defaults on various boards for 4.4 naming scheme 2023-10-13 16:40:51 +11:00
Andy Piper
5a860009bb hwdef: SpeedyBeeF405Mini 2023-10-13 16:40:51 +11:00
Peter Barker
1dcb31eb6e GCS_MAVLink: correct sensors when no baros found
GCSs will know we have no baros on-board, as will the RC telemetry library
2023-10-13 16:40:51 +11:00
Andy Piper
ee5b529ed2 bootloaders: SpeedyBeeF405Mini 2023-10-13 16:40:51 +11:00
Andy Piper
bcd5da1780 AP_HAL_ChibiOS: T-Motor H743 Mini 2023-10-13 16:40:51 +11:00
Andy Piper
421e535ffa bootloaders: TMotor H743 Mini bootloader 2023-10-13 16:40:51 +11:00
Andy Piper
5fdc7d9326 AP_HAL_ChibiOS: provide mcu defaults in betaflight conversion 2023-10-13 16:40:51 +11:00
Andy Piper
29c204c0bc AP_HAL_ChibiOS: correct hwdef generator battery scale 2023-10-13 16:40:51 +11:00
Andy Piper
d179103c67 AP_HAL_ChibiOS: cope with different IMU drivers in hwdef conversion 2023-10-13 16:40:51 +11:00
Andy Piper
1124b05fc8 bootloaders: mRoControlZeroOEMH7 bdshot version 2023-10-13 16:40:51 +11:00
Andy Piper
ad04fadf2d hwdef: mRoControlZeroOEMH7 bdshot version 2023-10-13 16:40:51 +11:00
Andy Piper
01cd698947 hwdef: correct inversion pin on MambaF405v2
correct battery setup for MambaF405v2
provide suitable serial defaults for MambaF405v2
reallocate DMA channels to allow full DMA on USART3 and NeoPixel on MambaF405v2
add camera control pin to MambaF405v2
2023-10-13 16:40:51 +11:00
Andy Piper
cd6ad72cdb AP_HAL_ChibiOS: betafpv F450 AIO hwdef 2023-10-13 16:40:51 +11:00
Andy Piper
de35407713 bootloaders: add BETAFPV F405 AIO 2023-10-13 16:40:51 +11:00
Andy Piper
ddd2b7dab0 AP_HAL_ChibiOS: allow 8 bdshot channels on mRoControlZeroH7 2023-10-13 16:40:51 +11:00
Andy Piper
cf997df79f AP_NavEKF: fallback to no baro on boards that have no baro 2023-10-13 16:40:51 +11:00
Paul Riseborough
1a7a6b6dd9 AP_NavEKF3: Allow operation with EK3_SRCx_POSZ = 0 (NONE) 2023-10-13 16:40:51 +11:00
Paul Riseborough
b05919ea88 AP_NavEKF: Allow EK3_SRCx_POSZ to be set to 0 (NONE) 2023-10-13 16:40:51 +11:00
Andy Piper
276578c509 AP_NavEKF3: allow high values of EK3_ALT_M_NSE for boards without baros 2023-10-13 16:40:51 +11:00
Davide_Lentini
ce1eff398c AP_HAL_ChibiOS: Update luminousbee5 defaults.parm 2023-10-13 16:40:51 +11:00
Randy Mackay
00c119c643 Copter: version to 4.4.1 2023-10-13 16:40:51 +11:00
Randy Mackay
cb6b45e30c Copter: 4.4.1 release notes 2023-10-13 16:40:51 +11:00
Andrew Tridgell
4ccbfb1fad Plane: prepare for 4.4.1 release 2023-09-26 13:24:29 +10:00
Andrew Tridgell
8708b1c67a Plane: release notes for 4.4.1 2023-09-26 13:24:29 +10:00
Randy Mackay
2da8f95492 Plane: version to 4.4.1-beta2 2023-09-14 14:10:41 +09:00
Randy Mackay
d44f77be8c Plane: 4.4.1-beta2 release notes 2023-09-14 14:10:41 +09:00
Randy Mackay
b3b35857fd Copter: version to 4.4.1-beta2 2023-09-14 14:10:41 +09:00
Randy Mackay
6754bdefe7 Copter: 4.4.1-beta2 release notes 2023-09-14 14:10:41 +09:00
Randy Mackay
90730e952f Rover: version to 4.4.0-beta7 2023-09-14 14:10:41 +09:00
Randy Mackay
3e2ce0da52 Rover: 4.4.0-beta7 release notes 2023-09-14 14:10:41 +09:00
Mohammad Hefny
df3ee3086a AP_HAL_Linux: Fix RPI check using enumerations 2023-09-14 14:10:41 +09:00
Henry Wurzburg
3caa6400e1 AP_HAL_ChibiOS:improve MambaF405MINI defaults 2023-09-14 14:10:41 +09:00
Martin Luessi
bcebac9132 AP_HAL_ChibiOS: Add RADIX2HD target 2023-09-14 14:10:41 +09:00
Martin Luessi
a594aa9330 AP_HAL_ChibiOS: Allow custom STM32_PLL1_DIVQ_VALUE for H7 2023-09-14 14:10:41 +09:00
yjuav
3fe0a2bd92 Tools: add YJUAV_A6SE board id & bootloader file 2023-09-14 14:10:41 +09:00
yjuav
2b1a195293 hwdef: add YJUAV_A6SE board support 2023-09-14 14:10:41 +09:00
Andy Piper
56986b4cad bootloaders: rebuild bootloaders for SPRacingH7 and DevEBoxH7v2 2023-09-14 14:10:41 +09:00
Andy Piper
d45d868701 scripts: update size_compare from master 2023-09-14 14:10:41 +09:00
Andy Piper
f2e8032f17 ChibiOS: updates for in memory vector initialization 2023-09-14 14:10:41 +09:00
Andy Piper
1766c0e384 AP_HAL_ChibiOS: use old CRT1_AREAS_NUMBER 2023-09-14 14:10:41 +09:00
Martin Luessi
d4c2cb2097 AP_HAL_ChibiOS: RAM initialization and linker files changes for external flash targets 2023-09-14 14:10:41 +09:00
Martin Luessi
9954edd4da AP_HAL_ChibiOS: Use custom H750 linker script 2023-09-14 14:10:41 +09:00
Martin Luessi
dde422717e AP_HAL_ChibiOS: Fix H750 linker script 2023-09-14 14:10:41 +09:00
Martin Luessi
0eb4afaeec AP_HAL_ChibiOS: Allow custom linker script, change extflash linker script 2023-09-14 14:10:41 +09:00
Martin Luessi
ee10f447e0 AP_HAL_ChibiOS: Move scheduler task table to RAM for H750 2023-09-14 14:10:41 +09:00
Martin Luessi
481955f067 AP_HAL_ChibiOS: Add libgcc comment to H750 linker script 2023-09-14 14:10:41 +09:00
Martin Luessi
4418ccc4a9 AP_HAL_ChibiOS: Use DTCM for vector table for external flash targets 2023-09-14 14:10:41 +09:00
Martin Luessi
d923ca6ec2 AP_HAL_ChibiOS: Move more time critical code to RAM for H750 2023-09-14 14:10:41 +09:00
Martin Luessi
e615034c83 AP_HAL_ChibiOS: increase FLASH_RAM and rename FDCAN to CAN for H750 2023-09-14 14:10:41 +09:00
Martin Luessi
321e82c451 AP_HAL_ChibiOS: Copy vector table to RAM if external flash is primary 2023-09-14 14:10:41 +09:00
Martin Luessi
47615b14cc AP_HAL_ChibiOS: Change linker script so vector table can be copied to RAM for external flash targets 2023-09-14 14:10:41 +09:00
Martin Luessi
6487c46562 AP_HAL_ChibiOS: Allow custom STM32_QSPISEL for H7 2023-09-14 14:10:41 +09:00
Randy Mackay
99b73ee695 Copter: version to 4.4.1-beta1 2023-09-14 14:10:41 +09:00
Randy Mackay
6fd0157913 Copter: 4.4.1-beta1 release notes 2023-09-14 14:10:41 +09:00
Randy Mackay
765d632995 Rover: version to 4.4.0-beta6 2023-09-14 14:10:41 +09:00
Randy Mackay
76f494cb50 Rover: 4.4.0-beta6 release notes 2023-09-14 14:10:41 +09:00
Andy Piper
3315e637f6 AP_HAL_ChibiOS: change incorrect I2C internal mask from SkystarsH7HD bdshot 2023-09-14 14:10:41 +09:00
Randy Mackay
42dec26a4a Copter: version to 4.4.0 2023-09-14 14:10:41 +09:00
Randy Mackay
912309b682 Copter: 4.4.0 release notes 2023-09-14 14:10:41 +09:00
Andrew Tridgell
d5c5a86ff9 hwdef: get airbotf4 building with 4.4
minimize, same as master
2023-09-07 18:02:36 +10:00
Andrew Tridgell
6e3279bdf9 Plane: prepare for 4.4.1-beta1 2023-09-05 20:14:34 +10:00
Andrew Tridgell
3e97d55f7c Plane: release notes for 4.4.1-beta1 2023-09-05 20:14:13 +10:00
Andrew Tridgell
5a980e04a8 AP_Scripting: added docs for log_file_content 2023-09-05 20:14:13 +10:00
Davide_Lentini
e3dc563a85 AP_HAL_ChibiOS: luminousbee5 hwdefs and default.parm update
fix: restored storage folders for luminousbee5 in hwdef
2023-09-05 20:14:13 +10:00
Willian Galvani
46576685b7 AP_MotorsUGV: add asymmetry factor for skid-steering
Co-authored-by: Iampete1 <iampete@hotmail.co.uk>
2023-09-05 20:14:13 +10:00
Andrew Tridgell
47405af84d AP_Scripting: added log_file_content method
this allows for aerobatics to log the schedule for easier log review
2023-09-05 20:14:13 +10:00
Andy Piper
87a405152f AP_HAL_ChibiOS: pull RTS lines low on Pixhawk6C to avoid glitches on startup 2023-09-05 20:14:13 +10:00
Willian Galvani
ee0f3c5f51 AP_HAL_Linux: update Navigator available GPIOs
The comment was wrong. gpio 26 is actually used for the PCA Output Enable signal.
This also adds GPIO18, which is the one broken out to the PWM0 pin
2023-09-05 20:14:13 +10:00
Iampete1
b7eef68974 AP_BattMonitor: UAVCAN: allow battery reset if not using CAN SoC 2023-09-05 20:14:13 +10:00
Paul Riseborough
2c5d160c67 AP_NavEKF3: Update EK3_GLITCH_RADIUS metadata 2023-09-05 20:14:13 +10:00
Paul Riseborough
096c5ebf57 AP_NavEKF3: increase innovation variance instead of clipping innovations 2023-09-05 20:14:13 +10:00
Paul Riseborough
8ec7c4e9fd AP_NavEKF3: Provide option to clip velocity and position innovations 2023-09-05 20:14:13 +10:00
Andy Piper
a2e804b81c AP_HAL_ChibiOS: add 8 bi-directional dshot channels to KakuteH7-Wing 2023-09-05 20:14:13 +10:00
Peter Barker
2e571d6483 hwdef: qiotek: correct HAL_BATT_MONITOR_DEFAULT define name 2023-09-05 20:14:13 +10:00
Peter Barker
bc4c7605a5 bootloaders: add bootloader for SDMODELH7V1 2023-09-05 20:14:13 +10:00
Peter Barker
76b328a4ae hwdef: add hwdef for SDMODELH7V1 2023-09-05 20:14:13 +10:00
Andrew Tridgell
f51f5e81f3 GCS_MAVLink: fixed corruption of FTP reply component ID
this led to not being able to do FTP transfers with
support.ardupilot.org unless MissionPlanner used the same component ID
as the support engineer GCS
2023-09-05 20:14:13 +10:00
Andrew Tridgell
6503324081 Tools: allow selection of sdcard storage
this has been requested for MatekF765-Wing
2023-09-05 20:14:13 +10:00
Andrew Tridgell
0e85a4041f AP_Param: fixed parameter defaults array length handling
we need to add up the total for all comma separated parameter files
2023-09-05 20:14:13 +10:00
Andrew Tridgell
e054c82f11 Tools: added himark servos and hobbywing ESCs to build options 2023-09-05 20:14:13 +10:00
Andrew Tridgell
91b43c5115 AP_UAVCAN: make himark servo optional in build
and only allocate handlers if enabled
2023-09-05 20:14:13 +10:00
Andrew Tridgell
e23b615b85 AP_UAVCAN: added Hobbywing ESC support 2023-09-05 20:14:13 +10:00
Andrew Tridgell
4c2d3f34e0 DroneCAN: updated DSDL
added hobbywing ESC
2023-09-05 20:14:13 +10:00
Andrew Tridgell
8a5867e3d9 AP_PiccoloCAN: expand servo status logging 2023-09-05 20:14:13 +10:00
Andrew Tridgell
1897411b9d AP_Logger: expand servo status logging 2023-09-05 20:14:13 +10:00
Andrew Tridgell
a8df3d9b6f AP_UAVCAN: support Himark servo protocol 2023-09-05 20:14:13 +10:00
Andrew Tridgell
21db41f5b8 Tools: fixed ccache test for newer ccache version 2023-09-03 09:43:35 +10:00
Andrew Tridgell
49cb017ca5 Plane: fixed nav_roll/nav_pitch when waiting for VTOL takeoff
the nav_roll_cd and nav_pitch_cd were not being set in the VTOL
takeoff code when disarmed. This led to small increments accumulating
in the stick mixing code, leading to large control surface movements
before arming
2023-09-03 07:46:14 +10:00
Andrew Tridgell
710b94a885 Plane: prepare for 4.4.0 2023-08-18 18:24:21 +10:00
Andrew Tridgell
7b3c2d299b Plane: release notes from 4.4.0 2023-08-18 18:23:58 +10:00
Randy Mackay
1b02da05a7 Copter: version to 4.4.0-beta5 2023-08-18 14:43:49 +10:00
Randy Mackay
4b734ddc93 Copter: 4.4.0-beta4 release notes 2023-08-18 14:43:49 +10:00
Randy Mackay
1369afd229 Rover: version to 4.4.0-beta5 2023-08-18 14:43:49 +10:00
Randy Mackay
9db275caa6 Rover: 4.4.0-beta4 release notes 2023-08-18 14:43:49 +10:00
Andrew Tridgell
dc0eaac0da hwdef: allow Pixhawk1-1M-bdshot to build for 4.4.0 2023-08-12 20:30:12 +10:00
Andrew Tridgell
cdee8e5a88 Plane: prepare for 4.4.0-beta5 2023-08-12 16:29:38 +10:00
Andrew Tridgell
452527cb4c Plane: update release notes for 4.4.0beta5 2023-08-12 16:29:38 +10:00
Andrew Tridgell
4039e1bc22 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-12 16:29:38 +10:00
Andrew Tridgell
cfe64421f1 AP_Compass: allow override of IST8310 orientation
this allows for vendor GPS modules and internal compass which use a
different orientation
2023-08-12 16:29:38 +10:00
Andrew Tridgell
42332559a8 Tools: update SIYI_N7 bootloader 2023-08-12 16:29:38 +10:00
Andrew Tridgell
9c43cde3d5 hwdef: added SIYI NY flight controller 2023-08-12 16:29:38 +10:00
Randy Mackay
f7a9eb37b1 autotest: relax Copter vibration failsafe timeout 2023-08-12 16:29:38 +10:00
Andrew Tridgell
49e9cac9c0 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-12 16:29:38 +10:00
Peter Barker
0f46cd7a34 GCS_MAVLink: fix airspeed cal / format commands via non-USB telemetry 2023-08-12 16:29:38 +10:00
Andrew Tridgell
306519767f 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-12 16:29:38 +10:00
Nicholas Ionata
41dabdbf76 Plane: reset target altitude time on mode enter 2023-08-12 16:29:38 +10:00
Andrew Tridgell
c024c58486 AP_Airspeed: increased DroneCAN airspeed timeout 2023-08-12 16:29:38 +10:00
Andrew Tridgell
a7dff69f8f AP_Airspeed: fixed handling of unhealthy airspeed
this fixes a bug introduced in
https://github.com/ArduPilot/ardupilot/pull/22416 which results in
using bad airspeed data on timeout. The prev_health variable is
updated by the get_pressure call
2023-08-12 16:29:38 +10:00
Andrew Tridgell
38c586712b Plane: prepare for 4.4.0-beta4 2023-08-01 17:48:59 +10:00
Andrew Tridgell
9535af19e3 Plane: update release notes for 4.4.0-beta4 2023-08-01 17:48:20 +10:00
Randy Mackay
a5f71c4f7c Copter: version to 4.4.0-beta4 2023-08-01 17:43:17 +10:00
Randy Mackay
06398a9a1d Copter: 4.4.0-beta4 release notes 2023-08-01 17:43:17 +10:00
Randy Mackay
d9a782b4b8 Rover: version to 4.4.0-beta4 2023-08-01 17:43:17 +10:00
Randy Mackay
2376eb95dd Rover: 4.4.0-beta4 release notes 2023-08-01 17:43:17 +10:00
Randy Mackay
41a97efcb3 AP_Scripting: add rover quicktune 2023-08-01 17:43:17 +10:00
Randy Mackay
fa817c1d32 AP_Scripting: AR_PosControl bindings 2023-08-01 17:43:17 +10:00
Randy Mackay
35513ba539 AP_Scripting: add AR_AttitudeControl srate binding
also add AP_Vehicle:get_steering_and_throttle binding
2023-08-01 17:43:17 +10:00
Randy Mackay
eaa2ce17de AC_PID: AC_PID_2D integrates SlewCalculator2D 2023-08-01 17:43:17 +10:00
Randy Mackay
2f847c9129 Filter: add SlewCalculator2D 2023-08-01 17:43:17 +10:00
Randy Mackay
873290de1b Filter: SlewLimiter definitions moved to cpp 2023-08-01 17:43:17 +10:00
Randy Mackay
a0b9b4ebd0 Rover: implement get_steering_and_throttle 2023-08-01 17:43:17 +10:00
Randy Mackay
049cb93cad AP_Vehicle: add get_steering_and_throttle 2023-08-01 17:43:17 +10:00
Randy Mackay
66814c57ef AR_PosControl: add singleton and get_srate 2023-08-01 17:43:17 +10:00
Randy Mackay
4b7e1db3e4 AR_AttitudeControl: add singleton and get_srate 2023-08-01 17:43:17 +10:00
Michael du Breuil
bd8af22ef9 Plane: On vtol landings if from a mission perform crosstracking 2023-08-01 17:43:17 +10:00
Andy Piper
da4ad1063a bootloaders: bootloader for iFlight BlitzF745AIO 2023-08-01 17:43:17 +10:00
tiralonghipol
cdd2124353 AP_HAL_ChibiOS: add new board BlitzF745AIO 2023-08-01 17:43:17 +10:00
Andy Piper
97fa94ef6e AP_Bootloader: add iFlight BlitzF7 2023-08-01 17:43:17 +10:00
Andy Piper
ec73566503 AP_HAL_ChibiOS: correct incorrect defaults for serial ports on FoxeerH743v1 2023-08-01 17:43:17 +10:00
Andy Piper
aa00e16cdd AP_RCProtocol: report tracer frame rate correctly 2023-08-01 17:43:17 +10:00
Andy Piper
95526881ad AP_RCProtocol: rescan at CRSFv3 baud rates to avoid RX loss on soft reboot 2023-08-01 17:43:17 +10:00
Randy Mackay
d4596e39f5 AR_PosControl: limit and zero velocity I-term
zero in forward-back direction
limit in lateral direction
2023-08-01 17:43:17 +10:00
Randy Mackay
c746714eaa AR_AttitudeContol: add steering_limited checks 2023-08-01 17:43:17 +10:00
Randy Mackay
2beb6f8fd0 AP_Math: Vector2f::projected made const 2023-08-01 17:43:17 +10:00
Randy Mackay
202f443cb5 Rover: circle uses lower accel and fix forward-back accel 2023-08-01 17:43:17 +10:00
Randy Mackay
12268609b1 Rover: circle mode loses input shaping 2023-08-01 17:43:17 +10:00
Randy Mackay
dc9e1a2bc3 Rover: circle checks max speed and min radius 2023-08-01 17:43:17 +10:00
Andy Piper
b93bc2767f AP_HAL_ChibiOS: correct comment in HEEWING-F405 v1 2023-08-01 17:43:17 +10:00
Andy Piper
c36b6c1c0b AP_HAL_ChibiOS: HEEWING-F405v2 which includes dataflash logging 2023-08-01 17:43:17 +10:00
Andy Piper
4df27dbedb bootloaders: bootloader for HEEWING-F405v2 2023-08-01 17:43:17 +10:00
Andy Piper
7f9b9eb344 AP_NavEKF3: fix docs on ABIAS_P_NSE_DEFAULT 2023-08-01 17:43:17 +10:00
Andrew Tridgell
787d03c1a3 AP_Mount: prevent SIYI driver crash if serial port not setup
if MNT1_TYPE=8 and no serial protocol set to gimbal then a camera
trigger can crash the vehicle
2023-08-01 17:43:17 +10:00
Andy Piper
cc19359c33 AP_BLHeli: add battery status MSP handling
give internal error if an unknown MSP command occurs
2023-08-01 17:43:17 +10:00
Andy Piper
0c7eb9f814 bootloaders: add HeeWing F405 2023-08-01 17:43:17 +10:00
HelloLeFei
0249abb099 AP_HAL_ChibiOS: add HEEWING-F405 flight controller
add bi-directional dshot
add back in features.
juggle DMA allocations to allow CRSF to work correctly
disable dshot on PWM 10 as it is not used
do not enable quadplane by default
do not disable arming checks
run ICM42688 at 1Mhz for low speed to avoid gyro noise
add HEEWING README and picture
2023-08-01 17:43:17 +10:00
Mikhail Degtiarenko
a67b6c7837 AP_HAL_ChibiOS: add SPL06 to MambaH743v4
The Diatone Mamba MK4 H743 v2 Flight Control have moved from the DPS280 barometer to using SPL06.

https://www.diatone.us/products/mamba-mk4-h743-v2-flight-control-30mm-m3l
2023-08-01 17:43:17 +10:00
Randy Mackay
17ce04daba Copter: update 4.4.0-beta3 release notes 2023-08-01 17:43:17 +10:00
Randy Mackay
b1cdc81feb Rover: update 4.4.0-beta3 release notes 2023-08-01 17:43:17 +10:00
Randy Mackay
6adc713496 Copter: update 4.4.0-beta3 release notes 2023-08-01 17:43:17 +10:00
Randy Mackay
707b50d1cc Rover: update 4.4.0-beta3 release notes 2023-08-01 17:43:17 +10:00
Andrew Tridgell
d81d4640ee ChibiOS: disable DMA on I2C on F7 and H7 by default
this was already done on many (most?) boards, and greatly reduces DMA
sharing which improves performance of UARTs. This changes the default
to no DMA on I2C
2023-08-01 10:54:28 +10:00
bugobliterator
a121f665f1 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-07-23 12:46:05 +10:00
Andrew Tridgell
a564af680b AP_Scripting: added bindings for VTOL motor loss
this allows a script to take an action on loss of a VTOL motor
2023-07-23 12:45:26 +10:00
Andrew Tridgell
4957173f45 Plane: update release notes 2023-07-04 15:40:14 +10:00
Andrew Tridgell
24ec48d1e3 HAL_ChibiOS: implement newlib alloc functions as malloc wrappers
this fixes issue #24106
2023-07-04 15:33:59 +10:00
Andrew Tridgell
799833fdaa waf: wrap newlib alloc functions on ChibiOS
this prevents scripting and string library functions from calling sbrk
based alloction functions that are not thread safe
2023-07-04 15:33:27 +10:00
Andrew Tridgell
166b3e902e Plane: prepare for 4.4.0beta3 2023-07-04 14:01:13 +10:00
Andrew Tridgell
2476594d1f Plane: update release notes for 4.4.0beta3 2023-07-04 10:53:57 +10:00
Peter Barker
ff6c1e009e AP_Notify: add driver for IS31FL3195 LED 2023-07-04 10:53:57 +10:00
Peter Barker
9501b61729 AP_Notify: add driver for LP5562 LED 2023-07-04 10:53:57 +10:00
Andrew Tridgell
9090bb17a5 AP_Scripting: updated VTOL quicktune docs 2023-07-04 10:53:57 +10:00
Andrew Tridgell
2aec5ccd7b AP_Scripting: fixed lua-check warnings in VTOL-quicktune 2023-07-04 10:53:57 +10:00
Andrew Tridgell
dc7efab45f AP_Scripting: fixed use of QUIK_ENABLE in VTOL-quicktune
this was lost when the cached access was added
2023-07-04 10:53:57 +10:00
Andrew Tridgell
678b81563d AP_Scripting: added QUIK_MAX_REDUCE parameter to VTOL-quicktune.lua
this limits the amount that rate gains can reduce from the original
values in a quicktune. Large reductions in rate gains can be
incorrectly triggered by a frame resonance or gust of wind which can
result in gains that are dangerously low, which can trigger an angle P
oscillation
2023-07-04 10:53:57 +10:00
Andrew Tridgell
488b6a92b5 Plane: fixed transition started airspeed message
this message was lost in recent refactoring
2023-07-04 10:53:57 +10:00
Paul Riseborough
f45f0d09e1 Plane: Fix bug that can cause early exit from loiter to alt and time wp's
The check for the aircraft being lined up for a tangent exit has an early breakout condition if the next waypoint is too close to the loiter circle which can prevent the required ground course to waypoint ever being achieved. This check was using the WP_LOITER_RAD parameter value, not the actual radius being used which can be set differently by the mission plan. If a large value for WP_LOITER_RAD was set and being over-written by the mission plan with a smaller value compatible with the distance to the next waypoint, the aircraft would still exit early.
2023-07-04 10:53:57 +10:00
Andrew Tridgell
cb430470cf Plane: fixed TECS state reset in VTOL auto
this fixes a bug where TECS maintains its slow integrator while in a
VTOL hover mode in AUTO or GUIDED.

Among other things this affects PAYLOAD_PLACE and
DO_VTOL_TRANSITION. In those states the height can change while
hovering outside the control of TECS. When TECS regains control in a
fwd transition then can lead to a very large height loss or gain until
the TECS integrator can catch up
2023-07-04 10:53:57 +10:00
Randy Mackay
07ec058155 Copter: version to 4.4.0-beta3 2023-07-04 10:53:57 +10:00
Randy Mackay
b1c7614bf9 Copter: 4.4.0-beta3 release notes 2023-07-04 10:53:57 +10:00
Randy Mackay
6921c7138b Rover: version to 4.4.0-beta3 2023-07-04 10:53:57 +10:00
Randy Mackay
bed8a9de27 Rover: 4.4.0-beta3 release notes 2023-07-04 10:53:57 +10:00
Andy Piper
25ccd609d7 AP_HAL_ChibiOS: remove bdshot from speedybeef4 as it doesn't work and increases flash usage 2023-07-04 10:53:57 +10:00
Andy Piper
49c3d4e049 AP_HAL_ChibiOS: Pixhawk1-bdshot 2023-07-04 10:53:57 +10:00
Michael du Breuil
b3837ee911 AP_ADSB: Fix spam of lost transciever message at update() rate 2023-07-04 10:53:57 +10:00
Andy Piper
f7e657f6c5 AC_AutoTune: correct incorrect min raw rate valuee 2023-07-04 10:53:57 +10:00
Andrew Tridgell
86b6785fca Tools: fixed RefindGPS test
this test was relying on the EKF bug fixed in this PR. The copter was
actually fully landing and touching the ground in the LAND phase
whereas the original intention of this test was that it not touch the
ground in LAND. See the graph in
https://github.com/ArduPilot/ardupilot/pull/17104 where the test was
added
2023-07-04 10:53:57 +10:00
Andrew Tridgell
5e657c4e7f AP_NavEKF3: fixed velocity reset on AID_NONE
The ResetVelocity() function is only supposed to reset XY states, not
Z state. Resetting the Z state for velocity results in a large
velocity glitch if a vehicle is descending or ascending when aiding
switches to AID_NONE

this fixes #19386
2023-07-04 10:53:57 +10:00
Andrew Tridgell
38a26f26a7 AP_NavEKF2: fixed velocity reset on AID_NONE
The ResetVelocity() function is only supposed to reset XY states, not
Z state. Resetting the Z state for velocity results in a large
velocity glitch if a vehicle is descending or ascending when aiding
switches to AID_NONE

this fixes #19386
2023-07-04 10:53:57 +10:00
Stephen Dade
f32e2c9ddb Rover: Lower minimum circle tracking distance 2023-07-04 10:53:57 +10:00
Peter Barker
a75ee432c8 AP_Arming: reword GPS pre-arm failure
M10S (no storage) throws this for a considerable period of time and the wording makes this process sound scary.
2023-07-04 10:53:57 +10:00
Andy Piper
a357d14f4b AP_HAL_ChibiOS: Pixhawk6X bdshot version 2023-07-04 10:53:57 +10:00
Andrew Tridgell
3df9e40ebc Plane: improved fwd throttle during VTOL landing
this sets up the vwd integrator more reasonably when we are in
POSITION1 stage of VTOL landing. We need to have enough throttle to
cope with a headwind, but want it lower when we are at or above our
target closing speed so can minimise the amount of pitch up

This also makes the landing_desired_closing_velocity() consistent with
the landing speed used in approach, using average of airspeed min and
cruise speed if TECS_LAND_ARSPD is not set

The target airspeed for TECS during airbraking is now set to
ARSPD_FBW_MIN, on the basis we are trying to slow down to min speed,
and we have VTOL support which should prevent a stall.

To cope with a high headwind where ARSPD_FBW_MIN is below the headwind
we now check for too low achieved closing speed and switch to
POSITION1 which can use vfwd to get to the landing location
2023-07-04 10:53:57 +10:00
Tatsuya Yamaguchi
5a214efcaa Copter: add has_user_takeoff in ZigZag mode 2023-07-04 10:53:57 +10:00
jfbblue0922
3f3ba237fb AP_HAL_ChibiOS: jfb100 gets shorter EXT_WDOG_INTERVAL_MS 2023-07-04 10:53:57 +10:00
jfbblue0922
9e19e12040 AP_HAL_CHibiOS: JFB100 hwdef fix for ext watchdog 2023-07-04 10:53:57 +10:00
jfbblue0922
4d7cce1b36 AP_HAL_ChibiOS: support external watchdog gpio
Co-authored-by: Randy Mackay <rmackay9@yahoo.com>

optional support to toggle GPIO pin at 10hz
2023-07-04 10:53:57 +10:00
Andrew Tridgell
f4a59b3a7e AP_GPS: fixed ublox M10S auto-config
this copes with the M10S rejecting multiple-key VALGET calls. We fall
back to fetching one at a time
2023-07-04 10:53:57 +10:00
Alexander Keller
94a3f2aff2 AP_GPS:Comform to ardupilot undulation definition 2023-07-04 10:53:57 +10:00
davidsastresas
ec79c3ffae GCS_Common: handle CMD_DO_SET_ROI_NONE for command int packets 2023-07-04 10:53:57 +10:00
Randy Mackay
113ed38f82 AP_SerialManager: improve OPTIONS desc for Swap bit 2023-07-04 10:53:57 +10:00
Randy Mackay
8b825b4ea7 AP_SerialManager: generalise SToRM32 serial protocol desc and enum 2023-07-04 10:53:57 +10:00
Henry Wurzburg
96681b03aa Plane: Make mode takeoff entry climb to TKOFF_ALT before loitering 2023-07-04 10:53:57 +10:00
Iampete1
3a34cf4562 AP_Motors: Heli RSC: remove incorrect set range call 2023-07-04 10:53:57 +10:00
Henry Wurzburg
72b525cff6 Plane: fix error in Qplane wait for rudder neutral 2023-07-04 10:53:57 +10:00
Henry Wurzburg
a8f6464121 Tools: add Holybro KakuteH7-Wing 2023-07-04 10:53:57 +10:00
Henry Wurzburg
f917554c4a AP_HAL_ChibiOS: add Holybro KakuteH7-Wing 2023-07-04 10:53:57 +10:00
Andrew Tridgell
602f7d1336 Plane: prepare for 4.4.0beta2 2023-06-08 18:45:20 +10:00
Andrew Tridgell
ad1055e9ea Plane: adjust 4.4.0beta2 release notes 2023-06-08 18:45:08 +10:00
Randy Mackay
abac633fe0 Copter: update 4.4.0-beta2 release notes 2023-06-08 18:41:06 +10:00
Randy Mackay
5422ed01f2 Rover: update 4.4.0-beta2 release notes 2023-06-08 18:41:06 +10:00
Randy Mackay
3f81bc482b github: remove elf_diff from checks we run 2023-06-08 18:41:06 +10:00
Randy Mackay
0f287073a6 Copter: version to 4.4.0-beta2 2023-06-08 18:41:06 +10:00
Randy Mackay
e52075b861 Copter: 4.4.0-beta2 release notes 2023-06-08 18:41:06 +10:00
Randy Mackay
ddc8b492de Rover: version to 4.4.0-beta2 2023-06-08 18:41:06 +10:00
Randy Mackay
375a209a9b Rover: 4.4.0-beta2 release notes 2023-06-08 18:41:06 +10:00
Randy Mackay
8c173a9d9a Rover: add circle mode
also auto mode support loiter turns
2023-06-08 18:41:06 +10:00
Shiv Tyagi
b38a334056 Rover: add dock mode to INTIAL_MODE and MODE1 params 2023-06-08 18:41:06 +10:00
Randy Mackay
d0a7c3cf95 Rover: auto mode format fix 2023-06-08 18:41:06 +10:00
Randy Mackay
a3d6bcc5da AR_PosControl: add input_pos_vel_accel target 2023-06-08 18:41:06 +10:00
Randy Mackay
823e7c53b5 AP_HAL_ChibiOS: JFB100 LED definition fix 2023-06-08 18:41:06 +10:00
Randy Mackay
f7ee365907 AP_InertialSensor: SCHA63T comment fix 2023-06-08 18:41:06 +10:00
Randy Mackay
538a0ef966 AP_HAL_ChibiOS: JFB100 board def fixup 2023-06-08 18:41:06 +10:00
Randy Mackay
edc5e598f8 AP_InertialSensor: SCHA63T loses unused ret bool 2023-06-08 18:41:06 +10:00
jfbblue0922
890f9878ec Tools: add JFB100 bootloader 2023-06-08 18:41:06 +10:00
jfbblue0922
2764305f8e AP_HAL_ChibiOS: add JFB100 board definition 2023-06-08 18:41:06 +10:00
Randy Mackay
adee71fe22 AP_InertialSensor: formatting fixes 2023-06-08 18:41:06 +10:00
jfbblue0922
de7e388ed4 AP_InertialSensor: add SCHA63T IMU support 2023-06-08 18:41:06 +10:00
jfbblue0922
2e6a16907b AP_Math: add crc8_sae 2023-06-08 18:41:06 +10:00
Henry Wurzburg
58d03f01ec AP_Notify: fix incorrect buzzer pin type to stop always instantiating 2023-06-08 18:41:06 +10:00
James O'Shannessy
87b47d5ea1 AP_BattMonitor: Fixes the setting of a default parameter for battery instance #2 set in hwdef 2023-06-08 18:41:06 +10:00
Randy Mackay
8e32c1645e Copter: RTL accepts do-change-speed commands 2023-06-08 18:41:06 +10:00
Randy Mackay
d669a2b079 AC_WPNav: wpnav speed param check fixed 2023-06-08 18:41:06 +10:00
Andrew Tridgell
5178ac92bc Plane: release notes for 4.4.0-beta2 2023-06-08 18:41:06 +10:00
Andrew Tridgell
641ab1b7d5 HAL_ChibiOS: fixed USB pass-thru for 2nd USB endpoint
we need to align the endpoint ID in the structure
2023-06-08 18:41:06 +10:00
Andrew Tridgell
6b8dfcdeac AP_AHRS: don't reject airspeed using EKF if dead-reckoning
when dead-reckoning the EKF wind estimate can diverge from reality,
leading to us rejecting a valid airspeed sensor. We are best off
trusting airspeed if we are dead-reckoning
2023-06-08 18:41:06 +10:00
Andrew Tridgell
fe0268b2b8 AP_BoardConfig: fixed documentation of safety options
on and off were reversed
2023-06-08 18:41:06 +10:00
Iampete1
c161875659 Filter: SlewLimiter: always caculate slew limit 2023-06-08 18:41:06 +10:00
Andrew Tridgell
b8b2bfafdf AP_BattMonitor: allow max amps to be configured on INA2XX
this allows for higer current ranges with lower resolution
2023-06-08 18:41:06 +10:00
Andrew Tridgell
0aa51a6ed3 hwdef: use zero address for INA2XX to allow for different sensors 2023-06-08 18:41:06 +10:00
Andrew Tridgell
cc9ca6f013 AP_BattMonitor: auto-probe INA2XX address if address is zero
this makes life easier for users who don't know which device they have
2023-06-08 18:41:06 +10:00
Andrew Tridgell
443fbb7666 AP_BattMonitor: support INA228 and INA238 battery monitor
I2C monitors with similar functionality to INA226
2023-06-08 18:41:06 +10:00
Peter Barker
147abc67ab autotest: integrate features.json generation to build_binaries.py
we have to run the extract_features.py that corresponds to the branch being built.  We may say a feature is presnet when it isn't or vice-versa if we don't.
2023-06-08 18:41:06 +10:00
Andy Piper
c1943261ad AC_AutoTune: load test gains for correct axis when testing yaw D 2023-06-08 18:41:06 +10:00
Paul Riseborough
d5c6d1c8a8 AP_NavEKF3: Increase delta velocity bias state process noise
Required due to state variance collapse on ground with some systems using RTK GPS.
2023-06-08 18:41:06 +10:00
Paul Riseborough
328354999b AP_NavEKF3: Strengthen recovery from bad delta velocity bias learning 2023-06-08 18:41:06 +10:00
Paul Riseborough
388c4738dc 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-06-08 18:41:06 +10:00
Paul Riseborough
d04a301e9a AP_NavEKF3: Retune and fix delta velocity bias state variance protection 2023-06-08 18:41:06 +10:00
Andy Piper
f00f1af1d1 AP_NavEKF: ensure gyro biases are numbers
avoid errors during compass mot
2023-06-08 18:41:06 +10:00
Paul Riseborough
61b276995b AP_NavEKF3: Lock in wind state estimates when using srag to dead reckon 2023-06-08 18:41:06 +10:00
Andrew Tridgell
91e8099c34 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-06-08 18:41:06 +10:00
Andrew Tridgell
57d47e080b waf: added -g option to configure
this adds debug symbolds to the build without enabling other debug
code. This is needed for analysing watchdog crash dumps
2023-06-08 18:41:06 +10:00
Andy Piper
0553d06c14 AP_HAL_ChibiOS: correct locking on LED thread 2023-06-08 18:41:06 +10:00
Andy Piper
b2be3c1dbc AP_HAL_ChibiOS: move LED processing to a separate thread
LED processing on a separate thread allows much longer LED lengths to be handled without
compromising dshot timing or timeouts. The thread is also run at a lower priority to
reflect its lack of flight criticality
2023-06-08 18:41:06 +10:00
Andy Piper
cc84fd1859 AP_HAL: add helper functions for LEDs
add PRIORITY_LED for led output thread
2023-06-08 18:41:06 +10:00
Andy Piper
595be4d04d AP_HAL_ChibiOS: reduce IMU SPI low speed to 1Mhz to avoid chip initialization issues 2023-06-08 18:41:06 +10:00
Andy Piper
3d2fb949e0 AP_HAL_ChibiOS: FoxeerH743 GA release 2023-06-08 18:41:06 +10:00
Andy Piper
1428557140 AP_HAL_ChibiOS: update MambaF405v2 for ICM42688, bdshot and DMA on UART1 2023-06-08 18:41:06 +10:00
Andy Piper
eff26c0bb8 bootloaders: remove FlywooF745v2 bootloaders 2023-06-08 18:41:06 +10:00
Andy Piper
d9237518f3 AP_HAL_ChibiOS: add BMI270 and ICM42688 to FlywooF745 2023-06-08 18:41:06 +10:00
Andy Piper
129129b4ae AP_HAL_ChibiOS: remove erroneous FlywooF745v2 2023-06-08 18:41:06 +10:00
Andy Piper
e364f7f491 bootloaders: bootloaders for Flywoo F745v2 2023-06-08 18:41:06 +10:00
Andy Piper
d8a2eb5a87 AP_HAL_ChibiOS: hwdef for FlywooF745v2
Add SPL06 baro to FlywooF745v1
2023-06-08 18:41:06 +10:00
Randy Mackay
ac4e14fbb9 Copter: 4.4.0-beta1 release notes update 2023-06-08 18:41:06 +10:00
Randy Mackay
66cf54ba4e Rover: 4.4.0-beta1 release notes update 2023-06-08 18:41:06 +10:00
Andrew Tridgell
6fe6fb2317 Tools: update IO firmware 2023-05-23 15:21:45 +10:00
Andrew Tridgell
43a4ae4a8e 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-23 15:21:45 +10:00
Andrew Tridgell
bb5cd4f475 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-23 15:21:45 +10:00
Andrew Tridgell
bbe79b3c18 AP_NavEKF3: handle core setup failure
ensure num_cores is left as zero so that calls such as Log_Write don't
de-reference nullptr
2023-05-05 13:22:51 +10:00
Andrew Tridgell
d9c9875768 AP_NavEKF2: handle core setup failure
ensure num_cores is left as zero so that calls such as Log_Write don't
de-reference nullptr
2023-05-05 13:22:48 +10:00
Andrew Tridgell
030b1c855f AP_Param: added set() to AP_Enum 2023-04-26 17:36:49 +10:00
Peter Barker
a39357fe29 AP_Logger: do not rotate logs when disarming if we are replay-logging 2023-04-26 17:36:49 +10:00
Andrew Tridgell
313e8e39b6 AP_Logger: added LOG_DARM_RATEMAX
this sets the logging rate max when disarmed. In combination with
LOG_DISARMED=3 it gives a very nice setup to get always on logging
with very little addition to the log sizes. It is particularly useful
in combination with LOG_REPLAY=1
2023-04-26 17:36:49 +10:00
Andrew Tridgell
5328e70b50 AP_Logger: added LOG_DISARMED=3
when LOG_DISARMED is set to 3 then we log while disarmed but if we
reboot without ever arming the log is discarded. This allows for using
LOG_DISARMED without filling the microSD.
2023-04-26 17:36:49 +10:00
Andrew Tridgell
ee44de4d9a AP_Logger: use AP_Enum for log_disarmed 2023-04-26 17:36:49 +10:00
Henry Wurzburg
884e57e601 Tools: Add SpeedyBeeF405WING 2023-04-25 10:04:30 +10:00
Henry Wurzburg
6993a126d6 AP_HAL_ChibiOS: Add SpeedyBeeF405WING 2023-04-25 10:04:30 +10:00
Andrew Tridgell
07aa7b543e Plane: fixed release notes history
was missing 4.3.5
2023-04-22 08:27:26 +10:00
Andrew Tridgell
66eb8ba5bf Plane: prepare for 4.4.0beta1 2023-04-21 09:48:45 +10:00
Andrew Tridgell
bfbfc81720 Plane: release notes for 4.4.0beta1 2023-04-21 09:48:45 +10:00
Randy Mackay
cec42abc66 Copter: update 4.4.0-beta1 release notes based on peer feedback 2023-04-21 09:48:45 +10:00
Randy Mackay
7dc3ac8051 Copter: version to 4.4.0-beta1 2023-04-21 09:48:45 +10:00
Randy Mackay
33e98cfe13 Copter: 4.4.0-beta1 release notes 2023-04-21 09:48:45 +10:00
Randy Mackay
9929c2030c Rover: version to 4.4.0-beta1 2023-04-21 09:48:45 +10:00
Randy Mackay
d703a2d984 Rover: 4.4.0-beta1 release notes 2023-04-21 09:48:45 +10:00
Paul Riseborough
df2f8366c5 AP_NavEKF3: Improve protection against GPS glitches during yaw alignment 2023-04-21 09:48:45 +10:00
Paul Riseborough
dfd6e6d8ac AP_NavEKF3: Reduce use of GSF yaw for planes with no compass 2023-04-21 09:48:45 +10:00
Andy Piper
44950fd18e bootloaders: bootloaders for MatekF405-TE/VTOL-bdshot 2023-04-21 09:48:45 +10:00
Andy Piper
c40267644a AP_HAL_ChibiOS: hwdef for MatekF405-TE/VTOL including bdshot 2023-04-21 09:48:45 +10:00
bugobliterator
8d9c624632 AP_InertialSensor: fix hardfault in BatchSampler 2023-04-21 09:48:45 +10:00
Peter Barker
25c04c1fa2 AP_InertialSensor: correct access beyond array in Ins TCal 2023-04-21 09:48:45 +10:00
Peter Barker
a079b570d5 SimOnHW: correct compilation on CubeOrangePlus
this was at 2 to reduce CPU load.

But particularly when CubeOrangePlus is playing around with auxiliary IMUs we really want to be running on SimOnHardware just what we're running on the normal firmware.  We can find CPU cycles elsewhere....
2023-04-21 09:48:45 +10:00
Randy Mackay
3432bd0580 Copter: 4.3.6 release notes 2023-04-21 09:48:45 +10:00
Randy Mackay
72d923378d Copter: 4.3.6-beta2 release notes 2023-04-21 09:48:45 +10:00
Randy Mackay
74bf7754a3 Rover: 4.3.0-beta12 release notes 2023-04-21 09:48:45 +10:00
Randy Mackay
ab4d2e1119 Copter: 4.3.6-beta release notes 2023-04-21 09:48:45 +10:00
Randy Mackay
c522b0ad5c Rover: 4.3.6-beta11 release notes 2023-04-21 09:48:45 +10:00
Andrew Tridgell
673bf619e5 waf: added --board-start-time configure option 2023-03-26 16:47:21 +11:00
Andy Piper
3e83d40bd8 AP_HAL_ChibiOS: ensure that DMA source is correct on DMA send for rcout 2023-03-26 16:46:53 +11:00
Andy Piper
aabfce2099 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-26 16:46:51 +11:00
Andrew Tridgell
7527c6e278 HAL_ChibiOS: support starting the clock at non-zero
for testing time wrap bugs
2023-03-26 16:46:47 +11:00
Andrew Tridgell
c55a2916f6 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 16:46:44 +11:00
bugobliterator
b9e9d4cc4f AP_InertialSensor: fix duplicate sensor detection for AUX sensors 2023-03-24 11:55:45 +11:00
bugobliterator
f88db74356 AP_HAL_ChibiOS: add support for initialising extra sensors as AUX 2023-03-24 11:55:45 +11:00
bugobliterator
6eaa05960f AP_InertialSensor: increase the temp tolerance for INV2 driver for fifo reset 2023-03-23 08:00:05 +11:00
bugobliterator
7df64eb330 bootloaders: add CubeOrangePlus-bdshot bootloader 2023-03-22 18:14:01 +11:00
386 changed files with 13705 additions and 1329 deletions

View File

@ -55,7 +55,7 @@ jobs:
shell: C:\cygwin\bin\bash.exe -eo pipefail '{0}'
run: >-
ln -sf /usr/bin/python3.7 /usr/bin/python && ln -sf /usr/bin/pip3.7 /usr/bin/pip &&
python -m pip install --progress-bar off empy pexpect &&
python -m pip install --progress-bar off empy==3.3.4 pexpect &&
python -m pip install --progress-bar off dronecan --upgrade &&
cp /usr/bin/ccache /usr/local/bin/ &&
cd /usr/local/bin && ln -s ccache /usr/local/bin/gcc &&

View File

@ -62,7 +62,7 @@ jobs:
./install.sh
source ./export.sh
cd ../..
python -m pip install --progress-bar off future lxml pymavlink MAVProxy pexpect flake8 geocoder empy dronecan
python -m pip install --progress-bar off future lxml pymavlink MAVProxy pexpect flake8 geocoder empy==3.3.4 dronecan
which cmake
./waf configure --board ${{matrix.config}}
./waf plane

View File

@ -251,42 +251,3 @@ jobs:
shell: bash
run: |
diff -r $GITHUB_WORKSPACE/base_branch_bin_no_versions $GITHUB_WORKSPACE/pr_bin_no_versions --exclude=*.elf --exclude=*.apj || true
- name: elf_diff compare with ${{ github.event.pull_request.base.ref }}
shell: bash
run: |
# we don't use weasyprint so manually pull the elf_diff deps reduce install size and time
python3 -m pip install -U --no-deps elf_diff GitPython Jinja2 MarkupSafe PyYAML anytree dict2xml gitdb progressbar2 python-utils setuptools-git smmap
mkdir elf_diff
BIN_PREFIX="arm-none-eabi-"
if [ "${{ matrix.toolchain }}" = "armhf" ]; then
BIN_PREFIX="arm-linux-gnueabihf-"
fi
BOOTLOADER=0
AP_PERIPH=0
if [ "${{matrix.config}}" = "Hitec-Airspeed" ] ||
[ "${{matrix.config}}" = "f103-GPS" ]; then
AP_PERIPH=1
elif [ "${{matrix.config}}" = "MatekF405-CAN" ]; then
BOOTLOADER=1
fi
if [ $AP_PERIPH -eq 1 ]; then
TO_CHECK="AP_Periph"
elif [ $BOOTLOADER -eq 1 ]; then
TO_CHECK="AP_Bootloader"
else
TO_CHECK="arduplane arducopter"
fi
for CHECK in $TO_CHECK; do
python3 -m elf_diff --bin_prefix="$BIN_PREFIX" --html_dir=elf_diff/AP_Periph $GITHUB_WORKSPACE/base_branch_bin/$CHECK $GITHUB_WORKSPACE/pr_bin/$CHECK
done
zip -r elf_diff.zip elf_diff
- name: Archive elf_diff output
uses: actions/upload-artifact@v3
with:
name: ELF_DIFF_${{matrix.config}}
path: elf_diff.zip
retention-days: 14

View File

@ -9,6 +9,8 @@ public:
using GCS_MAVLINK::GCS_MAVLINK;
uint8_t sysid_my_gcs() const override;
protected:
// telem_delay is not used by Tracker but is pure virtual, thus
@ -16,7 +18,6 @@ protected:
// as currently Tracker may brick XBees
uint32_t telem_delay() const override { return 0; }
uint8_t sysid_my_gcs() const override;
MAV_RESULT handle_command_component_arm_disarm(const mavlink_command_long_t &packet) override;
MAV_RESULT _handle_command_preflight_calibration_baro(const mavlink_message_t &msg) override;

View File

@ -28,9 +28,10 @@ public:
bool simple_input_active() const override;
bool supersimple_input_active() const override;
uint8_t sysid_this_mav() const override;
protected:
uint8_t sysid_this_mav() const override;
// minimum amount of time (in microseconds) that must remain in
// the main scheduler loop before we are allowed to send any

View File

@ -1,5 +1,382 @@
ArduPilot Copter Release Notes:
------------------------------------------------------------------
Copter 4.4.4 19-Dec-2023 / 4.4.4-beta1 05-Dec-2023
Changes from 4.4.3
1) Autopilot related enhancement and fixes
- CubeOrange Sim-on-hardware compilation fix
- RADIX2HD supports external I2C compasses
- SpeedyBeeF405v4 support
2) Bug fixes
- DroneCAN battery monitor with cell monitor SoC reporting fix
- NTF_LED_TYPES parameter description fixed (was missing IS31FL3195)
- ProfiLED output fixed in both Notify and Scripting
- Scripting bug that could cause crash if parameters were added in flight
- STAT_BOOTCNT param fix (was not updating in some cases)
- Takeoff RPM check fixed where motors are attached to AUX channels
- don't query hobbywing DroneCAN ESC IDs while armed
------------------------------------------------------------------
Copter 4.4.3 14-Nov-2023
Changes from 4.4.3-beta1
1) AP_GPS: correct uBlox M10 configuration on low flash boards
------------------------------------------------------------------
Copter 4.4.3-beta1 07-Nov-2023
Changes from 4.4.2
1) Autopilot related enhancements and fixes
- BETAFTP-F405 board configuration fixes
- CubeOrangePlus-BG edition ICM45486 IMU setup fixed
- YJUAV_A6SE_H743 support
2) Minor enhancements
- GPS_DRV_OPTION allows using ellipsoid height in more GPS drivers
- Lua script support for fully populating ESC telemetry data
3) Bug fixes
- AK09916 compass being non-responsive fixed
- IxM42xxx IMUs "stuck" gyros fixed
- MAVLink response fixed when no airspeed sensor during preflight calibration
- Notch filtering protection when using uninitialised RPM source in ESC telemetry
- SIYI gimbal driver parsing bug fixed (was causing lost packets)
------------------------------------------------------------------
Copter 4.4.2 22-Oct-2023 / Copter 4.4.2-beta1 13-Oct-2023
Changes from 4.4.1
1) Autopilot related enhancements and fixes
- BETAFPV-F405 support
- MambaF405v2 battery and serial setup corrected
- mRo Control Zero OEM H7 bdshot support
- SpeedyBee-F405-Wing gets VTX power control
- SpeedyBee-F405-Mini support
- T-Motor H743 Mini support
2) EKF3 supports baroless boards
3) GPS-for-yaw allows base GPS to update at only 3Hz
4) INA battery monitor supports config of shunt resistor used (see BATTx_SHUNT)
5) Log VER message includes vehicle type
6) OpenDroneId option to auto-store IDs in persistent flash
7) RC SBUS protection against invalid data in first 4 channels
8) Bug fixes
- BMI088 IMU error value handling fixed to avoid occasional negative spike
- Dev environment CI autotest stability improvements
- OSD correct DisplayPort BF MSP symbols
- OSD option to correct direction arrows for BF font set
- Sensor status reporting to GCS fixed for baroless boards
------------------------------------------------------------------
Copter 4.4.1 26-Sep-2023 / 4.4.1-beta2 14-Sep-2023
Changes from 4.4.1-beta1
1) Autopilot related enhancements
- H750 external flash optimisations for to lower CPU load
- MambaF405Mini fixes to match manufacturer's recommended wiring
- RADIX2 HD support
- YJUAV_A6SE support
2) Bug fixes
- Airbotf4 features minimised to build for 4.4
- ChibiOS clock fix for 480Mhz H7 boards (affected FDCAN)
- RPI hardware version check fix
------------------------------------------------------------------
Copter 4.4.1-beta1 05-Sep-2023
Changes from 4.4.0
1) Autopilot related fixes and enhancements
- KakuteH7-wing get 8 bit directional dshot channel support
- Luminousbee5 boards defaults updated
- Navigator autopilot GPIOs fix (PWM output was broken)
- Pixhawk6C Serial RTS lines pulled low on startup
- QiotekZealotF427 and QiotekZealotH743 battery monitor default fixed
- SDMODELH7V1 support
2) Driver enhancements
- DroneCAN battery monitors allow reset of battery SoC
- Himark DroneCAN servo support
- Hobbywing DroneCAN ESC support
3) EKF3 high vibration handling improved with EK3_GLITCH_RADIUS option
4) Custom build server gets mission storage on SDCard selection
5) SITL default parameter handling bug fix
------------------------------------------------------------------
Copter 4.4.0 18-Aug-2023 / 4.4.0-beta5 12-Aug-2023
Changes from 4.4.0-beta4
1) Autopilots specific changes
- SIYI N7 support
2) Bug fixes
- DroneCAN airspeed sensor fix to handle missing packets
- DroneCAN GPS RTK injection fix
- Notch filter gyro glitch caused by race condition fixed
------------------------------------------------------------------
Copter 4.4.0-beta4 27-July-2023
Changes from 4.4.0-beta3
1) Autopilots specific changes
- Diatone-Mamba-MK4-H743v2 uses SPL06 baro (was DPS280)
- DMA for I2C disabled on F7 and H7 boards
- Foxeer H743v1 default serial protocol config fixes
- HeeWing-F405 and F405v2 support
- iFlight BlitzF7 support
2) Scripts may take action based on VTOL motor loss
3) Bug fixes
- BLHeli returns battery status requested via MSP (avoids hang when using esc-configurator)
- CRSFv3 rescans at baudrates to avoid RX loss
- EK3_ABIAS_P_NSE param range fix
- Scripting restart memory corruption bug fixed
- Siyi A8/ZR10 driver fix to avoid crash if serial port not configured
------------------------------------------------------------------
Copter 4.4.0-beta3 03-July-2023
Changes from 4.4.0-beta2
1) Autopilots specific changes
- Holybro KakuteH7-Wing support
- JFB100 external watchdog GPIO support added
- Pixhawk1-bdshot support
- Pixhawk6X-bdshot support
- SpeedyBeeF4 loses bdshot support
2) Device drivers
- added LP5562 I2C LED driver
- added IS31FL3195 LED driver
3) TradHeli gets minor fix to RSC servo output range
4) Camera and Gimbal related changes
- DO_SET_ROI_NONE command support added
5) Applet changes
- added QUIK_MAX_REDUCE parameter to VTOL quicktune lua applet
6) Bug fixes
- ADSB sensor loss of transceiver message less spammy
- AutoTune Yaw rate max fixed
- EKF vertical velocity reset fixed on loss of GPS
- GPS pre-arm failure message clarified
- SERVOx_PROTOCOL "SToRM32 Gimbal Serial" value renamed to "Gimbal" because also used by Siyi
- SERIALx_OPTION "Swap" renamed to "SwapTXRX" for clarity
- SBF GPS ellipsoid height fixed
- Ublox M10S GPS auto configuration fixed
- ZigZag mode user takeoff fixed (users could not takeoff in ZigZag mode previously)
------------------------------------------------------------------
Copter 4.4.0-beta2 05-Jun-2023
Changes from 4.4.0-beta1
1) Autopilots specific changes
- FlywooF745 update to motor pin output mapping and baro
- FoxeerH743 support
- JFB100 support
- Mamba-F405v2 supports ICM42688
- Matek-F405-TE/VTOL support
- Matek-H743 IMU SPI slowed to 1Mhz to avoid init issues
- SpeedyBee-405-Wing support
2) Copter specfic fixes and enhancements
- RTL speed fix so changes to WPNAV_SPEED have no effect if RTL_SPEED is non-zero
- RTL mode accepts do-change-speed commands from GCS
3) AHRS/EKF related fixes and Enhancements
- EKF allocation failure handled to avoid watchdog
- EKF3 accel bias calculation fix and tuning for greater robustness
- Airspeed sensor remains enabled during dead-reckoning (few copters have airspeed sensors)
- Wind speed estimates updates reduced while dead-reckoning
4) Other Enhancements
- Attitude control slew limits always calculated (helps tuning reporting and analysis)
- INA228 and INA238 I2C battery monitor support
- LOG_DISARMED=3 logs while disarmed but discards log if never eventually armed
- LOG_DARM_RATEMAX reduces logging while disarmed
- Serial LEDs threading enhancement to support longer lengths without dshot interference
4) Bug fixes
- Analog battery monitor2 current parameter default fixed
- AutoTune fix for loading Yaw Rate D gains
- BRD_SAFETYOPTION parameter documentation fix (ActiveForSafetyEnable and Disable were reversed)
- Compassmot fix to protect against bad gyro biases from GSF yaw
- ICE engine fix for starting after reaching a specified altitude
- LED thread locking fix to avoid watchdog
- Logging rotation on disarm disabled if Replay logging active (avoids gaps in logs)
- RC input on IOMCU bug fix (RC might not be regained if lost)
- Serial passthrough fixed
5) Custom build server fix to which features are included/excluded
------------------------------------------------------------------
Copter 4.4.0-beta1 19-Apr-2023
Changes from 4.3.6
1) New autopilots supported
- ESP32
- Flywoo Goku F405S AIO
- Foxeer H743v1
- MambaF405-2022B
- PixPilot-V3
- PixSurveyA2
- rFCU H743
- ThePeach K1/R1
2) Autopilot specific changes
- Bi-Directional DShot support for CubeOrangePlus-bdshot, CUAVNora+, MatekF405TE/VTOL-bdshot, MatekL431, Pixhawk6C-bdshot, QioTekZealotH743-bdshot
- Bi-Directional DShot up to 8 channels on MatekH743
- BlueRobotics Navigator supports baro on I2C bus 6
- BMP280 baro only for BeastF7, KakuteF4, KakuteF7Mini, MambaF405, MatekF405, Omnibusf4 to reduce code size (aka "flash")
- CSRF and Hott telemetry disabled by default on some low power boards (aka "minimised boards")
- Foxeer Reaper F745 supports external compasses
- OmnibusF4 support for BMI270 IMU
- OmnibusF7V2-bdshot support removed
- KakuteF7 regains displayport, frees up DMA from unused serial port
- KakuteH7v2 gets second battery sensor
- MambaH743v4 supports VTX
- MatekF405-Wing supports InvensenseV3 IMUs
- PixPilot-V6 heater enabled
- Raspberry 64OS startup crash fixed
- ReaperF745AIO serial protocol defaults fixed
- SkystarsH7HD (non-bdshot) removed as users should always use -bdshot version
- Skyviper loses many unnecessary features to save flash
- UBlox GPS only for AtomRCF405NAVI, BeastF7, MatekF405, Omnibusf4 to reduce code size (aka "flash")
- VRBrain-v52 and VRCore-v10 features reduced to save flash
3) Driver enhancements
- ARK RTK GPS support
- BMI088 IMU filtering and timing improved, ignores bad data
- CRSF OSD may display disarmed state after flight mode (enabled using RC_OPTIONS)
- Daiwa winch baud rate obeys SERIALx_BAUD parameter
- EFI supports fuel pressure and ignition voltage reporting and battery failsafe
- ICM45686 IMU support
- ICM20602 uses fast reset instead of full reset on bad temperature sample (avoids occasional very high offset)
- ICM45686 supports fast sampling
- MAX31865 temp sensor support
- MB85RS256TY-32k, PB85RS128C and PB85RS2MC FRAM support
- MMC3416 compass orientation fix
- MPPT battery monitor reliability improvements, enable/disable aux function and less spammy
- Multiple USD-D1-CAN radar support
- NMEA output rate configurable (see NMEA_RATE_MS)
- NMEA output supports PASHR message (see NMEA_MSG_EN)
- OSD supports average resting cell voltage (see OSD_ACRVOLT_xxx params)
- Rockblock satellite modem support
- Serial baud support for 2Mbps (only some hardware supports this speed)
- SF45b lidar filtering reduced (allows detecting smaller obstacles
- SmartAudio 2.0 learns all VTX power levels)
- UAVCAN ESCs report error count using ESC Telemetry
- Unicore GPS (e.g. UM982) support
- VectorNav 100 external AHRS support
- 5 IMUs supported
4) EKF related enhancements
- Baro compensation using wind estimates works when climbing or descending (see BAROx_WCF_UP/DN)
- External AHRS support for enabling only some sensors (e.g. IMU, Baro, Compass) see EAHRS_SENSORS
- Magnetic field tables updated
- Non-compass initial yaw alignment uses GPS course over GSF (mostly affects Planes and Rover)
5) Control and navigation enhancements
- AutoTune of attitude control yaw D gain (set AUTOTUNE_AXES=8)
- Circle moode and Loiter Turns command supports counter-clockwise rotation (set CIRCLE_RATE to negative number)
- DO_SET_ROI_NONE command turns off ROI
- JUMP_TAG mission item support
- Missions can be stored on SD card (see BRD_SD_MISSION)
- NAV_SCRIPT_TIME command accepts floating point arguments
- Pause/Resume returns success if mission is already paused or resumed
- Payload Place enhancements
- Descent speed is configurable (see PLDP_SPEED_DN)
- Manual release supported (detects pilot release of gripper)
- Post release delay is configurable (see PLDP_DELAY)
- Range finder range used to protect against premature release (see PLDP_RNG_MIN)
- Touchdown detection threshold is configurable (see PLDP_THRESH)
- Position controller angle max adjusted inflight with CH6 Tuning knob (set TUNE=59)
- Surface tracking time constant allows tuning response (see SURFTRAK_TC)
- Throttle-Gain boost increases attitude control gains when throttle high (see ATC_THR_G_BOOST)
- Waypoint navigation cornering acceleration is configurable (see WPNAV_ACCEL_C)
- WeatherVane into the wind in Auto and Guided modes (see WVANE_ENABLE)
6) TradHeli specific enhancements
- Manual autorotation support
- Improved collect to yaw compensation
7) Filtering enhancements
- FFT notch can be run based on filtered data
- Warn of motor noise at RPM frequency using FFT
- In-flight FFT can better track low frequency noise
- In-flight FFT logging improved
- IMU data can be read and replayed for FFT analysis
8) Camera and gimbal enhancements
- BMMCC support included in Servo driver
- DJI RS2/RS3-Pro gimbal support
- Dual camera support (see CAM2_TYPE)
- Gimbal/Mount2 can be moved to retracted or neutral position
- Gremsy ZIO support
- IMAGE_START_CAPTURE, SET_CAMERA_ZOOM/FOCUS, VIDEO_START/STOP_CAPTURE command support
- Paramters renamed and rescaled
- CAM_TRIGG_TYPE renamed to CAM1_TYPE and options have changed
- CAM_DURATION renamed to CAM1_DURATION and scaled in seconds
- CAM_FEEDBACK_PIN/POL renamed to CAM1_FEEBAK_PIN/POL
- CAM_MIN_INTERVAL renamed to CAM1_INTRVAL_MIN and scaled in seconds
- CAM_TRIGG_DIST renamed to CAMx_TRIGG_DIST and accepts fractional values
- RunCam2 4k support
- ViewPro camera gimbal support
9) Logging changes
- BARD msg includes 3-axis dynamic pressure useful for baro compensation of wind estimate
- MCU log msg includes main CPU temp and voltage (was part of POWR message)
- RCOut banner message always included in Logs
- SCR message includes memory usage of all running scripts
- CANS message includes CAN bus tx/rx statistics
- OFCA (optical flow calibration log message) units added
- Home location not logged to CMD message
- MOTB message includes throttle output
10) Scripting enhancements
- Copter deadreckoning upgraded to applet
- EFI Skypower driver gets improved telem messages and bug fixes
- Generator throttle control example added
- Heap max increased by allowing heap to be split across multiple underlying OS heaps
- Hexsoon LEDs applet
- Logging from scripts supports more formats
- Parameters can be removed or reordered
- Parameter description support (scripts must be in AP's applet or driver directory)
- Rangefinder driver support
- Runcam_on_arm applet starts recording when vehicle is armed
- Safety switch, E-Stop and motor interlock support
- Scripts can restart all scripts
- Script_Controller applet supports inflight switching of active scripts
11) Custom build server enhancements
- AIS support for displaying nearby boats can be included
- Battery, Camera and Compass drivers can be included/excluded
- EKF3 wind estimation can be included/excluded
- PCA9685, ToshibaLED, PLAY_TUNE notify drivers can be included/excluded
- Preclanding can be included/excluded
- RichenPower generator can be included/excluded
- RC SRXL protocol can be excluded
- SIRF GPSs can be included/excluded
12) Safety related enhancements and fixes
- Arming check for high throttle skipped when arming in Auto mode
- Arming check for servo outputs skipped when SERVOx_FUNCTION is scripting
- Arming check fix if both "All" and other bitmasks are selected (previously only ran the other checks)
- "EK3 sources require RangeFinder" pre-arm check fix when user only sets up 2nd rangefinder (e.g. 1st is disabled)
- Pre-arm check that low and critical battery failsafe thresholds are different
- Pre-arm message fixed if 2nd EKF core unhealthy
- Pre-arm check if reboot required to enabled IMU batch sampling (used for vibe analysis)
- RC failsafe (aka throttle failsafe) option to change to Brake mode
- RC failsafe timeout configurable (see RC_FS_TIMEOUT)
- Takeoff check of motor RPM (see TKOFF_RPM_MIN)
- Turtle mode warns user to raise throttle to arm
13) Minor enhancements
- Boot time reduced by improving parameter conversion efficiency
- BRD_SAFETYENABLE parameter renamed to BRD_SAFETY_DEFLT
- Compass calibration auxiliary switch function (set RCx_OPTION=171)
- Disable IMU3 auxiliary switch function (set RCx_OPTION=110)
- Frame type sent to GCS defaults to multicopter to ease first time setup
- Rangefinder and FS_OPTIONS param conversion code reduced (affects when upgrading from 3.6 or earlier)
- MAVFTP supports file renaming
- MAVLink in-progress reply to some requests for calibration from GCS
14) Bug fixes:
- ADSB telemetry and callsign fixes
- Battery pct reported to GCS limited to 0% to 100% range
- Bi-directional DShot fix on H7 boards after system time wrap (more complete fix than in 4.3.6)
- DisplayPort OSD screen reliability improvement on heavily loaded OSDs especially F4 boards
- DisplayPort OSD artificial horizon better matches actual horizon
- EFI Serial MS bug fix to avoid possible infinite loop
- EKF3 Replay fix when COMPASS_LEARN=3
- ESC Telemetry external temp reporting fix
- Fence upload works even if Auto mode is excluded from firmware
- FMT messages logged even when Fence is exncluded from firmware (e.g. unselected when using custom build server)
- Guided mode slow yaw fix
- Hardfault avoided if user changes INS_LOG_BAT_CNT while batch sampling running
- ICM20649 temp sensor tolerate increased to avoid unnecessary FIFO reset
- IMU detection bug fix to avoid duplicates
- IMU temp cal fix when using auxiliary IMU
- Message Interval fix for restoring default rate https://github.com/ArduPilot/ardupilot/pull/21947
- RADIO_STATUS messages slow-down feature never completely stops messages from being sent
- SERVOx_TRIM value output momentarily if SERVOx_FUNCTION is changed from Disabled to RCPassThru, RCIN1, etc. Avoids momentary divide-by-zero
- Scripting file system open fix
- Scripting PWM source deletion crash fix
- MAVFTP fix for low baudrates (4800 baud and lower)
- ModalAI VOXL reset handling fix
- MPU6500 IMU fast sampling rate to 4k (was 1K)
- NMEA GPGGA output fixed for GPS quality, num sats and hdop
- Position control reset avoided even with very uneven main loop rate due to high CPU load
- SingleCopter and CoaxCopter fix to fin centering when using DShot
- SystemID mode fix to write PID log messages
- Terrain offset increased from 15m to 30m (see TERRAIN_OFS_MAX)to reduce chance of "clamping"
- Throttle notch FFT tuning param fix
- VTX protects against pitmode changes when not enabled or vehicle disarmed
15) Developer specific items
- DroneCAN replaces UAVCAN
- FlighAxis simulator rangefinder fixed
- Scripts in applet and drivers directory checked using linter
- Simulator supports main loop timing jitter (see SIM_TIME_JITTER)
- Simulink model and init scripts
- SITL on hardware support (useful to demo servos moving in response to simulated flight)
- SITL parameter definitions added (some, not all)
- Webots 2023a simulator support
- XPlane support for wider range of aircraft
------------------------------------------------------------------
Copter 4.3.6 05-Apr-2023 / 4.3.6-beta1, 4.3.6--beta2 27-Mar-2023
Changes from 4.3.5
1) Bi-directional DShot fix for possible motor stop approx 72min after startup
------------------------------------------------------------------
Copter Copter 4.3.5 14-Mar-2023 / 4.3.5-rc1 01-Mar-2023
Changes from 4.3.4
1) Bug fixes

View File

@ -1319,6 +1319,10 @@ public:
bool use_pilot_yaw() const override;
bool set_speed_xy(float speed_xy_cms) override;
bool set_speed_up(float speed_up_cms) override;
bool set_speed_down(float speed_down_cms) override;
// RTL states
enum class SubMode : uint8_t {
STARTING,
@ -1782,6 +1786,7 @@ public:
bool has_manual_throttle() const override { return false; }
bool allows_arming(AP_Arming::Method method) const override { return true; }
bool is_autopilot() const override { return true; }
bool has_user_takeoff(bool must_navigate) const override { return true; }
// save current position as A or B. If both A and B have been saved move to the one specified
void save_or_move_to_destination(Destination ab_dest);

View File

@ -554,4 +554,22 @@ bool ModeRTL::use_pilot_yaw(void) const
return allow_yaw_option || land_repositioning || final_landing;
}
bool ModeRTL::set_speed_xy(float speed_xy_cms)
{
copter.wp_nav->set_speed_xy(speed_xy_cms);
return true;
}
bool ModeRTL::set_speed_up(float speed_up_cms)
{
copter.wp_nav->set_speed_up(speed_up_cms);
return true;
}
bool ModeRTL::set_speed_down(float speed_down_cms)
{
copter.wp_nav->set_speed_down(speed_down_cms);
return true;
}
#endif

View File

@ -29,6 +29,12 @@ void Copter::takeoff_check()
// check ESCs are sending RPM at expected level
uint32_t motor_mask = motors->get_motor_mask();
#if HAL_WITH_IO_MCU
if (AP_BoardConfig::io_enabled()) {
// In 4.4 and earlier ESC telemetry is always indexed from 1 for servo channels 9+
motor_mask >>= 8;
}
#endif
const bool telem_active = AP::esc_telem().is_telemetry_active(motor_mask);
const bool rpm_adequate = AP::esc_telem().are_motors_running(motor_mask, g2.takeoff_rpm_min);

View File

@ -6,14 +6,14 @@
#include "ap_version.h"
#define THISFIRMWARE "ArduCopter V4.4.0-dev"
#define THISFIRMWARE "ArduCopter V4.4.4"
// the following line is parsed by the autotest scripts
#define FIRMWARE_VERSION 4,4,0,FIRMWARE_VERSION_TYPE_DEV
#define FIRMWARE_VERSION 4,4,4,FIRMWARE_VERSION_TYPE_OFFICIAL
#define FW_MAJOR 4
#define FW_MINOR 4
#define FW_PATCH 0
#define FW_TYPE FIRMWARE_VERSION_TYPE_DEV
#define FW_PATCH 4
#define FW_TYPE FIRMWARE_VERSION_TYPE_OFFICIAL
#include <AP_Common/AP_FWVersionDefine.h>

View File

@ -203,7 +203,13 @@ void Plane::ahrs_update()
*/
void Plane::update_speed_height(void)
{
if (control_mode->does_auto_throttle()) {
bool should_run_tecs = control_mode->does_auto_throttle();
#if HAL_QUADPLANE_ENABLED
if (quadplane.should_disable_TECS()) {
should_run_tecs = false;
}
#endif
if (should_run_tecs) {
// Call TECS 50Hz update. Note that we call this regardless of
// throttle suppressed, as this needs to be running for
// takeoff detection
@ -543,7 +549,14 @@ void Plane::update_alt()
}
#endif
if (control_mode->does_auto_throttle() && !throttle_suppressed) {
bool should_run_tecs = control_mode->does_auto_throttle();
#if HAL_QUADPLANE_ENABLED
if (quadplane.should_disable_TECS()) {
should_run_tecs = false;
}
#endif
if (should_run_tecs && !throttle_suppressed) {
float distance_beyond_land_wp = 0;
if (flight_stage == AP_FixedWing::FlightStage::LAND &&

View File

@ -259,7 +259,7 @@ void Plane::stabilize_stick_mixing_fbw()
// non-linear and ends up as 2x the maximum, to ensure that
// the user can direct the plane in any direction with stick
// mixing.
float roll_input = channel_roll->norm_input();
float roll_input = channel_roll->norm_input_dz();
if (roll_input > 0.5f) {
roll_input = (3*roll_input - 1);
} else if (roll_input < -0.5f) {
@ -273,7 +273,7 @@ void Plane::stabilize_stick_mixing_fbw()
return;
}
float pitch_input = channel_pitch->norm_input();
float pitch_input = channel_pitch->norm_input_dz();
if (pitch_input > 0.5f) {
pitch_input = (3*pitch_input - 1);
} else if (pitch_input < -0.5f) {

View File

@ -11,13 +11,14 @@ public:
using GCS_MAVLINK::GCS_MAVLINK;
uint8_t sysid_my_gcs() const override;
protected:
uint32_t telem_delay() const override;
void handle_mission_set_current(AP_Mission &mission, const mavlink_message_t &msg) override;
uint8_t sysid_my_gcs() const override;
bool sysid_enforce() const override;
MAV_RESULT handle_command_preflight_calibration(const mavlink_command_long_t &packet, const mavlink_message_t &msg) override;

View File

@ -680,6 +680,9 @@ private:
// The amount of time we should stay in a loiter for the Loiter Time command. Milliseconds.
uint32_t time_max_ms;
// current value of loiter radius in metres used by the controller
float radius;
} loiter;
// Conditional command
@ -720,6 +723,9 @@ private:
// are we trying to follow terrain?
bool terrain_following;
// are we waiting to load terrain data to init terrain following
bool terrain_following_pending;
// target altitude above terrain in cm, valid if terrain_following
// is set
int32_t terrain_alt_cm;
@ -833,7 +839,7 @@ private:
void reset_offset_altitude(void);
void set_offset_altitude_location(const Location &start_loc, const Location &destination_loc);
bool above_location_current(const Location &loc);
void setup_terrain_target_alt(Location &loc) const;
void setup_terrain_target_alt(Location &loc);
int32_t adjusted_altitude_cm(void);
int32_t adjusted_relative_altitude_cm(void);
float mission_alt_offset(void);

View File

@ -1,3 +1,430 @@
Release 4.4.4 19th December 2023
--------------------------------
Changes from 4.4.3:
- CubeOrange Sim-on-hardware compilation fix
- RADIX2HD supports external I2C compasses
- SpeedyBeeF405v4 support
- DroneCAN battery monitor with cell monitor SoC reporting fix
- ProfiLED output fixed in both Notify and Scripting
- NTF_LED_TYPES parameter description fixed (was missing IS31FL3195)
- Scripting bug that could cause crash if parameters were added in flight
- STAT_BOOTCNT param fix (was not updating in some cases)
- don't query hobbywing DroneCAN ESC IDs while armed
- clamp empy version to prevent build errors
Release 4.4.3 14th November 2023
--------------------------------
Changes from 4.4.2:
- fixed setup of ICM45486 IMU on CubeOrangePlus-BG edition
- disable AFSR on IxM42xxx IMUs to prevent gyro bias for "stuck" gyros
- fixed AK09916 compass being non-responsive
- implement GPS_DRV_OPTION for using ellipsoid height in more GPS drivers
- fixed SIYI AP_Mount parsing bug
- configuration fixes for BETAFTP-F405 boards
- fixed origin versus home relative bug in quadplane landing and guided takeoff
- correct mavlink response for no airspeed sensor on preflight calibration
- protect against notch filtering with uninitialised RPM source in ESC telemetry
- allow lua scripts to populate full ESC telemetry data
- added YJUAV_A6SE_H743 support
- fixed uBlox M10 GPS support on boards with 1M flash
Release 4.4.2 23th October 2023
-------------------------------
Changes from 4.4.1
- BETAFPV-F405 support
- MambaF405v2 battery and serial setup corrected
- mRo Control Zero OEM H7 bdshot support
- SpeedyBee-F405-Wing gets VTX power control
- SpeedyBee-F405-Mini support
- T-Motor H743 Mini support
- EKF3 supports baroless boards
- INA battery monitor supports config of shunt resistor used (see BATTx_SHUNT)
- BMI088 IMU error value handling fixed to avoid occasional negative spike
- Dev environment CI autotest stability improvements
- OSD correct DisplayPort BF MSP symbols
- OSD option to correct direction arrows for BF font set
- Sensor status reporting to GCS fixed for baroless boards
- added opendroneid option to auto-store IDs in persistent flash
- fixed TECS bug that could cause inability to climb or descend
- fixed race condition when starting TECS controlled mode
- fixed RTL with rally point and terrain follow
- protect against invalid data in SBUS for first 4 channels
- added build type to VER message
- allow moving baseline rover at 3Hz
- use RC deadzones in stick mixing
Release 4.4.1 26th September 2023
---------------------------------
No changes from beta2
Release 4.4.1-beta2 12th September 2023
--------------------------------------
Changes from 4.4.1-beta1
- Airbotf4 features minimised to build for 4.4
- ChibiOS clock fix for 480Mhz H7 boards (affected FDCAN)
- H750 external flash optimisations for to lower CPU load
- MambaF405Mini fixes to match manufacturer's recommended wiring
- RADIX2 HD support
- RPI hardware version check fix
- YJUAV_A6SE support
Release 4.4.1-beta1 5th September 2023
--------------------------------------
Changes from 4.4.1
- support Himark DroneCAN servos
- support Hobbywing DroneCAN ESCs
- fixed control surface deflection on quadplanes in VTOL takeoff wait
- fixed bug in parameter default handling in SITL
- allow selection of mission sdcard storage on custom.ardupilot.org
- added support for SDMODELH7V1
- fixed battery monitor default for QiotekZealotF427 and QiotekZealotH743
- support 8 bit directional dshot channels on KakuteH7-wing
- improved handling of high vibration in EKF3 with new EK3_GLITCH_RADIUS options
- allow reset of battery SoC for DroneCAN battery monitors
- update GPIOs for Navigator board in HAL_Linux
- pull RTS lines low on Pixhawk6C on startup
- added log_file_content in scripting for aerobatics
- added asymmetry factor for skid steering on rovers
- updated defaults for luminousbee5 boards
Happy flying!
Release 4.4.0 18th August 2023
------------------------------
No changes from beta5
Release 4.4.0-beta5 11th August 2023
------------------------------------
Changes from 4.4.0-beta4
- fixed handling of missing DroneCAN airspeed packet
- fixed reset of target altitude in plane GUIDED mode
- added SIYI N7 flight controller
- fixed auto-enable of fence with forced arm
- fixed race condition that caused notch filter gyro glitches
- fixed bug with RTK injection for DroneCAN
Release 4.4.0 beta4
-------------------
Changes from 4.4.0-beta3
1) flight controller specific changes
- Diatone-Mamba-MK4-H743v2 uses SPL06 baro (was DPS280)
- DMA for I2C disabled on F7 and H7 boards
- Foxeer H743v1 default serial protocol config fixes
- HeeWing-F405 and F405v2 support
- iFlight BlitzF7 support
2) Scripts may take action based on VTOL motor loss
3) Bug fixes
- BLHeli returns battery status requested via MSP (avoids hang when using esc-configurator)
- CRSFv3 rescans at baudrates to avoid RX loss
- EK3_ABIAS_P_NSE param range fix
- Scripting restart memory corruption bug fixed
- Siyi A8/ZR10 driver fix to avoid crash if serial port not configured
Release 4.4.0 beta3
-------------------
This is the third beta of plane 4.4.0. This includes some important
fixes since beta2
1) flight controller specific changes
- Holybro KakuteH7-Wing support
- JFB100 external watchdog GPIO support added
- Pixhawk1-bdshot support
- Pixhawk6X-bdshot support
- SpeedyBeeF4 loses bdshot support
3) Camera and Gimbal related changes
- DO_SET_ROI_NONE command support added
4) Bug fixes
- ADSB sensor loss of transceiver message less spammy
- AutoTune Yaw rate max fixed
- EKF vertical velocity reset fixed on loss of GPS
- GPS pre-arm failure message clarified
- SERVOx_PROTOCOL "SToRM32 Gimbal Serial" value renamed to "Gimbal" because also used by Siyi
- SERIALx_OPTION "Swap" renamed to "SwapTXRX" for clarity
- SBF GPS ellipsoid height fixed
- Ublox M10S GPS auto configuration fixed
- ZigZag mode user takeoff fixed (users could not takeoff in ZigZag mode previously)
- fixed memory corruption bug with scripting restart
5) Device drivers
- added LP5562 I2C LED driver
- added IS31FL3195 LED driver
6) Applet changes
- added QUIK_MAX_REDUCE parameter to VTOL quicktune lua applet
7) Plane specific changes
- fixed takeoff mode to ensure climb to takeoff alt before turning
- fixed error in quadplane wait for rudder neutral
- improved handling of forward throttle during VTOL landing
- fixed TECS state reset in VTOL auto modes
- fixed early exit from loiter to alt
- fixed display of started airspeed wait on forward transition
Release 4.4.0 beta2
-------------------
This is the second beta of plane 4.4.0. This includes some important
fixes since beta1.
The full list of changes is:
- added SpeedyBeeF405WING, JSB100 and FoxeerH743
- added LOG_DISARMED=3 support and LOG_DARM_RATEMAX
- fixed error handling for being out of memory in EKF initialisation
- fixed a bug in RC input handling on the IOMCU
- fixed a bug handling ICE engine start after altitude reached
- adjust EKF3 accel bias process noise for greater robustness
- fixed an EKF3 bug in accel bias calculations
- cope with compassmot impacting GSF yaw numerical stability
- fixed an AUTOTUNE/QAUTOTUNE bug in yaw tuning
- support INA228 and INA238 I2C battery monitors
- always log rate PID slew limiters even when slew limit is zero
- added MambaF4050v2 for new IMU, bdshot and DMA on UART1
- update for FoxeerH743v1 GA release
- reduced IMU init speed on MatekH743
- move LED serial processing to its own thread
- fixed parameter documentation for BRD_SAFETYOPTION
- don't reject airspeed using EKF innovation if dead-reckoning
- fixed USB pass-thru on 2nd USB endpoint
Release 4.4.0 beta1
-------------------
This is the first beta of plane 4.4.0. It is a big release with lots
of changes. Many thanks to all the people who have contributed!
1) New autopilots supported
- ESP32
- Flywoo Goku F405S AIO
- Foxeer H743v1
- MambaF405-2022B
- PixPilot-V3
- PixSurveyA2
- rFCU H743
- ThePeach K1/R1
2) Autopilot specific changes
- Bi-Directional DShot support for CubeOrangePlus-bdshot, CUAVNora+, MatekF405TE/VTOL-bdshot, MatekL431, Pixhawk6C-bdshot, QioTekZealotH743-bdshot
- Bi-Directional DShot up to 8 channels on MatekH743
- BlueRobotics Navigator supports baro on I2C bus 6
- BMP280 baro only for BeastF7, KakuteF4, KakuteF7Mini, MambaF405, MatekF405, Omnibusf4 to reduce code size (aka "flash")
- CSRF and Hott telemetry disabled by default on some low power boards (aka "minimised boards")
- Foxeer Reaper F745 supports external compasses
- OmnibusF4 support for BMI270 IMU
- OmnibusF7V2-bdshot support removed
- KakuteF7 regains displayport, frees up DMA from unused serial port
- KakuteH7v2 gets second battery sensor
- MambaH743v4 supports VTX
- MatekF405-Wing supports InvensenseV3 IMUs
- PixPilot-V6 heater enabled
- Raspberry 64OS startup crash fixed
- ReaperF745AIO serial protocol defaults fixed
- SkystarsH7HD (non-bdshot) removed as users should always use -bdshot version
- Skyviper loses many unnecessary features to save flash
- UBlox GPS only for AtomRCF405NAVI, BeastF7, MatekF405, Omnibusf4 to reduce code size (aka "flash")
- VRBrain-v52 and VRCore-v10 features reduced to save flash
3) Driver enhancements
- ARK RTK GPS support
- BMI088 IMU filtering and timing improved, ignores bad data
- CRSF OSD may display disarmed state after flight mode (enabled using RC_OPTIONS)
- Daiwa winch baud rate obeys SERIALx_BAUD parameter
- EFI supports fuel pressure and ignition voltage reporting and battery failsafe
- ICM45686 IMU support
- ICM20602 uses fast reset instead of full reset on bad temperature sample (avoids occasional very high offset)
- ICM45686 supports fast sampling
- MAX31865 temp sensor support
- MB85RS256TY-32k, PB85RS128C and PB85RS2MC FRAM support
- MMC3416 compass orientation fix
- MPPT battery monitor reliability improvements, enable/disable aux function and less spammy
- Multiple USD-D1-CAN radar support
- NMEA output rate configurable (see NMEA_RATE_MS)
- NMEA output supports PASHR message (see NMEA_MSG_EN)
- OSD supports average resting cell voltage (see OSD_ACRVOLT_xxx params)
- Rockblock satellite modem support
- Serial baud support for 2Mbps (only some hardware supports this speed)
- SF45b lidar filtering reduced (allows detecting smaller obstacles
- SmartAudio 2.0 learns all VTX power levels)
- UAVCAN ESCs report error count using ESC Telemetry
- Unicore GPS (e.g. UM982) support
- VectorNav 100 external AHRS support
- 5 IMUs supported
4) EKF related enhancements
- Baro compensation using wind estimates works when climbing or descending (see BAROx_WCF_UP/DN)
- External AHRS support for enabling only some sensors (e.g. IMU, Baro, Compass) see EAHRS_SENSORS
- Magnetic field tables updated
- Non-compass initial yaw alignment uses GPS course over GSF (mostly affects Planes and Rover)
5) Control and navigation enhancements
- AutoTune of attitude control yaw D gain (set AUTOTUNE_AXES=8)
- DO_SET_ROI_NONE command turns off ROI
- JUMP_TAG mission item support
- Missions can be stored on SD card (see BRD_SD_MISSION)
- NAV_SCRIPT_TIME command accepts floating point arguments
- Pause/Resume returns success if mission is already paused or resumed
- Payload Place support via lua script in quadplanes
7) Filtering enhancements
- FFT notch can be run based on filtered data
- Warn of motor noise at RPM frequency using FFT
- In-flight FFT can better track low frequency noise
- In-flight FFT logging improved
- IMU data can be read and replayed for FFT analysis
8) Camera and gimbal enhancements
- BMMCC support included in Servo driver
- DJI RS2/RS3-Pro gimbal support
- Dual camera support (see CAM2_TYPE)
- Gimbal/Mount2 can be moved to retracted or neutral position
- Gremsy ZIO support
- IMAGE_START_CAPTURE, SET_CAMERA_ZOOM/FOCUS, VIDEO_START/STOP_CAPTURE command support
- Paramters renamed and rescaled
i) CAM_TRIGG_TYPE renamed to CAM1_TYPE and options have changed
ii) CAM_DURATION renamed to CAM1_DURATION and scaled in seconds
iii) CAM_FEEDBACK_PIN/POL renamed to CAM1_FEEBAK_PIN/POL
iv) CAM_MIN_INTERVAL renamed to CAM1_INTRVAL_MIN and scaled in seconds
v) CAM_TRIGG_DIST renamed to CAMx_TRIGG_DIST and accepts fractional values
- RunCam2 4k support
- ViewPro camera gimbal support
9) Logging changes
- BARO msg includes 3-axis dynamic pressure useful for baro compensation of wind estimate
- MCU log msg includes main CPU temp and voltage (was part of POWR message)
- RCOut banner message always included in Logs
- SCR message includes memory usage of all running scripts
- CANS message includes CAN bus tx/rx statistics
- OFCA (optical flow calibration log message) units added
- Home location not logged to CMD message
- MOTB message includes throttle output
10) Scripting enhancements
- Generator throttle control example added
- Heap max increased by allowing heap to be split across multiple underlying OS heaps
- Hexsoon LEDs applet
- Logging from scripts supports more formats
- Parameters can be removed or reordered
- Parameter description support (scripts must be in AP's applet or driver directory)
- Rangefinder driver support
- Runcam_on_arm applet starts recording when vehicle is armed
- Safety switch, E-Stop and motor interlock support
- Scripts can restart all scripts
- Script_Controller applet supports inflight switching of active scripts
11) Custom build server enhancements
- AIS support for displaying nearby boats can be included
- Battery, Camera and Compass drivers can be included/excluded
- EKF3 wind estimation can be included/excluded
- PCA9685, ToshibaLED, PLAY_TUNE notify drivers can be included/excluded
- RichenPower generator can be included/excluded
- RC SRXL protocol can be excluded
- SIRF GPSs can be included/excluded
12) Safety related enhancements and fixes
- "EK3 sources require RangeFinder" pre-arm check fix when user only sets up 2nd rangefinder (e.g. 1st is disabled)
- Pre-arm check that low and critical battery failsafe thresholds are different
- Pre-arm message fixed if 2nd EKF core unhealthy
- Pre-arm check if reboot required to enabled IMU batch sampling (used for vibe analysis)
13) Minor enhancements
- Boot time reduced by improving parameter conversion efficiency
- BRD_SAFETYENABLE parameter renamed to BRD_SAFETY_DEFLT
- Compass calibration auxiliary switch function (set RCx_OPTION=171)
- Disable IMU3 auxiliary switch function (set RCx_OPTION=110)
- MAVFTP supports file renaming
- MAVLink in-progress reply to some requests for calibration from GCS
14) Bug fixes:
- ADSB telemetry and callsign fixes
- Battery pct reported to GCS limited to 0% to 100% range
- Bi-directional DShot fix on H7 boards after system time wrap (more complete fix than in 4.3.6)
- DisplayPort OSD screen reliability improvement on heavily loaded OSDs especially F4 boards
- DisplayPort OSD artificial horizon better matches actual horizon
- EFI Serial MS bug fix to avoid possible infinite loop
- EKF3 Replay fix when COMPASS_LEARN=3
- ESC Telemetry external temp reporting fix
- Fence upload works even if Auto mode is excluded from firmware
- FMT messages logged even when Fence is exncluded from firmware (e.g. unselected when using custom build server)
- Hardfault avoided if user changes INS_LOG_BAT_CNT while batch sampling running
- ICM20649 temp sensor tolerate increased to avoid unnecessary FIFO reset
- IMU detection bug fix to avoid duplicates
- IMU temp cal fix when using auxiliary IMU
- Message Interval fix for restoring default rate https://github.com/ArduPilot/ardupilot/pull/21947
- RADIO_STATUS messages slow-down feature never completely stops messages from being sent
- SERVOx_TRIM value output momentarily if SERVOx_FUNCTION is changed from Disabled to RCPassThru, RCIN1, etc. Avoids momentary divide-by-zero
- Scripting file system open fix
- Scripting PWM source deletion crash fix
- MAVFTP fix for low baudrates (4800 baud and lower)
- ModalAI VOXL reset handling fix
- MPU6500 IMU fast sampling rate to 4k (was 1K)
- NMEA GPGGA output fixed for GPS quality, num sats and hdop
- Position control reset avoided even with very uneven main loop rate due to high CPU load
- Terrain offset increased from 15m to 30m (see TERRAIN_OFS_MAX) to reduce chance of "clamping"
- Throttle notch FFT tuning param fix
15) Developer specific items
- DroneCAN replaces UAVCAN
- FlighAxis simulator rangefinder fixed
- Scripts in applet and drivers directory checked using linter
- Simulator supports main loop timing jitter (see SIM_TIME_JITTER)
- Simulink model and init scripts
- SITL on hardware support (useful to demo servos moving in response to simulated flight)
- SITL parameter definitions added (some, not all)
- Webots 2023a simulator support
- XPlane support for wider range of aircraft
16) Plane specific changes
- new aerobatics scripting system with flexible schedules
- added plane-3d SITL model
- added quadlane landing abort AUX switch
- added TKOFF_GND_PITCH for taildragger takeoff
- new ACRO_LOCKING=2 mode for quaternion locking with yaw rate controller
- allow yaw rate autotune in modes other than AUTOTUNE
- use a cone for QRTL climb close to home
- added Y4 VTOL config for quadplanes
- added throttle scaling for vectored yaw
- added turn corrdination to yaw AUTOTUNE
- added Q_OPTION for motor tilt when disarmed in fixed wing modes
Release 4.3.5 26th March 2023
------------------------------
- fixed 32 bit microsecond wrap in BDShot code
This release has a single bug fix for a critical bug for anyone using
bi-directional DShot on their vehicle. If using bi-directional DShot
and the vehicle is running its motors when 32 bit microsecond time
wraps at 71 minutes (or multiples of 71 minutes) then the bug that is
fixed in this release has an approximately 1 in 3 chance of causing
the motor to stop.
Note that the time is the time since boot, not the time since arming,
so even vehicles flying for a short time could be vulnerable if they
sit for a long time on the ground before takeoff.
Release 4.3.4 1st March 2023
-----------------------------

View File

@ -191,6 +191,12 @@ void Plane::set_target_altitude_location(const Location &loc)
target_altitude.amsl_cm += home.alt;
}
#if AP_TERRAIN_AVAILABLE
if (target_altitude.terrain_following_pending) {
/* we didn't get terrain data to init when we started on this
target, retry
*/
setup_terrain_target_alt(next_WP_loc);
}
/*
if this location has the terrain_alt flag set and we know the
terrain altitude of our current location then treat it as a
@ -448,12 +454,16 @@ bool Plane::above_location_current(const Location &loc)
modify a destination to be setup for terrain following if
TERRAIN_FOLLOW is enabled
*/
void Plane::setup_terrain_target_alt(Location &loc) const
void Plane::setup_terrain_target_alt(Location &loc)
{
#if AP_TERRAIN_AVAILABLE
if (terrain_enabled_in_current_mode()) {
loc.change_alt_frame(Location::AltFrame::ABOVE_TERRAIN);
if (!loc.change_alt_frame(Location::AltFrame::ABOVE_TERRAIN)) {
target_altitude.terrain_following_pending = true;
return;
}
}
target_altitude.terrain_following_pending = false;
#endif
}

View File

@ -8,7 +8,11 @@ bool Plane::start_command(const AP_Mission::Mission_Command& cmd)
// default to non-VTOL loiter
auto_state.vtol_loiter = false;
// log when new commands start
#if AP_TERRAIN_AVAILABLE
plane.target_altitude.terrain_following_pending = false;
#endif
// log when new commands start
if (should_log(MASK_LOG_CMD)) {
logger.Write_Mission_Cmd(mission, cmd);
}

View File

@ -56,6 +56,7 @@ bool Mode::enter()
plane.guided_state.target_heading_type = GUIDED_HEADING_NONE;
plane.guided_state.target_airspeed_cm = -1; // same as above, although an airspeed of -1 is rare on plane.
plane.guided_state.target_alt = -1; // same as above, although a target alt of -1 is rare on plane.
plane.guided_state.target_alt_time_ms = 0;
plane.guided_state.last_target_alt = 0;
#endif
@ -90,6 +91,10 @@ bool Mode::enter()
quadplane.mode_enter();
#endif
#if AP_TERRAIN_AVAILABLE
plane.target_altitude.terrain_following_pending = false;
#endif
bool enter_result = _enter();
if (enter_result) {

View File

@ -42,8 +42,7 @@ bool ModeLoiter::isHeadingLinedUp(const Location loiterCenterLoc, const Location
// Return true if current heading is aligned to vector to targetLoc.
// Tolerance is initially 10 degrees and grows at 10 degrees for each loiter circle completed.
const uint16_t loiterRadius = abs(plane.aparm.loiter_radius);
if (loiterCenterLoc.get_distance(targetLoc) < loiterRadius + loiterRadius*0.05) {
if (loiterCenterLoc.get_distance(targetLoc) < 1.05f * fabsf(plane.loiter.radius)) {
/* Whenever next waypoint is within the loiter radius plus 5%,
maintaining loiter would prevent us from ever pointing toward the next waypoint.
Hence break out of loiter immediately

View File

@ -40,7 +40,7 @@ const AP_Param::GroupInfo ModeTakeoff::var_info[] = {
// @Units: m
// @User: Standard
AP_GROUPINFO("DIST", 4, ModeTakeoff, target_dist, 200),
// @Param: GND_PITCH
// @DisplayName: Takeoff run pitch demand
// @Description: Degrees of pitch angle demanded during the takeoff run before speed reaches TKOFF_ROTATE_SPD. For taildraggers set to 3-point ground pitch angle and use TKOFF_TDRAG_ELEV to prevent nose tipover. For nose-wheel steer aircraft set to the ground pitch angle and if a reduction in nose-wheel load is required as speed rises, use a positive offset in TKOFF_GND_PITCH of up to 5 degrees above the angle on ground, starting at the mesured pitch angle and incrementing in 1 degree steps whilst checking for premature rotation and takeoff with each increment. To increase nose-wheel load, use a negative TKOFF_TDRAG_ELEV and refer to notes on TKOFF_TDRAG_ELEV before making adjustments.
@ -68,61 +68,75 @@ bool ModeTakeoff::_enter()
void ModeTakeoff::update()
{
if (!takeoff_started) {
// see if we will skip takeoff as already flying
if (plane.is_flying() && (millis() - plane.started_flying_ms > 10000U) && ahrs.groundspeed() > 3) {
gcs().send_text(MAV_SEVERITY_INFO, "Takeoff skipped - circling");
plane.prev_WP_loc = plane.current_loc;
plane.next_WP_loc = plane.current_loc;
takeoff_started = true;
plane.set_flight_stage(AP_FixedWing::FlightStage::NORMAL);
}
// don't setup waypoints if we dont have a valid position and home!
if (!(plane.current_loc.initialised() && AP::ahrs().home_is_set())) {
plane.calc_nav_roll();
plane.calc_nav_pitch();
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, 0.0);
return;
}
const float alt = target_alt;
const float dist = target_dist;
if (!takeoff_started) {
// setup target location 1.5 times loiter radius from the
// takeoff point, at a height of TKOFF_ALT
const float dist = target_dist;
const float alt = target_alt;
const uint16_t altitude = plane.relative_ground_altitude(false,true);
const float direction = degrees(ahrs.yaw);
// see if we will skip takeoff as already flying
if (plane.is_flying() && (millis() - plane.started_flying_ms > 10000U) && ahrs.groundspeed() > 3) {
if (altitude >= alt) {
gcs().send_text(MAV_SEVERITY_INFO, "Above TKOFF alt - loitering");
plane.next_WP_loc = plane.current_loc;
takeoff_started = true;
plane.set_flight_stage(AP_FixedWing::FlightStage::NORMAL);
} else {
gcs().send_text(MAV_SEVERITY_INFO, "Climbing to TKOFF alt then loitering");
plane.next_WP_loc = plane.current_loc;
plane.next_WP_loc.alt += ((alt - altitude) *100);
plane.next_WP_loc.offset_bearing(direction, dist);
takeoff_started = true;
plane.set_flight_stage(AP_FixedWing::FlightStage::NORMAL);
}
// not flying so do a full takeoff sequence
} else {
// setup target waypoint and alt for loiter at dist and alt from start
start_loc = plane.current_loc;
plane.prev_WP_loc = plane.current_loc;
plane.next_WP_loc = plane.current_loc;
plane.next_WP_loc.alt += alt*100.0;
plane.next_WP_loc.offset_bearing(direction, dist);
start_loc = plane.current_loc;
plane.prev_WP_loc = plane.current_loc;
plane.next_WP_loc = plane.current_loc;
plane.next_WP_loc.alt += alt*100.0;
plane.next_WP_loc.offset_bearing(direction, dist);
plane.crash_state.is_crashed = false;
plane.crash_state.is_crashed = false;
plane.auto_state.takeoff_pitch_cd = level_pitch * 100;
plane.auto_state.takeoff_pitch_cd = level_pitch * 100;
plane.set_flight_stage(AP_FixedWing::FlightStage::TAKEOFF);
plane.set_flight_stage(AP_FixedWing::FlightStage::TAKEOFF);
if (!plane.throttle_suppressed) {
gcs().send_text(MAV_SEVERITY_INFO, "Takeoff to %.0fm at %.1fm to %.1f deg",
alt, dist, direction);
takeoff_started = true;
if (!plane.throttle_suppressed) {
gcs().send_text(MAV_SEVERITY_INFO, "Takeoff to %.0fm for %.1fm heading %.1f deg",
alt, dist, direction);
takeoff_started = true;
}
}
}
// we finish the initial level takeoff if we climb past
// TKOFF_LVL_ALT or we pass the target location. The check for
// target location prevents us flying forever if we can't climb
// reset the loiter waypoint target to be correct bearing and dist
// from starting location in case original yaw used to set it was off due to EKF
// reset or compass interference from max throttle
if (plane.flight_stage == AP_FixedWing::FlightStage::TAKEOFF &&
(plane.current_loc.alt - start_loc.alt >= level_alt*100 ||
start_loc.get_distance(plane.current_loc) >= target_dist)) {
// reached level alt, re-calculate bearing to cope with systems with no compass
// or with poor initial compass
float direction = start_loc.get_bearing_to(plane.current_loc) * 0.01;
float dist_done = start_loc.get_distance(plane.current_loc);
const float dist = target_dist;
plane.next_WP_loc = plane.current_loc;
plane.next_WP_loc.offset_bearing(direction, MAX(dist-dist_done, 0));
plane.next_WP_loc.alt = start_loc.alt + target_alt*100.0;
start_loc.get_distance(plane.current_loc) >= dist)) {
// reset the target loiter waypoint using current yaw which should be close to correct starting heading
const float direction = start_loc.get_bearing_to(plane.current_loc) * 0.01;
plane.next_WP_loc = start_loc;
plane.next_WP_loc.offset_bearing(direction, dist);
plane.next_WP_loc.alt += alt*100.0;
plane.set_flight_stage(AP_FixedWing::FlightStage::NORMAL);
#if AP_FENCE_ENABLED
plane.fence.auto_enable_fence_after_takeoff();
#endif

View File

@ -344,6 +344,9 @@ void Plane::update_loiter(uint16_t radius)
}
}
// the radius actually being used by the controller is required by other functions
loiter.radius = (float)radius;
update_loiter_update_nav(radius);
if (loiter.start_time_ms == 0) {

View File

@ -1546,7 +1546,8 @@ void SLT_Transition::update()
quadplane.assisted_flight = true;
// update transition state for vehicles using airspeed wait
if (!in_forced_transition) {
if (transition_state != TRANSITION_AIRSPEED_WAIT) {
const bool show_message = transition_state != TRANSITION_AIRSPEED_WAIT || transition_start_ms == 0;
if (show_message) {
gcs().send_text(MAV_SEVERITY_INFO, "Transition started airspeed %.1f", (double)aspeed);
}
transition_state = TRANSITION_AIRSPEED_WAIT;
@ -2406,7 +2407,7 @@ void QuadPlane::vtol_position_controller(void)
const float aspeed_threshold = MAX(plane.aparm.airspeed_min-2, assist_speed);
// run fixed wing navigation
plane.nav_controller->update_waypoint(plane.current_loc, loc);
plane.nav_controller->update_waypoint(plane.auto_state.crosstrack ? plane.prev_WP_loc : plane.current_loc, loc);
// use TECS for throttle
SRV_Channels::set_output_scaled(SRV_Channel::k_throttle, plane.TECS_controller.get_throttle_demand());
@ -2473,10 +2474,11 @@ void QuadPlane::vtol_position_controller(void)
const uint32_t min_airbrake_ms = 1000;
if (poscontrol.get_state() == QPOS_AIRBRAKE &&
poscontrol.time_since_state_start_ms() > min_airbrake_ms &&
(aspeed < aspeed_threshold ||
fabsf(degrees(closing_vel.angle(desired_closing_vel))) > 60 ||
closing_speed > MAX(desired_closing_speed*1.2, desired_closing_speed+2) ||
labs(plane.ahrs.roll_sensor - plane.nav_roll_cd) > attitude_error_threshold_cd ||
(aspeed < aspeed_threshold || // too low airspeed
fabsf(degrees(closing_vel.angle(desired_closing_vel))) > 60 || // wrong direction
closing_speed > MAX(desired_closing_speed*1.2, desired_closing_speed+2) || // too fast
closing_speed < desired_closing_speed*0.5 || // too slow ground speed
labs(plane.ahrs.roll_sensor - plane.nav_roll_cd) > attitude_error_threshold_cd || // bad attitude
labs(plane.ahrs.pitch_sensor - plane.nav_pitch_cd) > attitude_error_threshold_cd)) {
gcs().send_text(MAV_SEVERITY_INFO,"VTOL position1 v=%.1f d=%.1f h=%.1f dc=%.1f",
(double)groundspeed,
@ -2488,6 +2490,18 @@ void QuadPlane::vtol_position_controller(void)
// switch to vfwd for throttle control
vel_forward.integrator = SRV_Channels::get_output_scaled(SRV_Channel::k_throttle);
// adjust the initial forward throttle based on our desired and actual closing speed
// this allows for significant initial forward throttle
// when we have a strong headwind, but low throttle in the usual case where
// we want to slow down ready for POSITION2
vel_forward.integrator = linear_interpolate(0, vel_forward.integrator,
closing_speed,
1.2*desired_closing_speed, 0.5*desired_closing_speed);
// limit our initial forward throttle in POSITION1 to be 0.5 of cruise throttle
vel_forward.integrator = constrain_float(vel_forward.integrator, 0, plane.aparm.throttle_cruise*0.5);
vel_forward.last_ms = now_ms;
}
@ -2807,7 +2821,7 @@ void QuadPlane::vtol_position_controller(void)
if (plane.control_mode == &plane.mode_guided || vtol_loiter_auto) {
plane.ahrs.get_location(plane.current_loc);
int32_t target_altitude_cm;
if (!plane.next_WP_loc.get_alt_cm(Location::AltFrame::ABOVE_HOME,target_altitude_cm)) {
if (!plane.next_WP_loc.get_alt_cm(Location::AltFrame::ABOVE_ORIGIN,target_altitude_cm)) {
break;
}
if (poscontrol.slow_descent &&
@ -2815,7 +2829,7 @@ void QuadPlane::vtol_position_controller(void)
// gradually descend as we approach target
plane.auto_state.wp_proportion = plane.current_loc.line_path_proportion(plane.prev_WP_loc, plane.next_WP_loc);
int32_t prev_alt;
if (plane.prev_WP_loc.get_alt_cm(Location::AltFrame::ABOVE_HOME,prev_alt)) {
if (plane.prev_WP_loc.get_alt_cm(Location::AltFrame::ABOVE_ORIGIN,prev_alt)) {
target_altitude_cm = linear_interpolate(prev_alt,
target_altitude_cm,
plane.auto_state.wp_proportion,
@ -2932,6 +2946,10 @@ void QuadPlane::setup_target_position(void)
*/
void QuadPlane::takeoff_controller(void)
{
// reset fixed wing controller to neutral as base output
plane.nav_roll_cd = 0;
plane.nav_pitch_cd = 0;
if (!plane.arming.is_armed_and_safety_off()) {
return;
}
@ -2949,7 +2967,7 @@ void QuadPlane::takeoff_controller(void)
// don't takeoff up until rudder is re-centered after rudder arming
if (plane.arming.last_arm_method() == AP_Arming::Method::RUDDER &&
(takeoff_last_run_ms == 0 ||
now - takeoff_last_run_ms < 1000) &&
now - takeoff_last_run_ms > 1000) &&
!plane.seen_neutral_rudder &&
spool_state <= AP_Motors::DesiredSpoolState::GROUND_IDLE) {
// start motor spinning if not spinning already so user sees it is armed
@ -2993,8 +3011,6 @@ void QuadPlane::takeoff_controller(void)
takeoff_last_run_ms = now;
if (no_navigation) {
plane.nav_roll_cd = 0;
plane.nav_pitch_cd = 0;
pos_control->relax_velocity_controller_xy();
} else {
pos_control->set_accel_desired_xy_cmss(zero);
@ -3227,7 +3243,8 @@ bool QuadPlane::do_vtol_land(const AP_Mission::Mission_Command& cmd)
plane.crash_state.is_crashed = false;
// also update nav_controller for status output
plane.nav_controller->update_waypoint(plane.current_loc, plane.next_WP_loc);
plane.nav_controller->update_waypoint(plane.auto_state.crosstrack ? plane.prev_WP_loc : plane.current_loc,
plane.next_WP_loc);
poscontrol_init_approach();
return true;
@ -4098,6 +4115,10 @@ Vector2f QuadPlane::landing_desired_closing_velocity()
float tecs_land_airspeed = plane.TECS_controller.get_land_airspeed();
if (is_positive(tecs_land_airspeed)) {
land_speed = tecs_land_airspeed;
} else {
// use half way between min airspeed and cruise if
// TECS_LAND_AIRSPEED not set
land_speed = 0.5*(land_speed+plane.aparm.airspeed_min);
}
target_speed = MIN(target_speed, eas2tas * land_speed);
@ -4139,12 +4160,16 @@ float QuadPlane::get_land_airspeed(void)
return approach_speed;
}
if (qstate == QPOS_AIRBRAKE) {
// during airbraking ask TECS to slow us to stall speed
return plane.aparm.airspeed_min;
}
// calculate speed based on landing desired velocity
Vector2f vel = landing_desired_closing_velocity();
const Vector3f wind = plane.ahrs.wind_estimate();
const Vector2f wind = plane.ahrs.wind_estimate().xy();
const float eas2tas = plane.ahrs.get_EAS2TAS();
vel.x -= wind.x;
vel.y -= wind.y;
vel -= wind;
vel /= eas2tas;
return vel.length();
}
@ -4529,4 +4554,20 @@ bool QuadPlane::abort_landing(void)
return true;
}
/*
return true if we should disable TECS in the current flight state
this ensures that TECS resets when we change height in a VTOL mode
*/
bool QuadPlane::should_disable_TECS() const
{
if (in_vtol_land_descent()) {
return true;
}
if (plane.control_mode == &plane.mode_guided &&
plane.auto_state.vtol_loiter) {
return true;
}
return false;
}
#endif // HAL_QUADPLANE_ENABLED

View File

@ -180,6 +180,12 @@ public:
*/
bool in_vtol_land_descent(void) const;
/*
should we disable the TECS controller?
only called when in an auto-throttle mode
*/
bool should_disable_TECS() const;
private:
AP_AHRS &ahrs;

View File

@ -6,14 +6,14 @@
#include "ap_version.h"
#define THISFIRMWARE "ArduPlane V4.4.0-dev"
#define THISFIRMWARE "ArduPlane V4.4.4"
// the following line is parsed by the autotest scripts
#define FIRMWARE_VERSION 4,4,0,FIRMWARE_VERSION_TYPE_DEV
#define FIRMWARE_VERSION 4,4,4,FIRMWARE_VERSION_TYPE_OFFICIAL
#define FW_MAJOR 4
#define FW_MINOR 4
#define FW_PATCH 0
#define FW_TYPE FIRMWARE_VERSION_TYPE_DEV
#define FW_PATCH 4
#define FW_TYPE FIRMWARE_VERSION_TYPE_OFFICIAL
#include <AP_Common/AP_FWVersionDefine.h>

View File

@ -8,6 +8,7 @@ public:
using GCS_MAVLINK::GCS_MAVLINK;
uint8_t sysid_my_gcs() const override;
protected:
uint32_t telem_delay() const override {
@ -16,8 +17,6 @@ protected:
MAV_RESULT handle_flight_termination(const mavlink_command_long_t &packet) override;
uint8_t sysid_my_gcs() const override;
MAV_RESULT handle_command_do_set_roi(const Location &roi_loc) override;
MAV_RESULT _handle_command_preflight_calibration_baro(const mavlink_message_t &msg) override;
MAV_RESULT _handle_command_preflight_calibration(const mavlink_command_long_t &packet, const mavlink_message_t &msg) override;

View File

@ -25,10 +25,10 @@ public:
bool vehicle_initialised() const override;
protected:
uint8_t sysid_this_mav() const override;
protected:
// minimum amount of time (in microseconds) that must remain in
// the main scheduler loop before we are allowed to send any
// mavlink messages. We want to prioritise the main flight

View File

@ -27,7 +27,7 @@ const AP_Param::Info Rover::var_info[] = {
// @Param: INITIAL_MODE
// @DisplayName: Initial driving mode
// @Description: This selects the mode to start in on boot. This is useful for when you want to start in AUTO mode on boot without a receiver. Usually used in combination with when AUTO_TRIGGER_PIN or AUTO_KICKSTART.
// @Values: 0:Manual,1:Acro,3:Steering,4:Hold,5:Loiter,6:Follow,7:Simple,10:Auto,11:RTL,12:SmartRTL,15:Guided
// @CopyValuesFrom: MODE1
// @User: Advanced
GSCALAR(initial_mode, "INITIAL_MODE", Mode::Number::MANUAL),
@ -171,7 +171,7 @@ const AP_Param::Info Rover::var_info[] = {
// @Param: MODE1
// @DisplayName: Mode1
// @Values: 0:Manual,1:Acro,3:Steering,4:Hold,5:Loiter,6:Follow,7:Simple,10:Auto,11:RTL,12:SmartRTL,15:Guided
// @Values: 0:Manual,1:Acro,3:Steering,4:Hold,5:Loiter,6:Follow,7:Simple,8:Dock,9:Circle,10:Auto,11:RTL,12:SmartRTL,15:Guided
// @User: Standard
// @Description: Driving mode for switch position 1 (910 to 1230 and above 2049)
GSCALAR(mode1, "MODE1", Mode::Number::MANUAL),
@ -692,6 +692,10 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
// @User: Standard
AP_GROUPINFO("FS_GCS_TIMEOUT", 56, ParametersG2, fs_gcs_timeout, 5),
// @Group: CIRC
// @Path: mode_circle.cpp
AP_SUBGROUPINFO(mode_circle, "CIRC", 57, ParametersG2, ModeCircle),
AP_GROUPEND
};

View File

@ -436,6 +436,8 @@ public:
// FS GCS timeout trigger time
AP_Float fs_gcs_timeout;
class ModeCircle mode_circle;
};
extern const AP_Param::Info var_info[];

View File

@ -204,6 +204,14 @@ bool Rover::set_steering_and_throttle(float steering, float throttle)
return true;
}
// get steering and throttle (-1 to +1) (for use by scripting)
bool Rover::get_steering_and_throttle(float& steering, float& throttle)
{
steering = g2.motors.get_steering() / 4500.0;
throttle = g2.motors.get_throttle() * 0.01;
return true;
}
// set desired turn rate (degrees/sec) and speed (m/s). Used for scripting
bool Rover::set_desired_turn_rate_and_speed(float turn_rate, float speed)
{

View File

@ -82,6 +82,7 @@ public:
friend class Mode;
friend class ModeAcro;
friend class ModeAuto;
friend class ModeCircle;
friend class ModeGuided;
friend class ModeHold;
friend class ModeLoiter;
@ -256,6 +257,7 @@ private:
bool set_target_location(const Location& target_loc) override;
bool set_target_velocity_NED(const Vector3f& vel_ned) override;
bool set_steering_and_throttle(float steering, float throttle) override;
bool get_steering_and_throttle(float& steering, float& throttle) override;
// set desired turn rate (degrees/sec) and speed (m/s). Used for scripting
bool set_desired_turn_rate_and_speed(float turn_rate, float speed) override;
bool set_desired_speed(float speed) override;

View File

@ -537,6 +537,9 @@ Mode *Rover::mode_from_mode_num(const enum Mode::Number num)
case Mode::Number::SIMPLE:
ret = &mode_simple;
break;
case Mode::Number::CIRCLE:
ret = &g2.mode_circle;
break;
case Mode::Number::AUTO:
ret = &mode_auto;
break;

View File

@ -22,6 +22,7 @@ public:
#if MODE_DOCK_ENABLED == ENABLED
DOCK = 8,
#endif
CIRCLE = 9,
AUTO = 10,
RTL = 11,
SMART_RTL = 12,
@ -252,6 +253,12 @@ public:
// return if external control is allowed in this mode (Guided or Guided-within-Auto)
bool in_guided_mode() const override { return _submode == Auto_Guided || _submode == Auto_NavScriptTime; }
// return heading (in degrees) and cross track error (in meters) for reporting to ground station (NAV_CONTROLLER_OUTPUT message)
float wp_bearing() const override;
float nav_bearing() const override;
float crosstrack_error() const override;
float get_desired_lat_accel() const override;
// return distance (in meters) to destination
float get_distance_to_destination() const override;
@ -295,6 +302,7 @@ protected:
Auto_Guided, // handover control to external navigation system from within auto mode
Auto_Stop, // stop the vehicle as quickly as possible
Auto_NavScriptTime, // accept targets from lua scripts while NAV_SCRIPT_TIME commands are executing
Auto_Circle, // circle a given location
} _submode;
private:
@ -322,6 +330,8 @@ private:
bool verify_loiter_time(const AP_Mission::Mission_Command& cmd);
bool verify_nav_guided_enable(const AP_Mission::Mission_Command& cmd);
bool verify_nav_set_yaw_speed();
bool do_circle(const AP_Mission::Mission_Command& cmd);
bool verify_circle(const AP_Mission::Mission_Command& cmd);
void do_wait_delay(const AP_Mission::Mission_Command& cmd);
void do_within_distance(const AP_Mission::Mission_Command& cmd);
bool verify_wait_delay();
@ -385,6 +395,95 @@ private:
AP_Mission_ChangeDetector mis_change_detector;
};
class ModeCircle : public Mode
{
public:
// need a constructor for parameters
ModeCircle();
// Does not allow copies
CLASS_NO_COPY(ModeCircle);
uint32_t mode_number() const override { return CIRCLE; }
const char *name4() const override { return "CIRC"; }
// initialise with specific center location, radius (in meters) and direction
// replaces use of _enter when initialised from within Auto mode
bool set_center(const Location& center_loc, float radius_m, bool dir_ccw);
// methods that affect movement of the vehicle in this mode
void update() override;
bool is_autopilot_mode() const override { return true; }
// return desired heading (in degrees) and cross track error (in meters) for reporting to ground station (NAV_CONTROLLER_OUTPUT message)
float wp_bearing() const override;
float nav_bearing() const override;
float crosstrack_error() const override { return dist_to_edge_m; }
float get_desired_lat_accel() const override;
// set desired speed in m/s
bool set_desired_speed(float speed_ms) override;
// return distance (in meters) to destination
float get_distance_to_destination() const override { return _distance_to_destination; }
// get or set desired location
bool get_desired_location(Location& destination) const override WARN_IF_UNUSED;
// return total angle in radians that vehicle has circled
// fabsf is used so that full rotations in either direction are counted
float get_angle_total_rad() const { return fabsf(angle_total_rad); }
static const struct AP_Param::GroupInfo var_info[];
protected:
AP_Float radius; // circle radius in meters
AP_Float speed; // vehicle speed in m/s. If zero uses WP_SPEED
AP_Int8 direction; // direction 0:clockwise, 1:counter-clockwise
// initialise mode
bool _enter() override;
// initialise target_yaw_rad using the vehicle's position and yaw
// if there is no current position estimate target_yaw_rad is set to vehicle yaw
void init_target_yaw_rad();
// limit config speed so that lateral acceleration is within limits
// outputs warning to user if speed is reduced
void check_config_speed();
// ensure config radius is no smaller then vehicle's TURN_RADIUS
// radius is increased if necessary and warning is output to the user
void check_config_radius();
// enum for Direction parameter
enum class Direction {
CW = 0,
CCW = 1
};
// local members
struct {
Location center_loc; // circle center as a Location
Vector2f center_pos; // circle center as an offset (in meters) from the EKF origin
float radius; // circle radius
float speed; // desired speed around circle in m/s
Direction dir; // direction, 0:clockwise, 1:counter-clockwise
} config;
struct {
float speed; // vehicle's target speed around circle in m/s
float yaw_rad; // earth-frame angle of tarrget point on the circle
Vector2p pos; // latest position target sent to position controller
Vector2f vel; // latest velocity target sent to position controller
Vector2f accel; // latest accel target sent to position controller
} target;
float angle_total_rad; // total angle in radians that vehicle has circled
bool reached_edge; // true once vehicle has reached edge of circle
float dist_to_edge_m; // distance to edge of circle in meters (equivalent to crosstrack error)
};
class ModeGuided : public Mode
{

View File

@ -76,21 +76,15 @@ void ModeAuto::update()
switch (_submode) {
case Auto_WP:
{
// check if we've reached the destination
if (!g2.wp_nav.reached_destination() || g2.wp_nav.is_fast_waypoint()) {
// update navigation controller
// boats loiter once the waypoint is reached
bool keep_navigating = true;
if (rover.is_boat() && g2.wp_nav.reached_destination() && !g2.wp_nav.is_fast_waypoint()) {
keep_navigating = !start_loiter();
}
// update navigation controller
if (keep_navigating) {
navigate_to_waypoint();
} else {
// we have reached the destination so stay here
if (rover.is_boat()) {
if (!start_loiter()) {
start_stop();
}
} else {
start_stop();
}
// update distance to destination
_distance_to_destination = rover.current_loc.get_distance(g2.wp_nav.get_destination());
}
break;
}
@ -139,6 +133,10 @@ void ModeAuto::update()
case Auto_NavScriptTime:
rover.mode_guided.update();
break;
case Auto_Circle:
rover.g2.mode_circle.update();
break;
}
}
@ -152,6 +150,102 @@ void ModeAuto::calc_throttle(float target_speed, bool avoidance_enabled)
Mode::calc_throttle(target_speed, avoidance_enabled);
}
// return heading (in degrees) to target destination (aka waypoint)
float ModeAuto::wp_bearing() const
{
switch (_submode) {
case Auto_WP:
return g2.wp_nav.wp_bearing_cd() * 0.01f;
case Auto_HeadingAndSpeed:
case Auto_Stop:
return 0.0f;
case Auto_RTL:
return rover.mode_rtl.wp_bearing();
case Auto_Loiter:
return rover.mode_loiter.wp_bearing();
case Auto_Guided:
case Auto_NavScriptTime:
return rover.mode_guided.wp_bearing();
case Auto_Circle:
return rover.g2.mode_circle.wp_bearing();
}
// this line should never be reached
return 0.0f;
}
// return short-term target heading in degrees (i.e. target heading back to line between waypoints)
float ModeAuto::nav_bearing() const
{
switch (_submode) {
case Auto_WP:
return g2.wp_nav.nav_bearing_cd() * 0.01f;
case Auto_HeadingAndSpeed:
case Auto_Stop:
return 0.0f;
case Auto_RTL:
return rover.mode_rtl.nav_bearing();
case Auto_Loiter:
return rover.mode_loiter.nav_bearing();
case Auto_Guided:
case Auto_NavScriptTime:
return rover.mode_guided.nav_bearing();
case Auto_Circle:
return rover.g2.mode_circle.nav_bearing();
}
// this line should never be reached
return 0.0f;
}
// return cross track error (i.e. vehicle's distance from the line between waypoints)
float ModeAuto::crosstrack_error() const
{
switch (_submode) {
case Auto_WP:
return g2.wp_nav.crosstrack_error();
case Auto_HeadingAndSpeed:
case Auto_Stop:
return 0.0f;
case Auto_RTL:
return rover.mode_rtl.crosstrack_error();
case Auto_Loiter:
return rover.mode_loiter.crosstrack_error();
case Auto_Guided:
case Auto_NavScriptTime:
return rover.mode_guided.crosstrack_error();
case Auto_Circle:
return rover.g2.mode_circle.crosstrack_error();
}
// this line should never be reached
return 0.0f;
}
// return desired lateral acceleration
float ModeAuto::get_desired_lat_accel() const
{
switch (_submode) {
case Auto_WP:
return g2.wp_nav.get_lat_accel();
case Auto_HeadingAndSpeed:
case Auto_Stop:
return 0.0f;
case Auto_RTL:
return rover.mode_rtl.get_desired_lat_accel();
case Auto_Loiter:
return rover.mode_loiter.get_desired_lat_accel();
case Auto_Guided:
case Auto_NavScriptTime:
return rover.mode_guided.get_desired_lat_accel();
case Auto_Circle:
return rover.g2.mode_circle.get_desired_lat_accel();
}
// this line should never be reached
return 0.0f;
}
// return distance (in meters) to destination
float ModeAuto::get_distance_to_destination() const
{
@ -169,6 +263,8 @@ float ModeAuto::get_distance_to_destination() const
case Auto_Guided:
case Auto_NavScriptTime:
return rover.mode_guided.get_distance_to_destination();
case Auto_Circle:
return rover.g2.mode_circle.get_distance_to_destination();
}
// this line should never be reached
@ -195,7 +291,9 @@ bool ModeAuto::get_desired_location(Location& destination) const
return rover.mode_loiter.get_desired_location(destination);
case Auto_Guided:
case Auto_NavScriptTime:
return rover.mode_guided.get_desired_location(destination);\
return rover.mode_guided.get_desired_location(destination);
case Auto_Circle:
return rover.g2.mode_circle.get_desired_location(destination);
}
// we should never reach here but just in case
@ -236,7 +334,8 @@ bool ModeAuto::reached_destination() const
case Auto_Guided:
case Auto_NavScriptTime:
return rover.mode_guided.reached_destination();
break;
case Auto_Circle:
return rover.g2.mode_circle.reached_destination();
}
// we should never reach here but just in case, return true to allow missions to continue
@ -260,6 +359,8 @@ bool ModeAuto::set_desired_speed(float speed)
case Auto_Guided:
case Auto_NavScriptTime:
return rover.mode_guided.set_desired_speed(speed);
case Auto_Circle:
return rover.g2.mode_circle.set_desired_speed(speed);
}
return false;
}
@ -422,6 +523,9 @@ bool ModeAuto::start_command(const AP_Mission::Mission_Command& cmd)
case MAV_CMD_NAV_LOITER_TIME: // Loiter for specified time
return do_nav_wp(cmd, true);
case MAV_CMD_NAV_LOITER_TURNS:
return do_circle(cmd);
case MAV_CMD_NAV_GUIDED_ENABLE: // accept navigation commands from external nav computer
do_nav_guided_enable(cmd);
break;
@ -564,6 +668,9 @@ bool ModeAuto::verify_command(const AP_Mission::Mission_Command& cmd)
case MAV_CMD_NAV_LOITER_UNLIM:
return verify_loiter_unlimited(cmd);
case MAV_CMD_NAV_LOITER_TURNS:
return verify_circle(cmd);
case MAV_CMD_NAV_LOITER_TIME:
return verify_loiter_time(cmd);
@ -802,6 +909,34 @@ bool ModeAuto::verify_nav_set_yaw_speed()
return true;
}
bool ModeAuto::do_circle(const AP_Mission::Mission_Command& cmd)
{
// retrieve and sanitize target location
Location circle_center = cmd.content.location;
circle_center.sanitize(rover.current_loc);
// calculate radius
uint16_t circle_radius_m = HIGHBYTE(cmd.p1); // circle radius held in high byte of p1
if (cmd.id == MAV_CMD_NAV_LOITER_TURNS &&
cmd.type_specific_bits & (1U << 0)) {
// special storage handling allows for larger radii
circle_radius_m *= 10;
}
// initialise circle mode
if (g2.mode_circle.set_center(circle_center, circle_radius_m, cmd.content.location.loiter_ccw)) {
_submode = Auto_Circle;
return true;
}
return false;
}
bool ModeAuto::verify_circle(const AP_Mission::Mission_Command& cmd)
{
// check if we have completed circling
return ((g2.mode_circle.get_angle_total_rad() / M_2PI) >= LOWBYTE(cmd.p1));
}
/********************************************************************************/
// Condition (May) commands
/********************************************************************************/

273
Rover/mode_circle.cpp Normal file
View File

@ -0,0 +1,273 @@
#include "Rover.h"
#define AR_CIRCLE_ACCEL_DEFAULT 1.0 // default acceleration in m/s/s if not specified by user
#define AR_CIRCLE_RADIUS_MIN 0.5 // minimum radius in meters
#define AR_CIRCLE_REACHED_EDGE_DIST 0.2 // vehicle has reached edge if within 0.2m
const AP_Param::GroupInfo ModeCircle::var_info[] = {
// @Param: _RADIUS
// @DisplayName: Circle Radius
// @Description: Vehicle will circle the center at this distance
// @Units: m
// @Range: 0 100
// @Increment: 1
// @User: Standard
AP_GROUPINFO("_RADIUS", 1, ModeCircle, radius, 20),
// @Param: _SPEED
// @DisplayName: Circle Speed
// @Description: Vehicle will move at this speed around the circle. If set to zero WP_SPEED will be used
// @Units: m/s
// @Range: 0 10
// @Increment: 0.1
// @User: Standard
AP_GROUPINFO("_SPEED", 2, ModeCircle, speed, 0),
// @Param: _DIR
// @DisplayName: Circle Direction
// @Description: Circle Direction
// @Values: 0:Clockwise, 1:Counter-Clockwise
// @User: Standard
AP_GROUPINFO("_DIR", 3, ModeCircle, direction, 0),
AP_GROUPEND
};
ModeCircle::ModeCircle() : Mode()
{
AP_Param::setup_object_defaults(this, var_info);
}
// initialise with specific center location, radius (in meters) and direction
// replaces use of _enter when initialised from within Auto mode
bool ModeCircle::set_center(const Location& center_loc, float radius_m, bool dir_ccw)
{
Vector2f center_pos_cm;
if (!center_loc.get_vector_xy_from_origin_NE(center_pos_cm)) {
return false;
}
if (!_enter()) {
return false;
}
// convert center position from cm to m
config.center_pos = center_pos_cm * 0.01;
// set radius
config.radius = MAX(fabsf(radius_m), AR_CIRCLE_RADIUS_MIN);
check_config_radius();
// set direction
config.dir = dir_ccw ? Direction::CCW : Direction::CW;
// set target yaw rad (target point on circle)
init_target_yaw_rad();
// record center as location (only used for reporting)
config.center_loc = center_loc;
return true;
}
// initialize dock mode
bool ModeCircle::_enter()
{
// capture starting point and yaw
if (!AP::ahrs().get_relative_position_NE_origin(config.center_pos)) {
return false;
}
config.radius = MAX(fabsf(radius), AR_CIRCLE_RADIUS_MIN);
check_config_radius();
config.dir = (direction == 1) ? Direction::CCW : Direction::CW;
config.speed = is_positive(speed) ? speed : g2.wp_nav.get_default_speed();
target.yaw_rad = AP::ahrs().get_yaw();
target.speed = 0;
// check speed around circle does not lead to excessive lateral acceleration
check_config_speed();
// calculate speed, accel and jerk limits
// otherwise the vehicle uses wp_nav default speed limit
float atc_accel_max = MIN(g2.attitude_control.get_accel_max(), g2.attitude_control.get_decel_max());
if (!is_positive(atc_accel_max)) {
atc_accel_max = AR_CIRCLE_ACCEL_DEFAULT;
}
const float accel_max = is_positive(g2.wp_nav.get_default_accel()) ? MIN(g2.wp_nav.get_default_accel(), atc_accel_max) : atc_accel_max;
const float jerk_max = is_positive(g2.wp_nav.get_default_jerk()) ? g2.wp_nav.get_default_jerk() : accel_max;
// initialise position controller
g2.pos_control.set_limits(config.speed, accel_max, g2.attitude_control.get_turn_lat_accel_max(), jerk_max);
g2.pos_control.init();
// initialise angles covered and reached_edge state
angle_total_rad = 0;
reached_edge = false;
dist_to_edge_m = 0;
return true;
}
// initialise target_yaw_rad using the vehicle's position and yaw
// if there is no current position estimate target_yaw_rad is set to 0
void ModeCircle::init_target_yaw_rad()
{
// if no position estimate use vehicle yaw
Vector2f curr_pos_NE;
if (!AP::ahrs().get_relative_position_NE_origin(curr_pos_NE)) {
target.yaw_rad = AP::ahrs().yaw;
return;
}
// calc vector from circle center to vehicle
Vector2f center_to_veh = (curr_pos_NE - config.center_pos);
float dist_m = center_to_veh.length();
// if current position is exactly at the center of the circle return vehicle yaw
if (is_zero(dist_m)) {
target.yaw_rad = AP::ahrs().yaw;
} else {
target.yaw_rad = center_to_veh.angle();
}
}
void ModeCircle::update()
{
// get current position
Vector2f curr_pos;
const bool position_ok = AP::ahrs().get_relative_position_NE_origin(curr_pos);
// if no position estimate stop vehicle
if (!position_ok) {
stop_vehicle();
return;
}
// check if vehicle has reached edge of circle
const Vector2f center_to_veh = curr_pos - config.center_pos;
_distance_to_destination = center_to_veh.length();
dist_to_edge_m = fabsf(_distance_to_destination - config.radius);
if (!reached_edge) {
const float dist_thresh_m = MAX(rover.g2.turn_radius, AR_CIRCLE_REACHED_EDGE_DIST);
reached_edge = dist_to_edge_m <= dist_thresh_m;
}
// accelerate speed up to desired speed
const float speed_max = reached_edge ? config.speed : 0.0;
const float speed_change_max = (g2.pos_control.get_accel_max() * 0.5 * rover.G_Dt);
const float accel_fb = constrain_float(speed_max - target.speed, -speed_change_max, speed_change_max);
target.speed += accel_fb;
// calculate angular rate and update target angle
const float circumference = 2.0 * M_PI * config.radius;
const float angular_rate_rad = (target.speed / circumference) * M_2PI * (config.dir == Direction::CW ? 1.0 : -1.0);
const float angle_dt = angular_rate_rad * rover.G_Dt;
target.yaw_rad = wrap_PI(target.yaw_rad + angle_dt);
angle_total_rad += angle_dt;
// calculate target point's position, velocity and acceleration
target.pos = config.center_pos.topostype();
target.pos.offset_bearing(degrees(target.yaw_rad), config.radius);
// velocity is perpendicular to angle from the circle's center to the target point on the edge of the circle
target.vel = Vector2f(target.speed, 0);
target.vel.rotate(target.yaw_rad + radians(90));
// acceleration is towards center of circle and is speed^2 / radius
target.accel = Vector2f(-sq(target.speed) / config.radius, accel_fb / rover.G_Dt);
target.accel.rotate(target.yaw_rad);
g2.pos_control.set_pos_vel_accel_target(target.pos, target.vel, target.accel);
g2.pos_control.update(rover.G_Dt);
// get desired speed and turn rate from pos_control
const float desired_speed = g2.pos_control.get_desired_speed();
const float desired_turn_rate = g2.pos_control.get_desired_turn_rate_rads();
// run steering and throttle controllers
calc_steering_from_turn_rate(desired_turn_rate);
calc_throttle(desired_speed, true);
}
// return desired heading (in degrees) and cross track error (in meters) for reporting to ground station (NAV_CONTROLLER_OUTPUT message)
float ModeCircle::wp_bearing() const
{
Vector2f curr_pos_NE;
if (!AP::ahrs().get_relative_position_NE_origin(curr_pos_NE)) {
return 0;
}
// calc vector from circle center to vehicle
Vector2f veh_to_center = (config.center_pos - curr_pos_NE);
if (veh_to_center.is_zero()) {
return 0;
}
return degrees(veh_to_center.angle());
}
float ModeCircle::nav_bearing() const
{
// get position error as a vector from the current position to the target position
const Vector2p pos_error = g2.pos_control.get_pos_error();
if (pos_error.is_zero()) {
return 0;
}
return degrees(pos_error.angle());
}
float ModeCircle::get_desired_lat_accel() const
{
return g2.pos_control.get_desired_lat_accel();
}
// set desired speed in m/s
bool ModeCircle::set_desired_speed(float speed_ms)
{
if (is_positive(speed_ms)) {
config.speed = speed_ms;
// check desired speed does not lead to excessive lateral acceleration
check_config_speed();
// update position controller limits if required
if (config.speed > g2.pos_control.get_speed_max()) {
g2.pos_control.set_limits(config.speed, g2.pos_control.get_accel_max(), g2.pos_control.get_lat_accel_max(), g2.pos_control.get_jerk_max());
}
return true;
}
return false;
}
// return desired location
bool ModeCircle::get_desired_location(Location& destination) const
{
destination = config.center_loc;
return true;
}
// limit config speed so that lateral acceleration is within limits
// assumes that config.radius and attitude controller lat accel max have been set
// outputs warning to user if speed is reduced
void ModeCircle::check_config_speed()
{
// calculate maximum speed based on radius and max lateral acceleration max
const float speed_max = MAX(safe_sqrt(g2.attitude_control.get_turn_lat_accel_max() * config.radius), 0);
if (config.speed > speed_max) {
config.speed = speed_max;
gcs().send_text(MAV_SEVERITY_WARNING, "Circle: max speed is %4.1f", (double)config.speed);
}
}
// ensure config radius is no smaller then vehicle's TURN_RADIUS
// assumes that config.radius has been set
// radius is increased if necessary and warning is output to the user
void ModeCircle::check_config_radius()
{
// ensure radius is at least as large as vehicle's turn radius
if (config.radius < rover.g2.turn_radius) {
config.radius = rover.g2.turn_radius;
gcs().send_text(MAV_SEVERITY_WARNING, "Circle: radius increased to TURN_RADIUS (%4.1f)", (double)rover.g2.turn_radius);
}
}

View File

@ -1,5 +1,352 @@
Rover Release Notes:
------------------------------------------------------------------
Rover 4.4.0 19-Dec-2023 / Rover 4.4.0-beta11 05-Dec-2023
Changes from 4.4.0-beta10
1) Autopilot related enhancement and fixes
- CubeOrange Sim-on-hardware compilation fix
- RADIX2HD supports external I2C compasses
- SpeedyBeeF405v4 support
2) Bug fixes
- DroneCAN battery monitor with cell monitor SoC reporting fix
- NTF_LED_TYPES parameter description fixed (was missing IS31FL3195)
- ProfiLED output fixed in both Notify and Scripting
- Scripting bug that could cause crash if parameters were added in flight
- STAT_BOOTCNT param fix (was not updating in some cases)
- don't query hobbywing DroneCAN ESC IDs while armed
3) Rover specific changes
- Auto mode keeps navigating while paused at waypoints (reduces overshoot)
- QuikTune script simplification (only tunes rate and speed controllers)
- Torqeedo battery nearly empty reporting fix
------------------------------------------------------------------
Rover 4.4.0-beta10 14-Nov-2023
Changes from 4.4.0-beta9
1) AP_GPS: correct uBlox M10 configuration on low flash boards
------------------------------------------------------------------
Rover 4.4.0-beta9 07-Nov-2023
Changes from 4.4.0-beta8
1) Autopilot related enhancements and fixes
- BETAFTP-F405 board configuration fixes
- CubeOrangePlus-BG edition ICM45486 IMU setup fixed
- YJUAV_A6SE_H743 support
2) Minor enhancements
- GPS_DRV_OPTION allows using ellipsoid height in more GPS drivers
- Lua script support for fully populating ESC telemetry data
3) Bug fixes
- AK09916 compass being non-responsive fixed
- IxM42xxx IMUs "stuck" gyros fixed
- Notch filtering protection when using uninitialised RPM source in ESC telemetry
- SIYI gimbal driver parsing bug fixed (was causing lost packets)
------------------------------------------------------------------
Rover 4.4.0-beta8 13-Oct-2023
Changes from 4.4.0-beta7
1) Autopilot related enhancements and fixes
- BETAFPV-F405 support
- MambaF405v2 battery and serial setup corrected
- mRo Control Zero OEM H7 bdshot support
- SpeedyBee-F405-Wing gets VTX power control
- SpeedyBee-F405-Mini support
- T-Motor H743 Mini support
2) EKF3 supports baroless boards
3) GPS-for-yaw allows base GPS to update at only 3Hz
4) INA battery monitor supports config of shunt resistor used (see BATTx_SHUNT)
5) Log VER message includes vehicle type
6) OpenDroneId option to auto-store IDs in persistent flash
7) RC SBUS protection against invalid data in first 4 channels
8) Bug fixes
- BMI088 IMU error value handling fixed to avoid occasional negative spike
- Dev environment CI autotest stability improvements
- OSD correct DisplayPort BF MSP symbols
- OSD option to correct direction arrows for BF font set
- Sensor status reporting to GCS fixed for baroless boards
------------------------------------------------------------------
Rover 4.4.0-beta7 14-Sep-2023
Changes from 4.4.0-beta6
1) Autopilot related enhancements
- H750 external flash optimisations for to lower CPU load
- MambaF405Mini fixes to match manufacturer's recommended wiring
- RADIX2 HD support
- YJUAV_A6SE support
2) Bug fixes
- Airbotf4 features minimised to build for 4.4
- ChibiOS clock fix for 480Mhz H7 boards (affected FDCAN)
- RPI hardware version check fix
------------------------------------------------------------------
Rover 4.4.0-beta6 05-Sep-2023
Changes from 4.4.0-beta5
1) Autopilot related fixes and enhancements
- KakuteH7-wing get 8 bit directional dshot channel support
- Luminousbee5 boards defaults updated
- Navigator autopilot GPIOs fix (PWM output was broken)
- Pixhawk6C Serial RTS lines pulled low on startup
- QiotekZealotF427 and QiotekZealotH743 battery monitor default fixed
- SDMODELH7V1 supporta
2) Driver enhancements
- DroneCAN battery monitors allow reset of battery SoC
- Himark DroneCAN servo support
- Hobbywing DroneCAN ESC support
3) Asymmetrical thrust support for skid steering rovers (see MOT_THST_ASYM)
4) EKF3 high vibration handling improved with EK3_GLITCH_RADIUS option
5) Custom build server gets mission storage on SDCard selection
6) SITL default parameter handling bug fix
------------------------------------------------------------------
Rover 4.4.0-beta5 12-Aug-2023
Changes from 4.4.0-beta4
1) Autopilots specific changes
- SIYI N7 support
2) Bug fixes
- DroneCAN airspeed sensor fix to handle missing packets
- DroneCAN GPS RTK injection fix
- Notch filter gyro glitch caused by race condition fixed
------------------------------------------------------------------
Rover 4.4.0-beta4 27-July-2023
Changes from 4.4.0-beta3
1) Autopilots specific changes
- Diatone-Mamba-MK4-H743v2 uses SPL06 baro (was DPS280)
- DMA for I2C disabled on F7 and H7 boards
- Foxeer H743v1 default serial protocol config fixes
- HeeWing-F405 and F405v2 support
- iFlight BlitzF7 support
2) Rover specific enhancements
- QuikTune Lua script
- Circle mode safety improvements including handling when CIRC_SPEED set too high
- Velocity controller I-term build-up avoided when steering reaches limits
3) Bug fixes
- BLHeli returns battery status requested via MSP (avoids hang when using esc-configurator)
- CRSFv3 rescans at baudrates to avoid RX loss
- EK3_ABIAS_P_NSE param range fix
- Scripting restart memory corruption bug fixed
- Siyi A8/ZR10 driver fix to avoid crash if serial port not configured
------------------------------------------------------------------
Rover 4.4.0-beta3 03-July-2023
Changes from 4.4.0-beta2
1) Autopilots specific changes
- Holybro KakuteH7-Wing support
- JFB100 external watchdog GPIO support added
- Pixhawk1-bdshot support
- Pixhawk6X-bdshot support
- SpeedyBeeF4 loses bdshot support
2) Device drivers
- added LP5562 I2C LED driver
- added IS31FL3195 LED driver
3) Circle mode accuracy improvement
4) Camera and Gimbal related changes
- DO_SET_ROI_NONE command support added
5) Bug fixes
- ADSB sensor loss of transceiver message less spammy
- EKF vertical velocity reset fixed on loss of GPS
- GPS pre-arm failure message clarified
- SERVOx_PROTOCOL "SToRM32 Gimbal Serial" value renamed to "Gimbal" because also used by Siyi
- SERIALx_OPTION "Swap" renamed to "SwapTXRX" for clarity
- SBF GPS ellipsoid height fixed
- Ublox M10S GPS auto configuration fixed
------------------------------------------------------------------
Rover 4.4.0-beta2 05-Jun-2023
Changes from 4.4.0-beta1
1) Autopilots specific changes
- FlywooF745 update to motor pin output mapping and baro
- FoxeerH743 support
- JFB100 support
- Mamba-F405v2 supports ICM42688
- Matek-F405-TE/VTOL support
- Matek-H743 IMU SPI slowed to 1Mhz to avoid init issues
- SpeedyBee-405-Wing support
2) Rover specific changes
- Circle mode and Auto mode LOITER_TURNS support
- Dock mode added to INITIAL_MODE and MODE1 parameter list
3) AHRS/EKF related fixes and Enhancements
- EKF allocation failure handled to avoid watchdog
- EKF3 accel bias calculation fix and tuning for greater robustness
- Airspeed sensor remains enabled during dead-reckoning (few copters have airspeed sensors)
- Wind speed estimates updates reduced while dead-reckoning
4) Other Enhancements
- Attitude control slew limits always calculated (helps tuning reporting and analysis)
- INA228 and INA238 I2C battery monitor support
- LOG_DISARMED=3 logs while disarmed but discards log if never eventually armed
- LOG_DARM_RATEMAX reduces logging while disarmed
- Serial LEDs threading enhancement to support longer lengths without dshot interference
4) Bug fixes
- Analog battery monitor2 current parameter default fixed
- AutoTune fix for loading Yaw Rate D gains
- BRD_SAFETYOPTION parameter documentation fix (ActiveForSafetyEnable and Disable were reversed)
- Compassmot fix to protect against bad gyro biases from GSF yaw
- ICE engine fix for starting after reaching a specified altitude
- LED thread locking fix to avoid watchdog
- Logging rotation on disarm disabled if Replay logging active (avoids gaps in logs)
- RC input on IOMCU bug fix (RC might not be regained if lost)
- Serial passthrough fixed
5) Custom build server fix to which features are included/excluded
------------------------------------------------------------------
Rover 4.4.0-beta1 19-Apr-2023
Changes from 4.3.0-beta12
1) New autopilots supported
- ESP32
- Flywoo Goku F405S AIO
- Foxeer H743v1
- MambaF405-2022B
- PixPilot-V3
- PixSurveyA2
- rFCU H743
- ThePeach K1/R1
2) Autopilot specific changes
- Bi-Directional DShot support for CubeOrangePlus-bdshot, CUAVNora+, MatekF405TE/VTOL-bdshot, MatekL431, Pixhawk6C-bdshot, QioTekZealotH743-bdshot
- Bi-Directional DShot up to 8 channels on MatekH743
- BlueRobotics Navigator supports baro on I2C bus 6
- BMP280 baro only for BeastF7, KakuteF4, KakuteF7Mini, MambaF405, MatekF405, Omnibusf4 to reduce code size (aka "flash")
- CSRF and Hott telemetry disabled by default on some low power boards (aka "minimised boards")
- Foxeer Reaper F745 supports external compasses
- OmnibusF4 support for BMI270 IMU
- OmnibusF7V2-bdshot support removed
- KakuteF7 regains displayport, frees up DMA from unused serial port
- KakuteH7v2 gets second battery sensor
- MambaH743v4 supports VTX
- MatekF405-Wing supports InvensenseV3 IMUs
- PixPilot-V6 heater enabled
- Raspberry 64OS startup crash fixed
- ReaperF745AIO serial protocol defaults fixed
- SkystarsH7HD (non-bdshot) removed as users should always use -bdshot version
- Skyviper loses many unnecessary features to save flash
- UBlox GPS only for AtomRCF405NAVI, BeastF7, MatekF405, Omnibusf4 to reduce code size (aka "flash")
- VRBrain-v52 and VRCore-v10 features reduced to save flash
3) Driver enhancements
- ARK RTK GPS support
- BMI088 IMU filtering and timing improved, ignores bad data
- CRSF OSD may display disarmed state after flight mode (enabled using RC_OPTIONS)
- Daiwa winch baud rate obeys SERIALx_BAUD parameter
- EFI supports fuel pressure and ignition voltage reporting and battery failsafe
- ICM45686 IMU support
- ICM20602 uses fast reset instead of full reset on bad temperature sample (avoids occasional very high offset)
- ICM45686 supports fast sampling
- MAX31865 temp sensor support
- MB85RS256TY-32k, PB85RS128C and PB85RS2MC FRAM support
- MMC3416 compass orientation fix
- MPPT battery monitor reliability improvements, enable/disable aux function and less spammy
- Multiple USD-D1-CAN radar support
- NMEA output rate configurable (see NMEA_RATE_MS)
- NMEA output supports PASHR message (see NMEA_MSG_EN)
- OSD supports average resting cell voltage (see OSD_ACRVOLT_xxx params)
- Rockblock satellite modem support
- Serial baud support for 2Mbps (only some hardware supports this speed)
- SF45b lidar filtering reduced (allows detecting smaller obstacles
- SmartAudio 2.0 learns all VTX power levels)
- UAVCAN ESCs report error count using ESC Telemetry
- Unicore GPS (e.g. UM982) support
- VectorNav 100 external AHRS support
- 5 IMUs supported
4) EKF related enhancements
- Baro compensation using wind estimates works when climbing or descending (see BAROx_WCF_UP/DN)
- External AHRS support for enabling only some sensors (e.g. IMU, Baro, Compass) see EAHRS_SENSORS
- Magnetic field tables updated
- Non-compass initial yaw alignment uses GPS course over GSF (mostly affects Planes and Rover)
5) Control and navigation enhancements
- DO_SET_ROI_NONE command turns off ROI
- JUMP_TAG mission item support
- Manual mode steering expo configurable (see MANUAL_STR_EXPO)
- Missions can be stored on SD card (see BRD_SD_MISSION)
- NAV_SCRIPT_TIME command accepts floating point arguments
- Pause/Resume returns success if mission is already paused or resumed
8) Camera and gimbal enhancements
- BMMCC support included in Servo driver
- DJI RS2/RS3-Pro gimbal support
- Dual camera support (see CAM2_TYPE)
- Gimbal/Mount2 can be moved to retracted or neutral position
- Gremsy ZIO support
- IMAGE_START_CAPTURE, SET_CAMERA_ZOOM/FOCUS, VIDEO_START/STOP_CAPTURE command support
- Paramters renamed and rescaled
- CAM_TRIGG_TYPE renamed to CAM1_TYPE and options have changed
- CAM_DURATION renamed to CAM1_DURATION and scaled in seconds
- CAM_FEEDBACK_PIN/POL renamed to CAM1_FEEBAK_PIN/POL
- CAM_MIN_INTERVAL renamed to CAM1_INTRVAL_MIN and scaled in seconds
- CAM_TRIGG_DIST renamed to CAMx_TRIGG_DIST and accepts fractional values
- RunCam2 4k support
- ViewPro camera gimbal support
8) Logging changes
- BARD msg includes 3-axis dynamic pressure useful for baro compensation of wind estimate
- MCU log msg includes main CPU temp and voltage (was part of POWR message)
- RCOut banner message always included in Logs
- SCR message includes memory usage of all running scripts
- CANS message includes CAN bus tx/rx statistics
- Home location not logged to CMD message
- MOTB message includes throttle output
9) Scripting enhancements
- EFI Skypower driver gets improved telem messages and bug fixes
- Generator throttle control example added
- Heap max increased by allowing heap to be split across multiple underlying OS heaps
- Hexsoon LEDs applet
- Logging from scripts supports more formats
- Parameters can be removed or reordered
- Parameter description support (scripts must be in AP's applet or driver directory)
- Rangefinder driver support
- Runcam_on_arm applet starts recording when vehicle is armed
- Safety switch, E-Stop and motor interlock support
- Scripts can restart all scripts
- Script_Controller applet supports inflight switching of active scripts
10) Custom build server enhancements
- AIS support for displaying nearby boats can be included
- Battery, Camera and Compass drivers can be included/excluded
- EKF3 wind estimation can be included/excluded
- PCA9685, ToshibaLED, PLAY_TUNE notify drivers can be included/excluded
- RichenPower generator can be included/excluded
- RC SRXL protocol can be excluded
- SIRF GPSs can be included/excluded
11) Safety related enhancements and fixes
- Arming check for servo outputs skipped when SERVOx_FUNCTION is scripting
- Arming check fix if both "All" and other bitmasks are selected (previously only ran the other checks)
- GCS failsafe timeout is configurable (see FS_GCS_TIMEOUT)
- "EK3 sources require RangeFinder" pre-arm check fix when user only sets up 2nd rangefinder (e.g. 1st is disabled)
- Pre-arm check that low and critical battery failsafe thresholds are different
- Pre-arm message fixed if 2nd EKF core unhealthy
- Pre-arm check if reboot required to enabled IMU batch sampling (used for vibe analysis)
- RC failsafe timeout configurable (see RC_FS_TIMEOUT)
12) Minor enhancements
- Boot time reduced by improving parameter conversion efficiency
- BRD_SAFETYENABLE parameter renamed to BRD_SAFETY_DEFLT
- Compass calibration auxiliary switch function (set RCx_OPTION=171)
- Disable IMU3 auxiliary switch function (set RCx_OPTION=110)
- Rangefinder and FS_OPTIONS param conversion code reduced (affects when upgrading from 3.6 or earlier)
- MAVFTP supports file renaming
- MAVLink in-progress reply to some requests for calibration from GCS
13) Bug fixes:
- ADSB telemetry and callsign fixes
- Battery pct reported to GCS limited to 0% to 100% range
- Bi-directional DShot fix on H7 boards after system time wrap (more complete fix than in 4.3.6)
- DisplayPort OSD screen reliability improvement on heavily loaded OSDs especially F4 boards
- DisplayPort OSD artificial horizon better matches actual horizon
- EFI Serial MS bug fix to avoid possible infinite loop
- EKF3 Replay fix when COMPASS_LEARN=3
- ESC Telemetry external temp reporting fix
- Fence upload works even if Auto mode is excluded from firmware
- FMT messages logged even when Fence is exncluded from firmware (e.g. unselected when using custom build server)
- Hardfault avoided if user changes INS_LOG_BAT_CNT while batch sampling running
- ICM20649 temp sensor tolerate increased to avoid unnecessary FIFO reset
- IMU detection bug fix to avoid duplicates
- IMU temp cal fix when using auxiliary IMU
- Message Interval fix for restoring default rate https://github.com/ArduPilot/ardupilot/pull/21947
- RADIO_STATUS messages slow-down feature never completely stops messages from being sent
- SERVOx_TRIM value output momentarily if SERVOx_FUNCTION is changed from Disabled to RCPassThru, RCIN1, etc. Avoids momentary divide-by-zero
- Scripting file system open fix
- Scripting PWM source deletion crash fix
- MAVFTP fix for low baudrates (4800 baud and lower)
- ModalAI VOXL reset handling fix
- MPU6500 IMU fast sampling rate to 4k (was 1K)
- NMEA GPGGA output fixed for GPS quality, num sats and hdop
- Position control reset avoided even with very uneven main loop rate due to high CPU load
- Throttle notch FFT tuning param fix
- VTX protects against pitmode changes when not enabled or vehicle disarmed
14) Developer specific items
- DroneCAN replaces UAVCAN
- FlighAxis simulator rangefinder fixed
- Scripts in applet and drivers directory checked using linter
- Simulator supports main loop timing jitter (see SIM_TIME_JITTER)
- Simulink model and init scripts
- SITL on hardware support (useful to demo servos moving in response to simulated flight)
- SITL parameter definitions added (some, not all)
- Webots 2023a simulator support
- XPlane support for wider range of aircraft
------------------------------------------------------------------
Rover 4.3.0-beta11/beta12 27-Mar-2023
Changes from 4.3.0-beta10
1) Bi-directional DShot fix for possible motor stop approx 72min after startup
------------------------------------------------------------------
Rover 4.3.0-beta10 01-Mar-2023
Changes from 4.3.0-beta9
1) Bug fixes

View File

@ -6,14 +6,14 @@
#include "ap_version.h"
#define THISFIRMWARE "ArduRover V4.4.0-dev"
#define THISFIRMWARE "ArduRover V4.4.0"
// the following line is parsed by the autotest scripts
#define FIRMWARE_VERSION 4,4,0,FIRMWARE_VERSION_TYPE_DEV
#define FIRMWARE_VERSION 4,4,0,FIRMWARE_VERSION_TYPE_OFFICIAL
#define FW_MAJOR 4
#define FW_MINOR 4
#define FW_PATCH 0
#define FW_TYPE FIRMWARE_VERSION_TYPE_DEV
#define FW_TYPE FIRMWARE_VERSION_TYPE_OFFICIAL
#include <AP_Common/AP_FWVersionDefine.h>

View File

@ -216,6 +216,20 @@ AP_HW_rFCU 1102
AP_HW_rGNSS 1103
AP_HW_AEROFOX_AIRSPEED_DLVR 1104
AP_HW_KakuteH7-Wing 1105
AP_HW_SpeedyBeeF405WING 1106
AP_HW_PixSurveyA-IND 1107
AP_HW_SPRACINGH7RF 1108
AP_HW_AEROFOX_GNSS_F9P 1109
AP_HW_JFB110 1110
AP_HW_SDMODELH7V1 1111
AP_HW_FlyingMoonH743 1112
AP_HW_YJUAV_A6 1113
AP_HW_YJUAV_A6Nano 1114
AP_HW_ACNS_CM4PILOT 1115
AP_HW_ACNS_F405AIO 1116
AP_HW_BLITZF7 1117
AP_HW_YJUAV_A6SE 1127
AP_HW_YJUAV_A6SE_H743 1141
AP_HW_ESP32_PERIPH 1205
AP_HW_ESP32S3_PERIPH 1206

View File

@ -32,11 +32,10 @@ private:
void handleMessage(const mavlink_message_t &msg) override { handle_common_message(msg); }
bool handle_guided_request(AP_Mission::Mission_Command &cmd) override { return true; }
MAV_RESULT handle_preflight_reboot(const mavlink_command_long_t &packet, const mavlink_message_t &msg) override;
uint8_t sysid_my_gcs() const override;
protected:
uint8_t sysid_my_gcs() const override;
// Periph information:
MAV_MODE base_mode() const override { return (MAV_MODE)MAV_MODE_FLAG_CUSTOM_MODE_ENABLED; }
MAV_STATE vehicle_system_status() const override { return MAV_STATE_CALIBRATING; }

View File

@ -7,7 +7,7 @@ import sys
try:
import em
except ImportError:
print("you need to install empy with 'python -m pip install empy'")
print("you need to install empy with 'python -m pip install empy==3.3.4'")
sys.exit(1)
try:

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -40,7 +40,7 @@ def check_log(logfile, progress=print, ekf2_only=False, ekf3_only=False, verbose
if not hasattr(m,'C'):
continue
mtype = m.get_type()
if not mtype in counts:
if mtype not in counts:
counts[mtype] = 0
base_counts[mtype] = 0
core = m.C

View File

@ -261,6 +261,10 @@ class Board:
env.DEFINES.update(
HAL_DEBUG_BUILD = 1,
)
elif cfg.options.g:
env.CFLAGS += [
'-g',
]
if cfg.env.COVERAGE:
env.CFLAGS += [
'-fprofile-arcs',

View File

@ -112,7 +112,7 @@ class upload_fw(Task.Task):
and make sure to add it to your path during the installation. Once installed, run this
command in Powershell or Command Prompt to install some packages:
pip.exe install empy pyserial
pip.exe install empy==3.3.4 pyserial
****************************************
****************************************
""" % error_msg)
@ -231,7 +231,7 @@ def sign_firmware(image, private_keyfile):
try:
import monocypher
except ImportError:
Logs.error("Please install monocypher with: python3 -m pip install pymonocypher")
Logs.error("Please install monocypher with: python3 -m pip install pymonocypher==3.1.3.2")
return None
try:
key = open(private_keyfile, 'r').read()
@ -496,6 +496,8 @@ def load_env_vars(env):
env.CHIBIOS_BUILD_FLAGS += ' ENABLE_STATS=yes'
if env.ENABLE_DFU_BOOT and env.BOOTLOADER:
env.CHIBIOS_BUILD_FLAGS += ' USE_ASXOPT=-DCRT0_ENTRY_HOOK=TRUE'
if env.AP_BOARD_START_TIME:
env.CHIBIOS_BUILD_FLAGS += ' AP_BOARD_START_TIME=0x%x' % env.AP_BOARD_START_TIME
def setup_optimization(env):
@ -697,6 +699,7 @@ def build(bld):
'fopen', 'fflush', 'fwrite', 'fread', 'fputs', 'fgets',
'clearerr', 'fseek', 'ferror', 'fclose', 'tmpfile', 'getc', 'ungetc', 'feof',
'ftell', 'freopen', 'remove', 'vfprintf', 'fscanf',
'_gettimeofday', '_times', '_times_r', '_gettimeofday_r', 'time', 'clock' ]
'_gettimeofday', '_times', '_times_r', '_gettimeofday_r', 'time', 'clock',
'_sbrk_r', '_malloc_r', '_calloc_r', '_free_r']
for w in wraplist:
bld.env.LINKFLAGS += ['-Wl,--wrap,%s' % w]

View File

@ -11,7 +11,6 @@ import os
import shutil
import time
import numpy
import operator
from pymavlink import quaternion
from pymavlink import mavutil
@ -135,7 +134,7 @@ class AutoTestCopter(AutoTest):
0, # param6
alt_min # param7
)
self.wait_for_alt(alt_min, timeout=timeout, max_err=max_err)
self.wait_altitude(alt_min-1, alt_min+max_err, relative=True, timeout=timeout)
def takeoff(self,
alt_min=30,
@ -155,17 +154,10 @@ class AutoTestCopter(AutoTest):
self.user_takeoff(alt_min=alt_min, timeout=timeout, max_err=max_err)
else:
self.set_rc(3, takeoff_throttle)
self.wait_for_alt(alt_min=alt_min, timeout=timeout, max_err=max_err)
self.wait_altitude(alt_min-1, alt_min+max_err, relative=True, timeout=timeout)
self.hover()
self.progress("TAKEOFF COMPLETE")
def wait_for_alt(self, alt_min=30, timeout=30, max_err=5):
"""Wait for minimum altitude to be reached."""
self.wait_altitude(alt_min - 1,
(alt_min + max_err),
relative=True,
timeout=timeout)
def land_and_disarm(self, timeout=60):
"""Land the quad."""
self.progress("STARTING LANDING")
@ -177,7 +169,7 @@ class AutoTestCopter(AutoTest):
m = self.mav.recv_match(type='GLOBAL_POSITION_INT', blocking=True)
alt = m.relative_alt / 1000.0 # mm -> m
if alt > min_alt:
self.wait_for_alt(min_alt, timeout=timeout)
self.wait_altitude(min_alt-1, min_alt+5, relative=True, timeout=timeout)
# self.wait_statustext("SIM Hit ground", timeout=timeout)
self.wait_disarmed()
@ -1119,7 +1111,7 @@ class AutoTestCopter(AutoTest):
self.change_mode("LAND")
# check vehicle descends to 2m or less within 40 seconds
self.wait_altitude(-5, 2, timeout=40, relative=True)
self.wait_altitude(-5, 2, timeout=50, relative=True)
# force disarm of vehicle (it will likely not automatically disarm)
self.disarm_vehicle(force=True)
@ -2087,7 +2079,7 @@ class AutoTestCopter(AutoTest):
self.progress("Regaining altitude")
self.change_mode('ALT_HOLD')
self.wait_for_alt(20, max_err=40)
self.wait_altitude(19, 60, relative=True)
self.progress("Flipping in pitch")
self.set_rc(2, 1700)
@ -2427,7 +2419,7 @@ class AutoTestCopter(AutoTest):
raise NotAchievedException("AUTOTUNE gains not present in pilot testing")
# land without changing mode
self.set_rc(3, 1000)
self.wait_for_alt(0)
self.wait_altitude(-1, 5, relative=True)
self.wait_disarmed()
# Check gains are still there after disarm
if (rlld == self.get_parameter("ATC_RAT_RLL_D") or
@ -2678,7 +2670,7 @@ class AutoTestCopter(AutoTest):
0,
timeout=10,
want_result=mavutil.mavlink.MAV_RESULT_FAILED)
self.wait_statustext("Node {} unhealthy".format(gps1_nodeid), check_context=True)
self.wait_statustext(".*Node .* unhealthy", check_context=True, regex=True)
self.stop_sup_program(instance=0)
self.start_sup_program(instance=0)
self.context_stop_collecting('STATUSTEXT')
@ -3851,7 +3843,7 @@ class AutoTestCopter(AutoTest):
new_pos = self.mav.location()
delta = self.get_distance(target, new_pos)
self.progress("Landed %f metres from target position" % delta)
max_delta = 1
max_delta = 1.5
if delta > max_delta:
raise NotAchievedException("Did not land close enough to target position (%fm > %fm" % (delta, max_delta))
@ -4568,7 +4560,7 @@ class AutoTestCopter(AutoTest):
# determine if we've successfully navigated to close to
# where we should be:
dist = math.sqrt(delta_ef.x * delta_ef.x + delta_ef.y * delta_ef.y)
dist_max = 0.15
dist_max = 1
self.progress("dist=%f want <%f" % (dist, dist_max))
if dist < dist_max:
# success! We've gotten within our target distance
@ -4646,6 +4638,7 @@ class AutoTestCopter(AutoTest):
except Exception as e:
self.print_exception_caught(e)
self.disarm_vehicle(force=True)
ex = e
self.context_pop()
@ -6826,6 +6819,7 @@ class AutoTestCopter(AutoTest):
failed = False
wants = []
gots = []
epsilon = 20
while True:
if self.get_sim_time_cached() - tstart > 30:
raise AutoTestTimeoutException("Failed to get distances")
@ -6838,7 +6832,7 @@ class AutoTestCopter(AutoTest):
want = expected_distances_copy[m.orientation]
wants.append(want)
gots.append(got)
if abs(want - got) > 5:
if abs(want - got) > epsilon:
failed = True
del expected_distances_copy[m.orientation]
if failed:
@ -6857,9 +6851,11 @@ class AutoTestCopter(AutoTest):
})
self.set_analog_rangefinder_parameters()
self.reboot_sitl()
tstart = self.get_sim_time()
self.change_mode('LOITER')
self.wait_ekf_happy()
tstart = self.get_sim_time()
while True:
if self.armed():
break
@ -6910,7 +6906,7 @@ class AutoTestCopter(AutoTest):
if self.get_sim_time_cached() - tstart > 10:
break
vel = self.get_body_frame_velocity()
if vel.length() > 0.3:
if vel.length() > 0.5:
raise NotAchievedException("Moved too much (%s)" %
(str(vel),))
shove(None, None)
@ -8338,7 +8334,7 @@ class AutoTestCopter(AutoTest):
def verify_yaw(mav, m):
if m.get_type() != 'ATTITUDE':
return
yawspeed_thresh_rads = math.radians(10)
yawspeed_thresh_rads = math.radians(20)
if m.yawspeed > yawspeed_thresh_rads:
raise NotAchievedException("Excessive yaw on takeoff: %f deg/s > %f deg/s (frame=%s)" %
(math.degrees(m.yawspeed), math.degrees(yawspeed_thresh_rads), frame))
@ -8810,10 +8806,10 @@ class AutoTestCopter(AutoTest):
'''Refind the GPS and attempt to RTL rather than continue to land'''
# https://github.com/ArduPilot/ardupilot/issues/14236
self.progress("arm the vehicle and takeoff in Guided")
self.takeoff(20, mode='GUIDED')
self.takeoff(50, mode='GUIDED')
self.progress("fly 50m North (or whatever)")
old_pos = self.mav.recv_match(type='GLOBAL_POSITION_INT', blocking=True)
self.fly_guided_move_global_relative_alt(50, 0, 20)
self.fly_guided_move_global_relative_alt(50, 0, 50)
self.set_parameter('GPS_TYPE', 0)
self.drain_mav()
tstart = self.get_sim_time()
@ -9467,111 +9463,118 @@ class AutoTestCopter(AutoTest):
def Sprayer(self):
"""Test sprayer functionality."""
self.context_push()
ex = None
try:
rc_ch = 9
pump_ch = 5
spinner_ch = 6
pump_ch_min = 1050
pump_ch_trim = 1520
pump_ch_max = 1950
spinner_ch_min = 975
spinner_ch_trim = 1510
spinner_ch_max = 1975
self.set_parameters({
"SPRAY_ENABLE": 1,
rc_ch = 9
pump_ch = 5
spinner_ch = 6
pump_ch_min = 1050
pump_ch_trim = 1520
pump_ch_max = 1950
spinner_ch_min = 975
spinner_ch_trim = 1510
spinner_ch_max = 1975
"SERVO%u_FUNCTION" % pump_ch: 22,
"SERVO%u_MIN" % pump_ch: pump_ch_min,
"SERVO%u_TRIM" % pump_ch: pump_ch_trim,
"SERVO%u_MAX" % pump_ch: pump_ch_max,
self.set_parameters({
"SPRAY_ENABLE": 1,
"SERVO%u_FUNCTION" % spinner_ch: 23,
"SERVO%u_MIN" % spinner_ch: spinner_ch_min,
"SERVO%u_TRIM" % spinner_ch: spinner_ch_trim,
"SERVO%u_MAX" % spinner_ch: spinner_ch_max,
"SERVO%u_FUNCTION" % pump_ch: 22,
"SERVO%u_MIN" % pump_ch: pump_ch_min,
"SERVO%u_TRIM" % pump_ch: pump_ch_trim,
"SERVO%u_MAX" % pump_ch: pump_ch_max,
"SIM_SPR_ENABLE": 1,
"SIM_SPR_PUMP": pump_ch,
"SIM_SPR_SPIN": spinner_ch,
"SERVO%u_FUNCTION" % spinner_ch: 23,
"SERVO%u_MIN" % spinner_ch: spinner_ch_min,
"SERVO%u_TRIM" % spinner_ch: spinner_ch_trim,
"SERVO%u_MAX" % spinner_ch: spinner_ch_max,
"RC%u_OPTION" % rc_ch: 15,
"LOG_DISARMED": 1,
})
"SIM_SPR_ENABLE": 1,
"SIM_SPR_PUMP": pump_ch,
"SIM_SPR_SPIN": spinner_ch,
self.reboot_sitl()
"RC%u_OPTION" % rc_ch: 15,
"LOG_DISARMED": 1,
})
self.wait_ready_to_arm()
self.arm_vehicle()
self.reboot_sitl()
self.progress("test bootup state - it's zero-output!")
self.wait_servo_channel_value(spinner_ch, 0)
self.wait_servo_channel_value(pump_ch, 0)
self.wait_ready_to_arm()
self.arm_vehicle()
self.progress("Enable sprayer")
self.set_rc(rc_ch, 2000)
self.progress("test bootup state - it's zero-output!")
self.wait_servo_channel_value(spinner_ch, 0)
self.wait_servo_channel_value(pump_ch, 0)
self.progress("Testing zero-speed state")
self.wait_servo_channel_value(spinner_ch, spinner_ch_min)
self.wait_servo_channel_value(pump_ch, pump_ch_min)
self.progress("Enable sprayer")
self.set_rc(rc_ch, 2000)
self.progress("Testing turning it off")
self.set_rc(rc_ch, 1000)
self.wait_servo_channel_value(spinner_ch, spinner_ch_min)
self.wait_servo_channel_value(pump_ch, pump_ch_min)
self.progress("Testing zero-speed state")
self.wait_servo_channel_value(spinner_ch, spinner_ch_min)
self.wait_servo_channel_value(pump_ch, pump_ch_min)
self.progress("Testing turning it back on")
self.set_rc(rc_ch, 2000)
self.wait_servo_channel_value(spinner_ch, spinner_ch_min)
self.wait_servo_channel_value(pump_ch, pump_ch_min)
self.progress("Testing turning it off")
self.set_rc(rc_ch, 1000)
self.wait_servo_channel_value(spinner_ch, spinner_ch_min)
self.wait_servo_channel_value(pump_ch, pump_ch_min)
self.takeoff(30, mode='LOITER')
self.progress("Testing turning it back on")
self.set_rc(rc_ch, 2000)
self.wait_servo_channel_value(spinner_ch, spinner_ch_min)
self.wait_servo_channel_value(pump_ch, pump_ch_min)
self.progress("Testing speed-ramping")
self.set_rc(1, 1700) # start driving forward
self.takeoff(30, mode='LOITER')
# this is somewhat empirical...
self.wait_servo_channel_value(pump_ch, 1458, timeout=60)
self.progress("Testing speed-ramping")
self.set_rc(1, 1700) # start driving forward
self.progress("Turning it off again")
self.set_rc(rc_ch, 1000)
self.wait_servo_channel_value(spinner_ch, spinner_ch_min)
self.wait_servo_channel_value(pump_ch, pump_ch_min)
# this is somewhat empirical...
self.wait_servo_channel_value(
pump_ch,
1458,
timeout=60,
comparator=lambda x, y : abs(x-y) < 5
)
self.start_subtest("Checking mavlink commands")
self.progress("Starting Sprayer")
self.run_cmd(mavutil.mavlink.MAV_CMD_DO_SPRAYER,
1, # p1
0, # p2
0, # p3
0, # p4
0, # p5
0, # p6
0) # p7
self.progress("Turning it off again")
self.set_rc(rc_ch, 1000)
self.wait_servo_channel_value(spinner_ch, spinner_ch_min)
self.wait_servo_channel_value(pump_ch, pump_ch_min)
self.progress("Testing speed-ramping")
self.wait_servo_channel_value(pump_ch, 1458, timeout=60, comparator=operator.gt)
self.start_subtest("Stopping Sprayer")
self.run_cmd(mavutil.mavlink.MAV_CMD_DO_SPRAYER,
0, # p1
0, # p2
0, # p3
0, # p4
0, # p5
0, # p6
0) # p7
self.wait_servo_channel_value(pump_ch, pump_ch_min)
self.start_subtest("Checking mavlink commands")
self.progress("Starting Sprayer")
self.run_cmd(mavutil.mavlink.MAV_CMD_DO_SPRAYER,
1, # p1
0, # p2
0, # p3
0, # p4
0, # p5
0, # p6
0) # p7
self.progress("Testing speed-ramping")
self.wait_servo_channel_value(
pump_ch,
1458,
timeout=60,
comparator=lambda x, y : abs(x-y) < 5
)
self.start_subtest("Stopping Sprayer")
self.run_cmd(mavutil.mavlink.MAV_CMD_DO_SPRAYER,
0, # p1
0, # p2
0, # p3
0, # p4
0, # p5
0, # p6
0) # p7
self.wait_servo_channel_value(pump_ch, pump_ch_min)
self.progress("Sprayer OK")
except Exception as e:
self.print_exception_caught(e)
ex = e
self.context_pop()
self.disarm_vehicle(force=True)
self.reboot_sitl()
if ex:
raise ex
self.progress("Sprayer OK")
def tests1a(self):
'''return list of all tests'''
@ -9749,7 +9752,7 @@ class AutoTestCopter(AutoTest):
self.reboot_sitl()
self.wait_ready_to_arm()
self.takeoff(alt_min=20, mode='LOITER')
self.land_and_disarm()
self.do_RTL()
self.context_pop()
self.reboot_sitl()

View File

@ -20,6 +20,8 @@ from common import AutoTestTimeoutException
from common import NotAchievedException
from common import PreconditionFailedException
from common import WaitModeTimeout
from common import Test
from pymavlink.rotmat import Vector3
from pysim import vehicleinfo
@ -625,18 +627,18 @@ class AutoTestPlane(AutoTest):
self.change_mode("AUTO")
self.wait_ready_to_arm()
self.arm_vehicle()
self.progress("Waiting for deepstall messages")
# note that the following two don't necessarily happen in this
# order, but at very high speedups we may miss the elevator
# PWM if we first look for the text (due to the get_sim_time()
# in wait_servo_channel_value)
self.context_collect('STATUSTEXT')
self.wait_current_waypoint(4)
# assume elevator is on channel 2:
self.wait_servo_channel_value(2, deepstall_elevator_pwm, timeout=240)
self.wait_text("Deepstall: Entry: ", check_context=True)
self.progress("Waiting for stage DEEPSTALL_STAGE_LAND")
self.assert_receive_message(
'DEEPSTALL',
condition='DEEPSTALL.stage==6',
timeout=240,
)
self.progress("Reached stage DEEPSTALL_STAGE_LAND")
self.disarm_wait(timeout=120)
self.set_current_waypoint(0, check_afterwards=False)
@ -780,6 +782,7 @@ class AutoTestPlane(AutoTest):
0,
0)
self.wait_airspeed(new_target_airspeed-0.5, new_target_airspeed+0.5)
self.context_push()
self.progress("Adding some wind, hoping groundspeed increases/decreases")
self.set_parameters({
"SIM_WIND_SPD": 7,
@ -797,6 +800,7 @@ class AutoTestPlane(AutoTest):
self.progress("groundspeed and airspeed should be different (have=%f want=%f)" % (delta, want_delta))
if delta > want_delta:
break
self.context_pop()
self.fly_home_land_and_disarm(timeout=240)
def fly_home_land_and_disarm(self, timeout=120):
@ -994,7 +998,7 @@ class AutoTestPlane(AutoTest):
self.context_collect("HEARTBEAT")
self.set_parameter("SIM_RC_FAIL", 2) # throttle-to-950
self.wait_mode('RTL') # long failsafe
if (not self.get_mode_from_mode_mapping("CIRCLE") in
if (self.get_mode_from_mode_mapping("CIRCLE") not in
[x.custom_mode for x in self.context_stop_collecting("HEARTBEAT")]):
raise NotAchievedException("Did not go via circle mode")
self.progress("Ensure we've had our throttle squashed to 950")
@ -1032,7 +1036,7 @@ class AutoTestPlane(AutoTest):
self.context_collect("HEARTBEAT")
self.set_parameter("SIM_RC_FAIL", 1) # no-pulses
self.wait_mode('RTL') # long failsafe
if (not self.get_mode_from_mode_mapping("CIRCLE") in
if (self.get_mode_from_mode_mapping("CIRCLE") not in
[x.custom_mode for x in self.context_stop_collecting("HEARTBEAT")]):
raise NotAchievedException("Did not go via circle mode")
self.do_timesync_roundtrip()
@ -1169,29 +1173,28 @@ class AutoTestPlane(AutoTest):
'''Ensure Long-Failsafe works on GCS loss'''
self.start_subtest("Test Failsafe: RTL")
self.load_sample_mission()
self.set_parameter("RTL_AUTOLAND", 1)
self.change_mode("AUTO")
self.takeoff()
self.set_parameters({
"FS_GCS_ENABL": 1,
"FS_LONG_ACTN": 1,
"RTL_AUTOLAND": 1,
"SYSID_MYGCS": self.mav.source_system,
})
self.takeoff()
self.change_mode('LOITER')
self.progress("Disconnecting GCS")
self.set_heartbeat_rate(0)
self.wait_mode("RTL", timeout=5)
self.wait_mode("RTL", timeout=10)
self.set_heartbeat_rate(self.speedup)
self.end_subtest("Completed RTL Failsafe test")
self.start_subtest("Test Failsafe: FBWA Glide")
self.set_parameters({
"RTL_AUTOLAND": 1,
"FS_LONG_ACTN": 2,
})
self.change_mode("AUTO")
self.takeoff()
self.change_mode('AUTO')
self.progress("Disconnecting GCS")
self.set_heartbeat_rate(0)
self.wait_mode("FBWA", timeout=5)
self.wait_mode("FBWA", timeout=10)
self.set_heartbeat_rate(self.speedup)
self.end_subtest("Completed FBWA Failsafe test")
@ -1844,6 +1847,7 @@ class AutoTestPlane(AutoTest):
self.fly_home_land_and_disarm()
def deadreckoning_main(self, disable_airspeed_sensor=False):
self.reboot_sitl()
self.wait_ready_to_arm()
self.gpi = None
self.simstate = None
@ -2414,11 +2418,6 @@ class AutoTestPlane(AutoTest):
self.load_mission('CMAC-soar.txt', strict=False)
self.set_current_waypoint(1)
self.change_mode('AUTO')
self.wait_ready_to_arm()
self.arm_vehicle()
# Enable thermalling RC
rc_chan = 0
for i in range(8):
@ -2432,15 +2431,22 @@ class AutoTestPlane(AutoTest):
self.set_rc_from_map({
rc_chan: 1900,
3: 1500, # Use trim airspeed.
})
self.set_parameters({
"SOAR_VSPEED": 0.55,
"SOAR_MIN_THML_S": 25,
})
self.set_current_waypoint(1)
self.change_mode('AUTO')
self.wait_ready_to_arm()
self.arm_vehicle()
# Wait to detect thermal
self.progress("Waiting for thermal")
self.wait_mode('THERMAL', timeout=600)
self.set_parameter("SOAR_VSPEED", 0.6)
# Wait to climb to SOAR_ALT_MAX
self.progress("Waiting for climb to max altitude")
alt_max = self.get_parameter('SOAR_ALT_MAX')
@ -2913,7 +2919,7 @@ class AutoTestPlane(AutoTest):
self.wait_and_maintain_wind_estimate(
5, 45,
speed_tolerance=1,
timeout=20
timeout=30
)
self.fly_home_land_and_disarm()
@ -4569,7 +4575,7 @@ class AutoTestPlane(AutoTest):
self.AltResetBadGPS,
self.AirspeedCal,
self.MissionJumpTags,
self.GCSFailsafe,
Test(self.GCSFailsafe, speedup=8),
self.SDCardWPTest,
])
return ret

View File

@ -33,7 +33,6 @@ import helicopter
import examples
from pysim import util
from pymavlink import mavutil
from pymavlink.generator import mavtemplate
from common import Test
@ -58,47 +57,6 @@ def buildlogs_path(path):
return os.path.join(*bits)
def get_default_params(atype, binary):
"""Get default parameters."""
# use rover simulator so SITL is not starved of input
HOME = mavutil.location(40.071374969556928,
-105.22978898137808,
1583.702759,
246)
if "plane" in binary or "rover" in binary:
frame = "rover"
else:
frame = "+"
home = "%f,%f,%u,%u" % (HOME.lat, HOME.lng, HOME.alt, HOME.heading)
mavproxy_master = 'tcp:127.0.0.1:5760'
sitl = util.start_SITL(binary,
wipe=True,
model=frame,
home=home,
speedup=10,
unhide_parameters=True)
mavproxy = util.start_MAVProxy_SITL(atype,
master=mavproxy_master)
print("Dumping defaults")
idx = mavproxy.expect([r'Saved [0-9]+ parameters to (\S+)'])
if idx == 0:
# we need to restart it after eeprom erase
util.pexpect_close(mavproxy)
util.pexpect_close(sitl)
sitl = util.start_SITL(binary, model=frame, home=home, speedup=10)
mavproxy = util.start_MAVProxy_SITL(atype,
master=mavproxy_master)
mavproxy.expect(r'Saved [0-9]+ parameters to (\S+)')
parmfile = mavproxy.match.group(1)
dest = buildlogs_path('%s-defaults.parm' % atype)
shutil.copy(parmfile, dest)
util.pexpect_close(mavproxy)
util.pexpect_close(sitl)
print("Saved defaults for %s to %s" % (atype, dest))
return True
def build_all_filepath():
"""Get build_all.sh path."""
return util.reltopdir('Tools/scripts/build_all.sh')
@ -484,6 +442,11 @@ def run_step(step):
return util.build_replay(board='SITL')
if vehicle_binary is not None:
try:
binary = binary_path(step, debug=opts.debug)
os.unlink(binary)
except (FileNotFoundError, ValueError):
pass
if len(vehicle_binary.split(".")) == 1:
return util.build_SITL(vehicle_binary, **build_opts)
else:
@ -495,9 +458,6 @@ def run_step(step):
binary = binary_path(step, debug=opts.debug)
if step.startswith("defaults"):
vehicle = step[9:]
return get_default_params(vehicle, binary)
supplementary_binaries = []
if step in suplementary_test_binary_map:
for supplementary_test_binary in suplementary_test_binary_map[step]:
@ -690,9 +650,10 @@ def write_fullresults():
results.addglob("GPX track", '*.gpx')
# results common to all vehicles:
vehicle_files = [('{vehicle} defaults', '{vehicle}-defaults.parm'),
('{vehicle} core', '{vehicle}.core'),
('{vehicle} ELF', '{vehicle}.elf'), ]
vehicle_files = [
('{vehicle} core', '{vehicle}.core'),
('{vehicle} ELF', '{vehicle}.elf'),
]
vehicle_globs = [('{vehicle} log', '{vehicle}-*.BIN'), ]
for vehicle in all_vehicles():
subs = {'vehicle': vehicle}
@ -1082,33 +1043,28 @@ if __name__ == "__main__":
'run.examples',
'build.Plane',
'defaults.Plane',
'test.Plane',
'test.QuadPlane',
'build.Rover',
'defaults.Rover',
'test.Rover',
'test.BalanceBot',
'test.Sailboat',
'build.Copter',
'defaults.Copter',
'test.Copter',
'build.Helicopter',
'test.Helicopter',
'build.Tracker',
'defaults.Tracker',
'test.Tracker',
'build.Sub',
'defaults.Sub',
'test.Sub',
'build.Blimp',
'defaults.Blimp',
'test.Blimp',
'build.SITLPeriphGPS',
'test.CAN',
@ -1149,11 +1105,6 @@ if __name__ == "__main__":
"drive.balancebot": "test.BalanceBot",
"fly.CopterAVC": "test.Helicopter",
"test.AntennaTracker": "test.Tracker",
"defaults.ArduCopter": "defaults.Copter",
"defaults.ArduPlane": "defaults.Plane",
"defaults.ArduSub": "defaults.Sub",
"defaults.APMrover2": "defaults.Rover",
"defaults.AntennaTracker": "defaults.Tracker",
"fly.ArduCopterTests1a": "test.CopterTests1a",
"fly.ArduCopterTests1b": "test.CopterTests1b",
"fly.ArduCopterTests1c": "test.CopterTests1c",

View File

@ -1984,7 +1984,8 @@ class AutoTest(ABC):
self.progress("Rebooting SITL")
self.reboot_sitl_mav(required_bootcount=required_bootcount, force=force)
self.do_heartbeats(force=True)
self.assert_simstate_location_is_at_startup_location()
if self.frame != 'sailboat': # sailboats drift with wind!
self.assert_simstate_location_is_at_startup_location()
def reboot_sitl_mavproxy(self, required_bootcount=None):
"""Reboot SITL instance using MAVProxy and wait for it to reconnect."""
@ -2038,6 +2039,7 @@ class AutoTest(ABC):
def set_streamrate(self, streamrate, timeout=20, stream=mavutil.mavlink.MAV_DATA_STREAM_ALL):
'''set MAV_DATA_STREAM_ALL; timeout is wallclock time'''
self.do_timesync_roundtrip(timeout_in_wallclock=True)
tstart = time.time()
while True:
if time.time() - tstart > timeout:
@ -3363,17 +3365,19 @@ class AutoTest(ABC):
self.progress("Received: %s" % str(m))
if m is None:
continue
if m.tc1 == 0:
self.progress("this is a timesync request, which we don't answer")
continue
if m.ts1 % 1000 != self.mav.source_system:
self.progress("this isn't a response to our timesync (%s)" % (m.ts1 % 1000))
continue
if m.tc1 == 0:
# this should also not happen:
self.progress("this is a timesync request, which we don't answer")
continue
if int(m.ts1 / 1000) != self.timesync_number:
self.progress("this isn't the one we just sent")
continue
if m.get_srcSystem() != self.mav.target_system:
self.progress("response from system other than our target")
self.progress("response from system other than our target (want=%u got=%u" %
(self.mav.target_system, m.get_srcSystem()))
continue
# no component check ATM because we send broadcast...
# if m.get_srcComponent() != self.mav.target_component:
@ -4473,13 +4477,14 @@ class AutoTest(ABC):
raise ValueError("count %u not handled" % count)
self.progress("Rally content same")
def load_rally(self, filename):
def load_rally_using_mavproxy(self, filename):
"""Load rally points from a file to flight controller."""
self.progress("Loading rally points (%s)" % filename)
path = os.path.join(testdir, self.current_test_name_directory, filename)
mavproxy = self.start_mavproxy()
mavproxy.send('rally load %s\n' % path)
mavproxy.expect("Loaded")
self.delay_sim_time(10) # allow transfer to complete
self.stop_mavproxy(mavproxy)
def load_sample_mission(self):
@ -6379,10 +6384,13 @@ class AutoTest(ABC):
**kwargs
)
def wait_altitude(self, altitude_min, altitude_max, relative=False, timeout=30, **kwargs):
def wait_altitude(self, altitude_min, altitude_max, relative=False, timeout=None, **kwargs):
"""Wait for a given altitude range."""
assert altitude_min <= altitude_max, "Minimum altitude should be less than maximum altitude."
if timeout is None:
timeout = 30
def validator(value2, target2=None):
if altitude_min <= value2 <= altitude_max:
return True
@ -6767,11 +6775,12 @@ class AutoTest(ABC):
return Vector3(msg.vx, msg.vy, msg.vz)
"""Wait for a given speed vector."""
def wait_speed_vector(self, speed_vector, accuracy=0.2, timeout=30, **kwargs):
def wait_speed_vector(self, speed_vector, accuracy=0.3, timeout=30, **kwargs):
def validator(value2, target2):
return (math.fabs(value2.x - target2.x) <= accuracy and
math.fabs(value2.y - target2.y) <= accuracy and
math.fabs(value2.z - target2.z) <= accuracy)
for (want, got) in (target2.x, value2.x), (target2.y, value2.y), (target2.z, value2.z):
if want != float("nan") and (math.fabs(got - want) > accuracy):
return False
return True
self.wait_and_maintain(
value_name="SpeedVector",
@ -7205,7 +7214,7 @@ class AutoTest(ABC):
def wait_gps_sys_status_not_present_or_enabled_and_healthy(self, timeout=30):
self.progress("Waiting for GPS health")
tstart = self.get_sim_time_cached()
tstart = self.get_sim_time()
while True:
now = self.get_sim_time_cached()
if now - tstart > timeout:
@ -7646,6 +7655,10 @@ Also, ignores heartbeats not from our target system'''
self.mav.mav.set_send_callback(self.send_message_hook, self)
self.mav.idle_hooks.append(self.idle_hook)
# we need to wait for a heartbeat here. If we don't then
# self.mav.target_system will be zero because it hasn't
# "locked on" to a target system yet.
self.wait_heartbeat()
self.set_streamrate(self.sitl_streamrate())
def show_test_timings_key_sorter(self, t):
@ -7855,6 +7868,9 @@ Also, ignores heartbeats not from our target system'''
passed = False
reset_needed = True
# if we haven't already reset ArduPilot because it's dead,
# then ensure the vehicle was disarmed at the end of the test.
# If it wasn't then the test is considered failed:
if ardupilot_alive and self.armed() and not self.is_tracker():
if ex is None:
ex = ArmedAtEndOfTestException("Still armed at end of test")
@ -7871,6 +7887,9 @@ Also, ignores heartbeats not from our target system'''
self.progress("Force-rebooting SITL")
self.reboot_sitl() # that'll learn it
passed = False
elif not passed: # implicit reboot after a failed test:
self.progress("Test failed but ArduPilot process alive; rebooting")
self.reboot_sitl() # that'll learn it
if self._mavproxy is not None:
self.progress("Stopping auto-started mavproxy")
@ -8014,6 +8033,11 @@ Also, ignores heartbeats not from our target system'''
self.sup_prog.append(sup_prog_link)
self.expect_list_add(sup_prog_link)
# mavlink will have disconnected here. Explicitly reconnect,
# or the first packet we send will be lost:
if self.mav is not None:
self.mav.reconnect()
def get_suplementary_programs(self):
return self.sup_prog
@ -8374,11 +8398,11 @@ Also, ignores heartbeats not from our target system'''
start_loc = self.sitl_start_location()
self.progress("SITL start loc: %s" % str(start_loc))
delta = abs(orig_home.latitude * 1.0e-7 - start_loc.lat)
if delta > 0.000001:
if delta > 0.000006:
raise ValueError("homes differ in lat got=%f vs want=%f delta=%f" %
(orig_home.latitude * 1.0e-7, start_loc.lat, delta))
delta = abs(orig_home.longitude * 1.0e-7 - start_loc.lng)
if delta > 0.000001:
if delta > 0.000006:
raise ValueError("homes differ in lon got=%f vs want=%f delta=%f" %
(orig_home.longitude * 1.0e-7, start_loc.lng, delta))
if self.is_rover():
@ -9569,6 +9593,8 @@ Also, ignores heartbeats not from our target system'''
self.set_rc(interlock_channel, 1000)
self.start_subtest("Test all mode arming")
self.wait_ready_to_arm()
if self.arming_test_mission() is not None:
self.load_mission(self.arming_test_mission())
@ -12980,6 +13006,7 @@ switch value'''
(msg, m.alt, gpi_alt))
introduced_error = 10 # in metres
self.set_parameter("SIM_GPS2_ALT_OFS", introduced_error)
self.do_timesync_roundtrip()
m = self.assert_receive_message("GPS2_RAW")
if abs((m.alt-introduced_error*1000) - gpi_alt) > 100:
raise NotAchievedException("skewed Alt (%s) discrepancy; %d+%d vs %d" %
@ -12998,9 +13025,11 @@ switch value'''
if abs(new_gpi_alt2 - m.alt) > 100:
raise NotAchievedException("Failover not detected")
def fetch_file_via_ftp(self, path):
def fetch_file_via_ftp(self, path, timeout=20):
'''returns the content of the FTP'able file at path'''
self.progress("Retrieving (%s) using MAVProxy" % path)
mavproxy = self.start_mavproxy()
mavproxy.expect("Saved .* parameters to")
ex = None
tmpfile = tempfile.NamedTemporaryFile(mode='r', delete=False)
try:
@ -13009,9 +13038,18 @@ switch value'''
mavproxy.send("ftp set debug 1\n") # so we get the "Terminated session" message
mavproxy.send("ftp get %s %s\n" % (path, tmpfile.name))
mavproxy.expect("Getting")
self.delay_sim_time(2)
mavproxy.send("ftp status\n")
mavproxy.expect("No transfer in progress")
tstart = self.get_sim_time()
while True:
now = self.get_sim_time()
if now - tstart > timeout:
raise NotAchievedException("expected complete transfer")
self.progress("Polling status")
mavproxy.send("ftp status\n")
try:
mavproxy.expect("No transfer in progress", timeout=1)
break
except Exception:
continue
# terminate the connection, or it may still be in progress the next time an FTP is attempted:
mavproxy.send("ftp cancel\n")
mavproxy.expect("Terminated session")

View File

@ -1 +1,2 @@
Q_OPTIONS 64
ICE_RPM_THRESH 50 # idles at 70 (1% thrust)

View File

@ -161,7 +161,7 @@ class AutoTestHelicopter(AutoTestCopter):
self.user_takeoff(alt_min=alt_min)
else:
self.set_rc(3, takeoff_throttle)
self.wait_for_alt(alt_min=alt_min, timeout=timeout)
self.wait_altitude(alt_min-1, alt_min+5, relative=True, timeout=timeout)
self.hover()
self.progress("TAKEOFF COMPLETE")

View File

@ -124,6 +124,8 @@ known_units = {
'RPM' : 'Revolutions Per Minute',
'kg/m/m' : 'kilograms per square meter', # metre is the SI unit name, meter is the american spelling of it
'kg/m/m/m': 'kilograms per cubic meter',
'litres' : 'litres',
'Ohm' : 'Ohm',
}
required_param_fields = [

View File

@ -393,6 +393,31 @@ class FakeMacOSXSpawn(object):
return True
class PSpawnStdPrettyPrinter(object):
'''a fake filehandle-like object which prefixes a string to all lines
before printing to stdout/stderr. To be used to pass to
pexpect.spawn's logfile argument
'''
def __init__(self, output=sys.stdout, prefix="stdout"):
self.output = output
self.prefix = prefix
self.buffer = ""
def close(self):
self.print_prefixed_line(self.buffer)
def write(self, data):
self.buffer += data
for line in self.buffer.split("\n"):
self.print_prefixed_line(line)
def print_prefixed_line(self, line):
print("%s: %s" % (self.prefix, line), file=self.output)
def flush(self):
pass
def start_SITL(binary,
valgrind=False,
callgrind=False,
@ -411,7 +436,8 @@ def start_SITL(binary,
customisations=[],
lldb=False,
enable_fgview_output=False,
supplementary=False):
supplementary=False,
stdout_prefix=None):
if model is None and not supplementary:
raise ValueError("model must not be None")
@ -513,6 +539,11 @@ def start_SITL(binary,
cmd.extend(customisations)
pexpect_logfile_prefix = stdout_prefix
if pexpect_logfile_prefix is None:
pexpect_logfile_prefix = os.path.basename(binary)
pexpect_logfile = PSpawnStdPrettyPrinter(prefix=pexpect_logfile_prefix)
if (gdb or lldb) and sys.platform == "darwin" and os.getenv('DISPLAY'):
global windowID
# on MacOS record the window IDs so we can close them later
@ -550,7 +581,7 @@ def start_SITL(binary,
# AP gets a redirect-stdout-to-filehandle option. So, in the
# meantime, return a dummy:
return pexpect.spawn("true", ["true"],
logfile=sys.stdout,
logfile=pexpect_logfile,
encoding=ENCODING,
timeout=5)
else:
@ -558,7 +589,7 @@ def start_SITL(binary,
first = cmd[0]
rest = cmd[1:]
child = pexpect.spawn(first, rest, logfile=sys.stdout, encoding=ENCODING, timeout=5)
child = pexpect.spawn(first, rest, logfile=pexpect_logfile, encoding=ENCODING, timeout=5)
pexpect_autoclose(child)
# give time for parameters to properly setup
time.sleep(3)

View File

@ -946,7 +946,7 @@ class AutoTestQuadPlane(AutoTest):
self.wait_rpm(1, 6500, 7500, minimum_duration=30, timeout=40)
self.progress("Setting min-throttle")
self.set_rc(3, 1000)
self.wait_rpm(1, 300, 400, minimum_duration=1)
self.wait_rpm(1, 65, 75, minimum_duration=1)
self.progress("Setting engine-start RC switch to LOW")
self.set_rc(rc_engine_start_chan, 1000)
self.wait_rpm(1, 0, 0, minimum_duration=1)

View File

@ -1290,22 +1290,27 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
def Rally(self):
'''Test Rally Points'''
self.load_rally("rover-test-rally.txt")
self.load_rally_using_mavproxy("rover-test-rally.txt")
self.assert_parameter_value('RALLY_TOTAL', 2)
self.wait_ready_to_arm()
self.arm_vehicle()
# calculate early to avoid round-trips while vehicle is moving:
accuracy = self.get_parameter("WP_RADIUS")
self.reach_heading_manual(10)
self.reach_distance_manual(50)
self.change_mode("RTL")
# location copied in from rover-test-rally.txt:
loc = mavutil.location(40.071553,
-105.229401,
0,
0)
accuracy = self.get_parameter("WP_RADIUS")
self.wait_location(loc, accuracy=accuracy, minimum_duration=10)
self.wait_location(loc, accuracy=accuracy, minimum_duration=10, timeout=45)
self.disarm_vehicle()
def fence_with_bad_frame(self, target_system=1, target_component=1):
@ -6289,7 +6294,6 @@ Brakes have negligible effect (with=%0.2fm without=%0.2fm delta=%0.2fm)
self.DriveRTL,
self.SmartRTL,
self.DriveSquare,
self.DriveMaxRCIN,
self.DriveMission,
# self.DriveBrake, # disabled due to frequent failures
self.GetBanner,

BIN
Tools/bootloaders/BETAFPV-F405_bl.bin generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/BETAFPV-F405_bl.hex generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/BlitzF745AIO_bl.bin generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/BlitzF745AIO_bl.hex generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/CubeOrangePlus-bdshot_bl.bin generated Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Tools/bootloaders/HEEWING-F405_bl.bin generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/HEEWING-F405_bl.hex generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/HEEWING-F405v2_bl.bin generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/HEEWING-F405v2_bl.hex generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/JFB100_bl.bin generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/JFB100_bl.hex generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/KakuteH7-Wing_bl.bin generated Executable file

Binary file not shown.

BIN
Tools/bootloaders/KakuteH7-Wing_bl.hex generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Tools/bootloaders/SDMODELH7V1_bl.bin generated Executable file

Binary file not shown.

BIN
Tools/bootloaders/SDMODELH7V1_bl.elf generated Executable file

Binary file not shown.

BIN
Tools/bootloaders/SDMODELH7V1_bl.hex generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/SIYI_N7_bl.bin generated Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
Tools/bootloaders/SpeedyBeeF405Mini_bl.bin generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/SpeedyBeeF405Mini_bl.hex generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/SpeedyBeeF405WING_bl.bin generated Executable file

Binary file not shown.

BIN
Tools/bootloaders/TMotorH743_bl.bin generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/TMotorH743_bl.hex generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/YJUAV_A6SE_H743_bl.bin generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/YJUAV_A6SE_H743_bl.hex generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/YJUAV_A6SE_bl.bin generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/YJUAV_A6SE_bl.hex generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/mRoCZeroOEMH7-bdshot_bl.bin generated Executable file

Binary file not shown.

Binary file not shown.

BIN
Tools/bootloaders/speedybeef4v4_bl.bin generated Normal file

Binary file not shown.

BIN
Tools/bootloaders/speedybeef4v4_bl.hex generated Normal file

Binary file not shown.

View File

@ -26,7 +26,7 @@ BASE_PKGS="base-devel ccache git gsfonts tk wget gcc"
SITL_PKGS="python-pip python-setuptools python-wheel python-wxpython opencv python-numpy python-scipy"
PX4_PKGS="lib32-glibc zip zlib ncurses"
PYTHON_PKGS="future lxml pymavlink MAVProxy pexpect argparse matplotlib pyparsing geocoder pyserial empy dronecan"
PYTHON_PKGS="future lxml pymavlink MAVProxy pexpect argparse matplotlib pyparsing geocoder pyserial empy==3.3.4 dronecan"
# GNU Tools for ARM Embedded Processors
# (see https://launchpad.net/gcc-arm-embedded/)

View File

@ -159,7 +159,7 @@ if [[ $DO_AP_STM_ENV -eq 1 ]]; then
install_arm_none_eabi_toolchain
fi
PYTHON_PKGS="future lxml pymavlink MAVProxy pexpect geocoder flake8 empy dronecan"
PYTHON_PKGS="future lxml pymavlink MAVProxy pexpect geocoder flake8 empy==3.3.4 dronecan"
# add some Python packages required for commonly-used MAVProxy modules and hex file generation:
if [[ $SKIP_AP_EXT_ENV -ne 1 ]]; then
PYTHON_PKGS="$PYTHON_PKGS intelhex gnureadline"

View File

@ -144,9 +144,9 @@ fi
BASE_PKGS="build-essential ccache g++ gawk git make wget"
if [ ${RELEASE_CODENAME} == 'bionic' ]; then
# use fixed version for package that drop python2 support
PYTHON_PKGS="future lxml pymavlink MAVProxy pexpect flake8==3.7.9 requests==2.27.1 monotonic==1.6 geocoder empy configparser==4.0.2 click==7.1.2 decorator==4.4.2 dronecan"
PYTHON_PKGS="future lxml pymavlink MAVProxy pexpect flake8==3.7.9 requests==2.27.1 monotonic==1.6 geocoder empy==3.3.4 configparser==4.0.2 click==7.1.2 decorator==4.4.2 dronecan"
else
PYTHON_PKGS="future lxml pymavlink MAVProxy pexpect flake8 geocoder empy dronecan"
PYTHON_PKGS="future lxml pymavlink MAVProxy pexpect flake8 geocoder empy==3.3.4 dronecan"
fi
# add some Python packages required for commonly-used MAVProxy modules and hex file generation:

View File

@ -19,7 +19,7 @@ Start-Process -wait -FilePath "C:\cygwin64\bin\bash" -ArgumentList "--login -i -
Start-Process -wait -FilePath "C:\cygwin64\bin\bash" -ArgumentList "--login -i -c 'ln -sf /usr/bin/pip3.7 /usr/bin/pip'"
Write-Output "Downloading extra Python packages (5/8)"
Start-Process -wait -FilePath "C:\cygwin64\bin\bash" -ArgumentList "--login -i -c 'pip install empy pyserial pymavlink intelhex dronecan pexpect'"
Start-Process -wait -FilePath "C:\cygwin64\bin\bash" -ArgumentList "--login -i -c 'pip install empy==3.3.4 pyserial pymavlink intelhex dronecan pexpect'"
Write-Output "Downloading APM source (6/8)"
Copy-Item "APM_install.sh" -Destination "C:\cygwin64\home"

View File

@ -19,7 +19,7 @@ Start-Process -wait -FilePath "C:\cygwin64\bin\bash" -ArgumentList "--login -i -
Start-Process -wait -FilePath "C:\cygwin64\bin\bash" -ArgumentList "--login -i -c 'ln -sf /usr/bin/pip3.7 /usr/bin/pip'"
Write-Output "Downloading extra Python packages (5/7)"
Start-Process -wait -FilePath "C:\cygwin64\bin\bash" -ArgumentList "--login -i -c 'pip install empy pyserial pymavlink intelhex dronecan pexpect'"
Start-Process -wait -FilePath "C:\cygwin64\bin\bash" -ArgumentList "--login -i -c 'pip install empy==3.3.4 pyserial pymavlink intelhex dronecan pexpect'"
Write-Output "Installing ARM GCC Compiler 10-2020-Q4-Major (6/7)"
& $PSScriptRoot\gcc-arm-none-eabi-10-2020-q4-major-win32.exe /S /P /R

View File

@ -35,16 +35,27 @@ else:
running_python3 = True
def topdir():
'''return path to ardupilot checkout directory. This is to cope with
running on developer's machines (where autotest is typically
invoked from the root directory), and on the autotest server where
it is invoked in the checkout's parent directory.
'''
for path in [
os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", ".."),
"",
]:
if os.path.exists(os.path.join(path, "libraries", "AP_HAL_ChibiOS")):
return path
raise Exception("Unable to find ardupilot checkout dir")
def is_chibios_build(board):
'''see if a board is using HAL_ChibiOS'''
# cope with both running from Tools/scripts or running from cwd
hwdef_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "libraries", "AP_HAL_ChibiOS", "hwdef")
if os.path.exists(os.path.join(hwdef_dir, board, "hwdef.dat")):
return True
hwdef_dir = os.path.join("libraries", "AP_HAL_ChibiOS", "hwdef")
if os.path.exists(os.path.join(hwdef_dir, board, "hwdef.dat")):
return True
return False
hwdef_dir = os.path.join(topdir(), "libraries", "AP_HAL_ChibiOS", "hwdef")
return os.path.exists(os.path.join(hwdef_dir, board, "hwdef.dat"))
def get_required_compiler(vehicle, tag, board):
@ -491,6 +502,20 @@ is bob we will attempt to checkout bob-AVR'''
files_to_copy.append((filepath, os.path.basename(filepath)))
if not os.path.exists(bare_path):
raise Exception("No elf file?!")
# attempt to run an extract_features.py to create features.txt:
features_text = None
ef_path = os.path.join(topdir(), "Tools", "scripts", "extract_features.py")
if os.path.exists(ef_path):
try:
features_text = self.run_program("EF", [ef_path, bare_path], show_output=False)
except Exception as e:
self.print_exception_caught(e)
self.progress("Failed to extract features")
pass
else:
self.progress("Not extracting features as (%s) does not exist" % (ef_path,))
# only rename the elf if we have have other files to
# copy. So linux gets "arducopter" and stm32 gets
# "arducopter.elf"
@ -512,6 +537,9 @@ is bob we will attempt to checkout bob-AVR'''
if not os.path.exists(ddir):
self.mkpath(ddir)
self.addfwversion(ddir, vehicle)
features_filepath = os.path.join(ddir, "features.txt",)
self.progress("Writing (%s)" % features_filepath)
self.write_string_to_filepath(features_text, features_filepath)
self.progress("Copying %s to %s" % (path, ddir,))
shutil.copy(path, os.path.join(ddir, target_filename))
# the most recent build of every tag is kept around:
@ -521,10 +549,13 @@ is bob we will attempt to checkout bob-AVR'''
# must addfwversion even if path already
# exists as we re-use the "beta" directories
self.addfwversion(tdir, vehicle)
features_filepath = os.path.join(tdir, "features.txt")
self.progress("Writing (%s)" % features_filepath)
self.write_string_to_filepath(features_text, features_filepath)
shutil.copy(path, os.path.join(tdir, target_filename))
except Exception as e:
self.print_exception_caught(e)
self.progress("Failed to copy %s to %s: %s" % (path, ddir, str(e)))
self.progress("Failed to copy %s to %s: %s" % (path, tdir, str(e)))
# why is touching this important? -pb20170816
self.touch_filepath(os.path.join(self.binaries,
vehicle_binaries_subdir, tag))

View File

@ -366,7 +366,7 @@ for t in $CI_BUILD_TARGET; do
echo "Building signed firmwares"
sudo apt-get update
sudo apt-get install -y python3-dev
python3 -m pip install pymonocypher
python3 -m pip install pymonocypher==3.1.3.2
./Tools/scripts/signing/generate_keys.py testkey
$waf configure --board CubeOrange-ODID --signed-fw --private-key testkey_private_key.dat
$waf copter

Some files were not shown because too many files have changed in this diff Show More