-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
camera: adding subscription APIs #426
Conversation
e773e75
to
6d354ef
Compare
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.
Looks like good progress!
Is it right to say that the camera mode is advertised by the camera, but the video stream info is not, so the plugin will have to poll it while a callback is registered?
plugins/camera/camera_impl.cpp
Outdated
void CameraImpl::subscribe_video_stream_info( | ||
const Camera::subscribe_video_stream_info_callback_t callback) | ||
{ | ||
// FIXME: This will only work if you also send a request to get the video stream info, |
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.
You mean it should call get_video_stream_info
repeatedly when a callback is registered, right? How difficult is it to implement?
Because the frontend should not have to poll at all, right?
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.
Correct, we just have to do a call_every
, not that hard 😄
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 just haven't ever used the streaming API and there are no tests, so I didn't bother.
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.
Done but untested.
I think right now it is not advertised as such. It's just when you set it you also receive the feedback and use that. We potentially could add polling the mode as well in order to see changes made by e.g. QGroundControl. |
4f30e63
to
b929346
Compare
But if QGC sets the mode, won't the camera advertise it? Anyway it's fine for now. |
It could/should advertise it using: http://mavlink.org/messages/common#CAMERA_SETTINGS. We probably need to add that to E90. |
This adds the possibility to subscribe to the camera mode.
This adds an API to subscribe to the video stream info, however, this is currently not really implemented and tested.
The name subscribe_capture_info matches the other subscription methods.
This adds the method to subscribe to the camera status and also adds polling for the status at 1 Hz.
This adds an async getter for the video stream info and uses it in the sync version using std::future/promise. Also, this adds polling to the video stream info. Note that there are currently no integration tests for this, so this is untested.
b929346
to
6453c1f
Compare
This adds a subscription method for the current options. It should trigger whenever a setting is updated.
6453c1f
to
e57f488
Compare
This adds an API to subscribe to all possible options that could currently be selected.
@JonasVautherin this should be complete but I'm not happy with the naming yet. Currently it's all |
Currently we have:
We could refactor that to:
@JonasVautherin what do you think? |
I like your proposition. I would suggest |
Ok, I'll refactor it. |
This should make the API easier by using structs as types. Some of the getters and setters could still be improved by using the struct types instead of the std::strings.
efbb427
to
e19e548
Compare
camera: adding subscription APIs
This PR adds missing camera subscription APIs:
Connects to #334.