Skip to content

AP_Mount: Viewpro converts angles to output using radians directly - #33504

Merged
rmackay9 merged 1 commit into
ArduPilot:masterfrom
peterbarker:pr-claude/viewpro-angle-rad-deg-thing
Aug 12, 2026
Merged

AP_Mount: Viewpro converts angles to output using radians directly#33504
rmackay9 merged 1 commit into
ArduPilot:masterfrom
peterbarker:pr-claude/viewpro-angle-rad-deg-thing

Conversation

@peterbarker

Copy link
Copy Markdown
Contributor

Summary

Tidies up ViewPro sending my eliminating degrees intermediates.

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

Tortured a bit locally by making sure we run through these checks, breaking the calculation and fixing it again.

Board,copter
CubeOrangePlus,-48

These paths are well cross by the autotest suite.

Description

Add AP_MOUNT_VIEWPRO_RAD_TO_OUTPUT and use it for the target pitch/yaw angles and for the vehicle attitude sent in the M_AHRS packet, taking the values from the AHRS in radians rather than degrees. This removes the intermediate radians-to-degrees conversions and the now-unused AP_MOUNT_VIEWPRO_DEG_TO_OUTPUT scalar.

Fixes a very small issue where we would truncate the vehicle yaw to integer degrees before multiplying it again to scale it to put in the packet.

Add AP_MOUNT_VIEWPRO_RAD_TO_OUTPUT and use it for the target pitch/yaw
angles and for the vehicle attitude sent in the M_AHRS packet, taking
the values from the AHRS in radians rather than degrees.  This removes
the intermediate radians-to-degrees conversions and the now-unused
AP_MOUNT_VIEWPRO_DEG_TO_OUTPUT scalar.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rmackay9 rmackay9 added the BUG label Aug 12, 2026
@rmackay9
rmackay9 merged commit 96abd65 into ArduPilot:master Aug 12, 2026
103 checks passed
@github-project-automation github-project-automation Bot moved this from ReadyForDevCall to Done in Peter's ArduPilot 4.8 Queue Aug 12, 2026
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.

3 participants