autotest: allow a wider pitch tolerance in mount_test_body() - #34160
Merged
peterbarker merged 1 commit intoAug 25, 2026
Conversation
test_mount_rc_targetting() and mount_test_body() hardcoded a 0.1deg pitch tolerance for the RC-targeting checks. Threads a pitch_tolerance / rc_targetting_pitch_tolerance parameter through both instead (default 0.1deg, unchanged for every existing caller), so a backend whose actuator has a coarser confirmed physical resolution - e.g. a rate-only actuator closing an angle loop via a quantized speed command - can pass a wider, measurement-backed value instead of failing a tolerance the hardware cannot physically meet. Split out of the SkyDroid gimbal driver PR (ArduPilot#34155) at Peter Barker's review suggestion - this parameter is generically useful and doesn't depend on anything SkyDroid-specific.
9 tasks
peterbarker
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_mount_rc_targetting() and mount_test_body() hardcoded a 0.1deg pitch tolerance for the RC-targeting checks. Threads a pitch_tolerance / rc_targetting_pitch_tolerance parameter through both instead (default 0.1deg, unchanged for every existing caller), so a backend whose actuator has a coarser confirmed physical resolution - e.g. a rate-only actuator closing an angle loop via a quantized speed command - can pass a wider, measurement-backed value instead of failing a tolerance the hardware cannot physically meet.
Split out of the SkyDroid gimbal driver PR (#34155) at Peter Barker's review suggestion - this parameter is generically useful and doesn't depend on anything SkyDroid-specific.
Summary
Makes the pitch tolerance used by the shared mount RC-targeting autotest a parameter instead of a hardcoded
0.1deg, unchanged by default.Classification & Testing (check all that apply and add your own)
No test yet passes a non-default tolerance — that lands with #34155, the first real consumer. Ran the existing
MountTopotekautotest (an unrelated backend, so exercises the unchanged0.1degdefault through the new parameter's plumbing) — passes clean, confirming this is behaviour-preserving for every existing caller.Description
test_mount_rc_targetting()andmount_test_body()hardcoded a0.1degtolerance on every pitch check in the RC-targeting test. That's fine for backends whose actuator can actually place an angle that precisely, but not every backend can: a rate-only actuator that closes an angle loop by sending a quantized speed command has a real physical floor below which a commanded correction rounds to zero, and that floor can be coarser than0.1deg.Adds a
pitch_toleranceparameter totest_mount_rc_targetting()and arc_targetting_pitch_toleranceparameter tomount_test_body()(threaded through to the former), both defaulting to the existing0.1deg— no behaviour change for any current caller. A backend with a coarser, measurement-backed actuator resolution can now pass a wider value instead of either failing a tolerance the hardware can't physically meet, or the test being loosened for every backend.Split out of #34155 (a new SkyDroid gimbal driver) at Peter Barker's suggestion that this parameter is generically useful on its own. That PR will rebase on top of this once merged, and will be the first real consumer passing a non-default value.
This PR was developed with AI assistance (Claude). All changes have been reviewed and tested by me, but not independently, only as part of #34155