Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_Mount: implement user defined angle limits (especially for Siyi) #24011

Merged
merged 2 commits into from
Jun 13, 2023

Conversation

rmackay9
Copy link
Contributor

@rmackay9 rmackay9 commented Jun 8, 2023

This resolves #13815, partially resolves issue #21547 and should also fix the Siyi A8 ROI problem reported by @kellyschrock (see the Copter-4.4 issues list).

The changes include:

  1. AP_Mount::set_angle_targets() limits the roll, pitch and (sometimes) yaw angles to be sure they are within the user defined limits (e.g. MNT1_ROLL_MIN/MAX, MNT1_PITCH_MIN/MAX, MNT1_YAW_MIN/MAX). Note that yaw is only checked when it is in body-frame. We sadly cannot limit the yaw when it is defined in earth-frame at the moment it is received because the yaw of the vehicle will likely change over time. Instead the individual backends must enforce earth-frame yaw limits.
  2. AP_Mount_Siyi enforces the earth-frame yaw limit just before it sends the latest rate control command to the gimbal. Somewhat interestingly we also need to change the lock/follow (aka earth-frame/body-frame) setting sent to the gimbal to body-frame (aka follow) or the gimbal itself will stop controlling its attitude if it is rotated over 180degrees. This seems to me to be a bug within the Siyi gimbals themselves.

This has been bench tested on both a Siyi ZR10 and Siyi A8. Tests included:

  1. Using the MP Payload Control screen to pass roll, pitch and yaw angles to the vehicle. Out-of-range angles were sent but the gimbal only moved to its limits. Note: before and after tests were performed to confirm there was an issue before but not after.
  2. Using MP's Data screen's, "Point Camera Here" feature the gimbal was pointed at a location, The vehicle was then rotated 360 degrees and I confirmed it yawed as closely as possible to the target but stayed within its body-frame limits.

The user discussion is here.

This has been successfully tested by KellyS on a real vehicle (facebook link)

@rmackay9 rmackay9 added the BUG label Jun 8, 2023
@rmackay9 rmackay9 mentioned this pull request Jun 8, 2023
48 tasks
@tridge tridge merged commit 65fd8a7 into ArduPilot:master Jun 13, 2023
@rmackay9 rmackay9 deleted the mount-angle-limit-fix branch June 13, 2023 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AP_Mount: checking min/max angular position of mount
3 participants