-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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_Camera, AP_Mount: Add handler for CAMERA_CAPTURE_STATUS request #24953
AP_Camera, AP_Mount: Add handler for CAMERA_CAPTURE_STATUS request #24953
Conversation
I have a second branch to add support for the |
// call each instance | ||
for (uint8_t instance = 0; instance < AP_CAMERA_MAX_INSTANCES; instance++) { | ||
if (_backends[instance] != nullptr) { | ||
_backends[instance]->send_camera_capture_status(chan); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've copied the way the other messages (e.g. CAMERA_SETTINGS
, CAMERA_INFORMATION
) are handled.
However, these handlers are problematic if there are multiple camera backends:
- these messages do not have IDs (MAVLink intent is to use
compid
to distinguish components); - however, all of these are sent with the
MAV_COMP_ID_AUTOPILOT1
compid
, which will confuse a GCS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised #24955.
f46c9d9
to
221f36d
Compare
221f36d
to
37e2611
Compare
37e2611
to
62f4ace
Compare
62f4ace
to
acc910b
Compare
@rmackay9: Anything else you need for this PR? |
// Image capture interval (s) | ||
const float image_interval = static_cast<float>(time_interval_settings.time_interval_ms) / 1000.0; | ||
// Total number of images captured | ||
const int32_t image_count = this->image_index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just a style thing but maybe we can get rid of some of these intermediate variables and just directly place them in the "camera_capture_status_send(" section below? Then put the comments beside each field. "image_status" is the only one that is complex enough to be worth breaking out I think.
mavlink_msg_camera_capture_status_send(
chan,
AP_HAL::millis(),
image_status,
0, // current state of video capturing (0: idle, 1: capture in progress)
time_interval_settings.time_interval_ms / 1000.0, // Image capture interval (s)
0, // time since recording started (ms)
NaN, // available storage capacity (MiB), NaN if unknown
image_index); // total number of images captured
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
// Image capture interval (s) | ||
const float image_interval = static_cast<float>(time_interval_settings.time_interval_ms) / 1000.0; | ||
// Total number of images captured | ||
const int32_t image_count = this->image_index; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In any case, no need the the, "this->" I think.
If you're happy making the mentioned style changes above then I think we can merge. You've tested this of course? I'm sure you have but just need to check. |
acc910b
to
cd7c20d
Compare
Yep, tested with a Siyi and QGC. I've got a follow-up branch that overrides |
@rmackay9: Re. the Siyi updates: It's a single commit -- do you want it in this PR, or a separate one? |
Either is fine with me but maybe a follow-up PR would be better so we can merge this now. |
Merged, thanks! |
QGroundControl uses the
CAMERA_CAPTURE_STATUS
message to update the camera control UI. This PR adds support for this message toAP_Camera
andAP_Mount
.FYI: @rmackay9, @peterbarker