Skip to content

autotest: allow a wider pitch tolerance in mount_test_body() - #34160

Merged
peterbarker merged 1 commit into
ArduPilot:masterfrom
timtuxworth:pr-mount-tolerance-param
Aug 25, 2026
Merged

autotest: allow a wider pitch tolerance in mount_test_body()#34160
peterbarker merged 1 commit into
ArduPilot:masterfrom
timtuxworth:pr-mount-tolerance-param

Conversation

@timtuxworth

@timtuxworth timtuxworth commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

No test yet passes a non-default tolerance — that lands with #34155, the first real consumer. Ran the existing MountTopotek autotest (an unrelated backend, so exercises the unchanged 0.1deg default through the new parameter's plumbing) — passes clean, confirming this is behaviour-preserving for every existing caller.

Description

test_mount_rc_targetting() and mount_test_body() hardcoded a 0.1deg tolerance 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 than 0.1deg.

Adds a pitch_tolerance parameter to test_mount_rc_targetting() and a rc_targetting_pitch_tolerance parameter to mount_test_body() (threaded through to the former), both defaulting to the existing 0.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

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.
@peterbarker
peterbarker merged commit df869f2 into ArduPilot:master Aug 25, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants