Skip to content

AP_Mount: use new GIMBAL_DEVICE_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL#32423

Merged
peterbarker merged 2 commits intoArduPilot:masterfrom
peterbarker:pr/duplicate-gimbal-flags
Mar 27, 2026
Merged

AP_Mount: use new GIMBAL_DEVICE_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL#32423
peterbarker merged 2 commits intoArduPilot:masterfrom
peterbarker:pr/duplicate-gimbal-flags

Conversation

@peterbarker
Copy link
Copy Markdown
Contributor

Summary

we had a temporary hack in place for the AVT gimbals to use. Replace with the standardised bit

Testing (more checks increases chance of being merged)

  • Checked by a human programmer
  • Tested in SITL
  • Tested on hardware
  • Logs attached
  • Logs available on request
  • Autotest included

Description

We had a temporary hack in place while we got the MAVLink side of things sorted (added in #32162)

We now have the bit thanks to @julianoes work.

@KSimeonAVTA - we now have a bit which can replace the hack. I've put a comment in that we should remove the hack in ArduPilot 4.9, which I'm hoping is plenty of time for the AVT firmware to start to use the bit. Open to debate.

This does actually point an interesting thing out. Assuming the AVT gimbal has its own positioning system (e.g. a GPS), sometimes the gimbal will not be able to point in the global frame (e.g. GPS has no fix) when the vehicle might know where it is and be able to direct the gimbal with angles. How do we represent this? Should the gimbal only report "can point in the global frame" when it can actually do that, or always on the assumption that at some stage it will be able to? ArduPilot will absolutely handle the updating of the gimbal's capabilities, so I would strongly suggest the AVT gimbals not report ability to point to lat/lng/alt until they can do that (e.g. GPS lock). When they get a fix their GIMBAL_DEVICE_INFORMATION message should start to reflect the capability. @hamishwillee @julianoes

I don't currently have the means to test this locally. I'll need to write some simulation stuff for it or something to test here.

Comment thread libraries/AP_Mount/AP_Mount_MAVLink.cpp Outdated
Comment thread libraries/AP_Mount/AP_Mount_MAVLink.h
@rmackay9
Copy link
Copy Markdown
Contributor

This looks pretty good to me. We don't need to know whether the capabilities flags are valid or not? We could differentiate based on whether we've received the mavlink message that holds the capability flags or not. Perhaps we have no need to know the difference though between invalid and no capabilities

@peterbarker peterbarker force-pushed the pr/duplicate-gimbal-flags branch from 8213562 to 2845b4e Compare March 12, 2026 03:33
@peterbarker
Copy link
Copy Markdown
Contributor Author

This looks pretty good to me. We don't need to know whether the capabilities flags are valid or not? We could differentiate based on whether we've received the mavlink message that holds the capability flags or not. Perhaps we have no need to know the difference though between invalid and no capabilities

We know the flags are valid if they are non-zero (per the spec). If they are zero then falling back to the original 16-bit field is correct. The bottom 16-bits in the new field must have the same value of the old field (by spec).

@peterbarker peterbarker force-pushed the pr/duplicate-gimbal-flags branch from 2845b4e to a59c867 Compare March 12, 2026 03:43
@KSimeonAVTA
Copy link
Copy Markdown
Contributor

KSimeonAVTA commented Mar 26, 2026

@peterbarker I have tested this PR changes with the temporary hack removed
and it is working using QGC daily build and AVT gimbal. I can ROI at location and point to home,

@peterbarker
Copy link
Copy Markdown
Contributor Author

Needs double-shuffle once the mavlink PR is merged

we had a temporary hack in place for the AVT gimbals to use.  Replace with the standardised bit
@peterbarker peterbarker force-pushed the pr/duplicate-gimbal-flags branch from 54c55c5 to 2195bd8 Compare March 27, 2026 02:17
@peterbarker
Copy link
Copy Markdown
Contributor Author

Needs double-shuffle once the mavlink PR is merged

Done

@peterbarker peterbarker merged commit 1b34668 into ArduPilot:master Mar 27, 2026
109 of 110 checks passed
@peterbarker
Copy link
Copy Markdown
Contributor Author

Merged this. Thanks for testing, @KSimeonAVTA !

@peterbarker peterbarker deleted the pr/duplicate-gimbal-flags branch March 30, 2026 00:06
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.

4 participants