Commit Graph
72819 Commits
Author SHA1 Message Date
Randy Mackay 379f53efef AP_BattMonitor: TIBQ loses state-of-health-pct 2026-07-21 09:38:06 +09:00
Randy MackayandHuibean c22c35f2ad AP_BattMonitor: TIBQ supports sleep
Co-authored-by: Huibean <huibean.luo@gmail.com>
2026-07-21 09:38:06 +09:00
HuibeanandRandy Mackay 138c60cce0 AP_BattMonitor: improve TIBQ health monitoring
Co-authored-by: Randy Mackay <rmackay9@yahoo.com>
2026-07-21 09:38:06 +09:00
Randy MackayandHuibean 77e2140827 AP_BattMonitor: TIBQ fix for reading voltage and current
also fixes current reporting during charging

Co-authored-by: Huibean <huibean.luo@gmail.com>
2026-07-21 09:38:06 +09:00
Randy Mackay 9a73a76e5a AP_BattMonitor: TIBQ loses unused definition 2026-07-21 09:38:06 +09:00
Randy MackayandHuibean 68c60a6e28 AP_BattMonitor: TIBQ charge state detection fixes
Co-authored-by: Huibean <huibean.luo@gmail.com>
2026-07-21 09:38:06 +09:00
HuibeanandRandy Mackay 1ac2004785 AP_BattMonitor: TIBQ startup FET setting fix
Co-authored-by: Randy Mackay <rmackay9@yahoo.com>
2026-07-21 09:38:06 +09:00
HuibeanandRandy Mackay 31c60df961 AP_BattMonitor: TIBQ gets current and capacity gain
Co-authored-by: Randy Mackay <rmackay9@yahoo.com>
2026-07-21 09:38:06 +09:00
HuibeanandRandy Mackay 54b0fef23e AP_BattMonitor: TIBQ protections changes
Co-authored-by: Randy Mackay <rmackay9@yahoo.com>
2026-07-21 09:38:06 +09:00
HuibeanandRandy Mackay be7f268c26 AP_BattMonitor: TIBQ crc fix
Co-authored-by: Randy Mackay <rmackay9@yahoo.com>
2026-07-21 09:38:06 +09:00
HuibeanandRandy Mackay 7c3cc1a8e3 AP_BattMonitor: TIBQ gets CFG_UPDATE param
Co-authored-by: Randy Mackay <rmackay9@yahoo.com>
2026-07-21 09:38:06 +09:00
HuibeanandRandy Mackay ad8f5f5ede AP_BattMonitor: TIBQ regulator config changes
Co-authored-by: Randy Mackay <rmackay9@yahoo.com>
2026-07-21 09:38:06 +09:00
Peter Barker 0ba8b919bf autotest: dive in ALT_HOLD mode in GuidedWP
requested on PR review
2026-07-21 10:32:20 +10:00
Peter BarkerandClaude Fable 5 0a69cbb7c0 autotest: resend Sub GuidedWP target until the vehicle accepts it
The vehicle can silently reject a SET_POSITION_TARGET_GLOBAL_INT - the
synthetic seafloor simulation deliberately injects low-signal-quality
rangefinder outliers, and one of those landing in the wrong ~50ms makes
the terrain frame momentarily invalid, failing the frame conversion in
wp_nav.  There is no acknowledgement for the message, so the test sailed
on oblivious and timed out 80 seconds later ("Frame 10 took too long to
reach the destination", seen in CI).

Send the target until NAV_CONTROLLER_OUTPUT.wp_dist shows it has become
wp_nav's current destination.  The distance report is used rather than
the POSITION_TARGET_GLOBAL_INT echo because the latter is never emitted
for terrain-altitude destinations on Sub (the alt cannot be converted
to AMSL without a terrain database).  Blindly streaming the target is
also no good; each resend of an identical target re-initialises the
wpnav leg from a stopping point, slowing the vehicle enough to miss the
test's timeout.

The leg timer now starts only once the target is accepted, and the
message-rate request is made before the dive as there is no depth hold
between the dive and GUIDED, so sim time spent there is spent floating
back up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 10:32:20 +10:00
Pierre Kancir 20b4dc79a1 .github: add missing s to Tools/CHDK-Script/** 2026-07-21 10:32:03 +10:00
Huibean 5e4815bb09 AP_HAL_ChibiOS: Fix missing CAN3 2026-07-21 09:23:15 +10:00
Peter BarkerandClaude Fable 5 7d22e6d2b1 Tools: pace sitl_calibration magcal poses in simulation time
MagcalController advanced calibration poses using wall-clock timers
(time.time()): 24 wall-seconds maximum dwell per pose and 4
wall-seconds of unchanged-progress before rotating.  The vehicle
rotation and the calibrator's sample consumption are both simulation
time, so at SITL speedup the sphere coverage for a pose completes in a
fraction of a wall second and the controller then sat idle for the
rest of the wall-clock dwell.  This made SITLCompassCalibration the
second most expensive test in CI at ~370 wall-seconds.

Clock the controller from ATTITUDE.time_boot_ms instead so every
quantity in the controller is in the simulation time domain; the
existing constants keep their values, now correctly denominated in
simulation seconds (a full turn at pi/4 rad/s genuinely takes 8
simulation seconds).  Locally the test drops from ~370 to ~80-90
seconds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 08:38:06 +10:00
Peter Barker ac88e88a2c GCS_MAVLink: correct nesting of #if/#endif
would have broken loweheiser if accelcal was disabled
2026-07-21 08:37:28 +10:00
Peter Barker ed75cc88fe autotest: adjust flakey RotorRunup test
need to take runup timestamp before we send the interlock change otherwise we really can go before the timer has run for long enough to pass the TARGET_RUNUP_TIME
2026-07-21 08:36:01 +10:00
Peter BarkerandClaude Fable 5 3e7535e7b5 autotest: raise Soaring throttle-down timeout to 5 seconds
The throttle deterministically takes 2.4-2.6s of sim time to slew down
from its saturated 2000us (THR_SLEWRATE 100%/s) after soaring is
re-enabled, so the 3s timeout left almost no margin and flaked on
loaded CI machines.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 08:35:09 +10:00
Peter Barker aa54a96f30 AP_GPS: rename a local variable to not mislead
this variable is critical for determining GPS health
2026-07-21 08:34:33 +10:00
Peter Barker 483386fdfd Tools: add CI check that changed source files keep their trailing newline
Some editors strip the final newline by default, which shows up as
"No newline at end of file" noise in GitHub review.  Fail the branch
conventions check when a PR adds a source file without a trailing
newline or removes one from a file which had it.  Pre-existing
violations do not block unrelated edits.
2026-07-21 08:32:28 +10:00
Peter BarkerandClaude Fable 5 25acd1a7c1 autotest: collect STATUSTEXT before reboot in Sub BackupOrigin
With no GPS configured the EKF adopts the recorded origin early in
the boot, so 'AHRS: using recorded origin' can be emitted while the
test framework is still waiting for the reboot to complete - before
the test started collecting statustexts - and the wait for it then
times out.  Timing changes in the preceding logging tests exposed
the race in CI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 08:29:31 +10:00
Peter BarkerandClaude Opus 4.8 4d999892d2 autotest: adjust hardcoded mavlink port in Rover tests
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 08:28:40 +10:00
Peter BarkerandClaude Opus 4.8 2304801fa9 autotest: use an instance-aware telemetry port in Sub MAV_mgs test
MAV_mgs connected to a hard-coded "tcp:localhost:5763".  SITL offsets its
serial/telemetry TCP ports by 10*instance, so this only worked at instance
0; at any non-zero instance (parallel worker or "-I N") the connection was
refused.  Use self.adjust_ardupilot_port(5763) instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-21 08:28:40 +10:00
Peter BarkerandClaude Fable 5 11c7b4bb37 autotest: end home-circle avoidance test with forced reboot
pre-commit / ci (push) Canceled after 0s
test scripts / build (astyle-cleanliness) (push) Canceled after 0s
test scripts / build (check_autotest_options) (push) Canceled after 0s
test scripts / build (logger_metadata) (push) Canceled after 0s
test scripts / build (param-file-validation) (push) Canceled after 0s
test scripts / build (param_parse) (push) Canceled after 0s
test scripts / build (python-cleanliness) (push) Canceled after 0s
test scripts / build (shellcheck) (push) Canceled after 0s
test scripts / build (validate_board_list) (push) Canceled after 0s
HomeCircleInclusionFence_Avoidance_SetHome sets speedup 1 for its
RC-driven avoidance holds and never restored it, so the whole RTL
descent also ran in real time, roughly 35 wall-seconds proving
nothing the test had not already proven.  End the test with a forced
reboot instead: set_home requires a post-test reboot anyway, and
speedup restoration happens at the usual context teardown.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 21:15:35 +10:00
Peter BarkerandClaude Fable 5 58c7c95e32 autotest: use short timeouts for expected-absent GPS in CANGPSCopterMission
Each GPS-ordering case waited the full default timeout for the
detection statustext of a GPS deliberately configured absent, at
SIM_SPEEDUP 2.  Both detection statustexts are emitted together
shortly after boot, so wait for expected-present GPSs first (absorbing
boot latency) and confirm expected-absent ones with a short timeout
from the already-collected context.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 21:15:35 +10:00
Peter BarkerandClaude Fable 5 351e641d0a autotest: arm GCS failsafe after climb in ThrottleFailsafe subtest
The continue-in-guided subtest enabled GCS failsafe (which drops
SIM_SPEEDUP to 4) before takeoffAndMoveAway, so the whole climb ran
slowly.  The failsafe only needs to be armed before SIM_RC_FAIL is
raised, so enable it after the climb.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 21:15:35 +10:00
Peter BarkerandClaude Fable 5 2906c41549 autotest: fold DoRepositionTerrain settle delays into condition waits
The flat 'terrain altitude to settle' delays immediately preceded a
wait_altitude with minimum_duration=10, which already proves settled
terrain-relative altitude.  Remove the flat delays and grow the wait
timeouts by the same amount so the total allowance is unchanged and
the wait exits as soon as altitude has genuinely settled.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 21:15:35 +10:00
Peter BarkerandClaude Fable 5 585f13e9d5 autotest: drop redundant reboot between AHRSTrim backends
The reboot after each ExternalAHRS backend's context_pop() only
existed to apply the restored parameters, but the next backend's
customise_SITL_commandline (or the non-ExternalAHRS section's initial
reboot) restarts SITL anyway.  Eight SITL restarts saved per AHRSTrim
run.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 21:15:35 +10:00
Peter BarkerandClaude Fable 5 bef36ca03f autotest: restore full speedup when GCS failsafe is disabled
setGCSfailsafe(0) hardcoded SIM_SPEEDUP 10 rather than restoring the
suite default (100 for Copter, 30 for Rover), so every test phase
following a disable ran slower than necessary.  The wall-paced GCS
heartbeat coupling that justifies a reduced speedup only exists while
FS_GCS_ENABLE is set.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 21:15:35 +10:00
Peter BarkerandClaude Fable 5 6aa29ebc9f autotest: run BatteryFailsafe at default speedup
BatteryFailsafe pins SIM_SPEEDUP to 4 for its entire duration, making
it the fourth most expensive test in all of CI at ~320 wall-seconds
per run.  The override has been carried through several refactors with
no recorded rationale; the original 2013 test did not set it.

Battery failsafe timing is entirely simulation-time: the voltage comes
from SIM_BATT_VOLTAGE and BATT_LOW_TIMER counts simulation seconds, so
there is no wall-clock coupling that would require a reduced speedup
(unlike the GCS failsafe tests, where the test framework's wall-paced
heartbeats justify one).  Remove the override so the test runs at the
suite default.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 21:14:37 +10:00
Andrew Tridgell b7ba8bca02 AP_Scripting: added actuator (ESC/Servo) chirp tool
used for measuring response bandwidth of a servo or ESC
2026-07-19 10:51:28 +10:00
Bob Long f762235f6c Tools: inline annotations for location ratchet
pre-commit / ci (push) Canceled after 0s
test scripts / build (astyle-cleanliness) (push) Canceled after 0s
test scripts / build (check_autotest_options) (push) Canceled after 0s
test scripts / build (logger_metadata) (push) Canceled after 0s
test scripts / build (param-file-validation) (push) Canceled after 0s
test scripts / build (param_parse) (push) Canceled after 0s
test scripts / build (python-cleanliness) (push) Canceled after 0s
test scripts / build (shellcheck) (push) Canceled after 0s
test scripts / build (validate_board_list) (push) Canceled after 0s
2026-07-18 20:17:19 +10:00
Bob Long 50b9ab2106 .github: checkout merge ref for location ratchet 2026-07-18 20:17:19 +10:00
Bob Long 8bcc567f00 autotest: remove unused wait_location_sending_target
Never called in recorded history; it predates the apmrover2.py to
rover.py rename.
2026-07-18 17:57:09 +10:00
Bob Long 2baffc1403 autotest: use frame-aware Location in Rover tests
Current-position reads become get_location().  wait_location()
targets keep their original explicit altitudes, now tagged ABSOLUTE,
so the vertical check behaviour is untouched; locations whose
altitude was never consumed (fence corners, stopping-point distance
checks) become Location.latlon_only().  One line of commented-out
code is removed rather than converted.

Tests which do not currently run (gated-off or in disabled_tests) are
left untouched, as conversions there cannot be regression-tested.
2026-07-18 17:57:09 +10:00
Bob Long 81c21c0d0e autotest: wait for valid position in get_location
The vehicle reports zero lat/lng until it has a position estimate,
and several tests sample their position before any readiness wait.
mav.location() blocked indefinitely for a 3D fix with non-zero latitude
via wait_gps_fix(); match that contract, but bounded by a timeout and
raising a named exception instead of hanging until the test watchdog
fires.
2026-07-18 17:57:09 +10:00
Bob Long 8f2e5db2ef .github: test_location_ratchet to ubuntu-slim
pre-commit / ci (push) Canceled after 0s
test scripts / build (astyle-cleanliness) (push) Canceled after 0s
test scripts / build (check_autotest_options) (push) Canceled after 0s
test scripts / build (logger_metadata) (push) Canceled after 0s
test scripts / build (param-file-validation) (push) Canceled after 0s
test scripts / build (param_parse) (push) Canceled after 0s
test scripts / build (python-cleanliness) (push) Canceled after 0s
test scripts / build (shellcheck) (push) Canceled after 0s
test scripts / build (validate_board_list) (push) Canceled after 0s
2026-07-17 21:35:56 +10:00
Iampete1 6a2094649a SITL: FlightAxis: interpolate_frame add check for zero dt 2026-07-17 21:20:31 +10:00
Bob Long b6c1661c05 .github: add mavutil.location ratchet check 2026-07-17 17:45:04 +10:00
Bob Long 97ef31cc0f Tools: add mavutil.location ratchet script
This ensures no PR adds new references to the frameless mavutil.location
while we work to phase it out of autotest completely.
2026-07-17 17:45:04 +10:00
Bob Long d976d71e99 autotest: add frame-aware Location class
mavutil.location has no altitude frame field; its alt is AMSL only by
convention and the suite routinely stuffs relative-to-home and terrain
altitudes into it, leading to silent frame-mixing bugs.

Add a Location class mirroring AP_Common's Location: meters altitude
tagged with an AltFrame (ABSOLUTE/ABOVE_HOME/ABOVE_ORIGIN/
ABOVE_TERRAIN). It deliberately has no alt attribute. Altitude is
only reachable via get_alt_m(frame), and asking in the wrong frame is
an error, not a conversion: code that assumes a frame fails loudly
instead of silently misreading the altitude. Converting is its own
explicit step, TestSuite.change_alt_frame(), which polls home, origin
or terrain data from the vehicle as required.
2026-07-17 17:45:04 +10:00
Bob Long b87ef45c0b autotest: remove unused add_rally_point
Added in 823a917ae1 alongside send_do_reposition for the TerrainRally
test, but no commit has ever called it.
2026-07-17 17:45:04 +10:00
Bob Long 79689f6881 autotest: fix alt unit in WaitAndMaintainLocation
The effective default tolerance was accidentally 100m instead of 1m.
Fixing that broke several tests, which needed their target location
altitudes specified correctly or the altitude check disabled
2026-07-17 12:11:41 +10:00
Leonard Hall e7805549c5 Replay: copy only the logged bytes in MSG_CREATE
The logged length of a replay message is offsetof(_end), which
excludes any tail padding in the in-memory struct, so copying
sizeof(msg) read up to 4 bytes past the end of the log record buffer
(a stack-buffer-overflow under AddressSanitizer for RGPI, RGPJ and
RGPK records). Copy the logged length so the padding is deterministic.
2026-07-16 18:22:28 +10:00
LiuYongNan 73c065ec26 AP_Bootloader: reserve NewBeeDrone PixNova board ID 2026-07-16 18:14:12 +10:00
Bob Long 8bb2f743d2 autotest: fix takeoff alt margin in FenceRetRally
We sometimes pass 60m before the fence floor can be set to 60
2026-07-16 14:58:11 +10:00
Bob Long 47c7d5c174 autotest: fix rally uploader
Disabling TerrainRally test, as it has long been broken in a way that
guaranteed passing, and this fix might negatively impact it.
2026-07-16 14:58:11 +10:00
zhoujinhua dc38dfb84d AP_Bootloader: reserve board IDs for CoreWing boards
Reserve IDs 7130-7139 for CoreWing, and add board IDs for
CoreWingF405WingV2 (7130) and CoreWingF405WMiniV2 (7131).
2026-07-16 11:05:17 +10:00