-
-
Notifications
You must be signed in to change notification settings - Fork 511
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 plugin to implement MAVLink Camera Protocol client interface #292
Comments
I can add start, stop, captured image. |
|
PS and probably we should rename this "Camera plugin to interface MAVLink Camera Protocol". The CSD is just one possible implementation of that protocol. Much of this might even work directly on a PX4 based camera. |
@julianoes as discussed about video streaming feature addition, below is the sequence flow for the same. Please review. |
I think diagram is ok to illustrate how a plugin works but I can tell you the steps aren't going to be the same on every camera or product that integrates a camera, I would love to see this implemented in a way that every product vendor could extend this abstract camera plugin and build on top of it, @julianoes would this (abstract camera class) work with your implementation? is this useful? |
@mrpollo , every camera vendor should support MAVLink Camera protocol. So camera plugin is essentially a client to MAVLink Camera protocol compliment server. I didn't get your point about abstract camera class. |
I agree with @shakthi-prashanth-m. The protocol pretty much exists to abstract the camera differences away from a "usage" point of view. So the steps will be much the same for every single camera and the DroneCore camera plugin will be very much "concrete". Whether they are the above steps in the diagram is a matter for debate. There are some differences between supported camera settings. These are fetched from a camera definition file and the values are set using messages that have key/values. This is perhaps what Ramon was talking about - arguably a vendor might want to provide a nice front-end for getting and setting their particular key/values (settings). I certainly don't see how DroneCore can do anything useful here other than providing a generic API for making it easy to set/get parameter groups. My understanding is that the MAVLink commands to get RTSP stream information have not been fully implemented. Instead Avahi can be used to query streams. @lbegani is the best person to comment on how to implement that part of the flow. @lbegani can you comment on #292 (comment) (best way to integrate video streaming/MAVLink into an external API that uses CSD) |
I discussed with Lalit earlier he said it's WIP about MAVLink commands for video streaming but streaming feature itself exists. I see that command for getting video streaming info already exists: If they are WIP, I am fine to work on it so that camera plugin can do video streaming. |
Sounds good. The only bit that perhaps is a real question is the parsing of the camera definition and the way that the parameters are set. We might want to design our implementation to allow a manufacturer to provide a nicer layer over that bit for their own camera. |
|
@lbegani OK Sure. I'll add it soon. Thanks. |
I think we shouldn't have the streaming logic in the same diagram as the camera definition. They don't really depend on each, I think. As said before, I'll add the camera definition part and simple camera commands because I already have begun that work internally. Therefore, it would be great if @shakthi-prashanth-m can add the streaming stuff since I don't know how that works. |
@julianoes I am not sure if it makes sense to add camera features before the basic infrastructure for camera is there in the SDK. @shakthi-prashanth-m and myself started working on this. Can you publish your proposal or WIP code? |
I will push it as soon as I get to it. However, I don't think you depend on the basic functionality that I provide though. |
Camera Plugin must define interfaces for the following -
|
As per the current model, a Camera application may look like this: DroneCore drone_conn, camera_conn;
drone_conn.add_udp_connection(14540); // 14540 for autopilot
camera_conna.add_udp_connection(24540); // 24540 for camera
while (!drone_conn.is_connected() ||
!camera_conn.is_connected())
sleep_for(seconds(1); // wait for both autopilot and camera to be ready.
Device &camera = camera_conn.get_device();
camera.start_video_capture();
Device &drone = drone_conn.get_device();
auto offboard = std::make_shared<Offboard>(&drone);
offboard.set_velocity_ned(....);
...
camera.stop_video_capture(); Does it make sense ? @julianoes @hamishwillee |
Kind of. What if there are multiple cameras (and yes, that is a realistic scenario). |
Both autopilot and camera component send the heartbeat to same UDP port (14550) |
I think, we can't use
Yes, we have to handle multiple cameras as well, so it makes sense to do discover, connect, etc in camera plugin itself rather than re-using |
Right now, we can't listen on the same port for both autopilot and camera. So, we have to choose another well-known port say, 14550. (We have to make sure not to launch QGC same time). |
I think it should look like that:
Autopilot and camera should then have both the same system ID but different component IDs. As @shakthi-prashanth-m suggested we need proper support for multiple components (#304). For the case of multiple camera, we use more UDP connections if required, and we distinguish them by component ID, see: |
I agree that we distinguish camera components by component id.
All camera components deal with a single UDP port, I think. Consider, CSD for example. It will use port 14550 for all camera components. @lbegani is that right ? @julianoes, with multiple component support in DroneCore, we can use same port for autopilot and camera isn't it ? We don't request for Autopilot version if Heartbeat has |
Regarding UDP connections, there may be multiple scenarios that need to be considered. We may not to support all of them
|
Yes, we can but it all depends on how it is all set up. For Yuneec's case, e.g. the camera and autopilot are on the same UDP port because the autopilot communicates "through" the camera.
Correct, we shouldn't.
Right. I'm not sure where 3. is needed though. |
A camera will be associated with a device and share its system ID. Do we need to consider systems where a mavlink camera might exist separately from a device?
Jumping back a big, I agree with @julianoes on the above. Even if camera vs streaming operations can be handled together I think it makes sense for readers to see them separately. |
As an aside - CSD does not yet support video capture. We can still define the interface, but they won't work yet. |
@shakthi-prashanth-m can we close this? |
Yes, we can! And it is already closed :-) |
Its is required to add a plugin to configure Camera as per https://mavlink.io/en/protocol/camera.html to interface Camera Streaming Daemon.
To start with, Camera plugin should
UPDATE:
@julianoes added camera plugin as part of #338 Its WIP. Thanks @julianoes .
I would add on top of it:
The text was updated successfully, but these errors were encountered: