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.
Solved Problem
The camera triggering logic is currently "random" when more than one camera sending a mavlink heartbeat is connected to PX4. The trigger logic in PX4 currently stores the last camera mavlink component ID it saw a heartbeat from, and then sends trigger commands to that camera. If there are multiple cameras sending heartbeats, it is more or less random which camera gets triggered when a capture command is sent to PX4. This includes missions that have capture waypoints, or surveys that capture a photo periodically.
Solution
This PR changes the behaviour such that always all mavlink cameras are triggered, making the photo capture process deterministic, which is the main improvement.
This changes nothing for systems that have only one camera, as it will still trigger this one camera.
The only scenario where PX4 users would be negatively affected by this change, is if somebody were to use a camera that understands mavlink, receives mavlink messages, but does not send out its own heartbeat and is therefore invisible to PX4. Before this PR, such an invisible camera would not get triggered. After this PR it will. This is a very hypothetical scenario which I hope does not exist in reality. It would also be non-compliant with the mavlink protocol to have a component participate in the mavlink network without sending its own heartbeat.
Changelog Entry
For release notes:
Bugfix: When multiple mavlink cameras are present, they will now all be triggered by PX4
Test coverage
Tested on real hardware