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: In Siyi, add handler for CAMERA_CAPTURE_STATUS request #25496

Conversation

nexton-winjeel
Copy link
Contributor

Following #24953, this PR adds support for the CAMERA_CAPTURE_STATUS message to the Siyi driver.

Tested on Siyi A8.

Copy link
Contributor

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nexton-winjeel, thanks very much for this PR. I think we should try to avoid this subtraction which could confuse a ground station. It's a bit tricky but basically we need to add another way for feedback to arrive besides the existing GPIO trigger pin. I thought about this a fair bit recently because I was going to add support for the feedback to arrive via DroneCAN but in the end, I found the Xacti supports the GPIO trigger pin for feedback so it was not necessary.

@nexton-winjeel
Copy link
Contributor Author

@rmackay9:

I think we should try to avoid this subtraction which could confuse a ground station. It's a bit tricky but basically we need to add another way for feedback to arrive besides the existing GPIO trigger pin.

Sorry, I don't understand what you mean. Can you please provide a bit more detail?

@rmackay9
Copy link
Contributor

rmackay9 commented Nov 11, 2023

@nexton-winjeel,

A key issue with this change is that while we can correct the total number of images taken, the CAM log message will have already been written. This will lead to multiple CAM messages with the same image number so if users then try to geotag the images (e.g. save EXIF lat,lon,alt into the image file) using MP, it likely won't work.

To properly handle the Siyi cameras, we shouldn't log the CAM message nor report to the GCS that a picture has been taken until we get a positive ACK back from the camera. Do you know if we receive a Function Feedback Information message (with "info_type" = 0 when we successfully take a picture? I know we receive a message when it fails to take a picture but that's not sufficient. I also wonder if we can be sure that this function-feedback-information message is the result of a take-picture request or if we will also receive one in response to a zoom command. We may need to ask Siyi to send more specific ACK and ideally include the total number of pictures taken within that ACK.

@nexton-winjeel
Copy link
Contributor Author

OK, I understand. This isn't touching the image_count in the backend, it's keeping it's own internal counter. So the CAM log message will be OK, but it will be inconsistent with the CAMERA_CAPTURE_STATUS message sent by the Siyi.

As far as I'm aware, the Siyi doesn't report a successful snapshot, but I haven't looked at their recent updates. You're right, the FUNCTION_FEEDBACK_INFO message might be in response to another message.

I'll move this back to draft state and look at it again when I get back to Siyi development.

@nexton-winjeel nexton-winjeel marked this pull request as draft November 14, 2023 22:01
@rmackay9
Copy link
Contributor

Hi @nexton-winjeel, I've chatted with Siyi and they say that the FUNCTION_FEEDBACK_INFO message's 0/success response will only be sent when a picture is successfully taken. So this means we could use it to log the CAM message, increment the image_count, etc. I don't think we should maintain two separate image counts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants