From c000fb508ffa66b440ac746b2f594a6ee547afc2 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Mon, 25 Mar 2024 08:29:23 +1300 Subject: [PATCH] camera_server: implement zoom (#333) This implements continuous and range zooming. Signed-off-by: Julian Oes --- protos/camera_server/camera_server.proto | 72 ++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/protos/camera_server/camera_server.proto b/protos/camera_server/camera_server.proto index a8283dcd..99d2b69d 100644 --- a/protos/camera_server/camera_server.proto +++ b/protos/camera_server/camera_server.proto @@ -77,6 +77,30 @@ service CameraServerService { // Respond to reset settings from SubscribeResetSettings. rpc RespondResetSettings(RespondResetSettingsRequest) returns(RespondResetSettingsResponse) { option (mavsdk.options.async_type) = SYNC; } + + // Subscribe to zoom in start command + rpc SubscribeZoomInStart(SubscribeZoomInStartRequest) returns(stream ZoomInStartResponse) { option (mavsdk.options.async_type) = ASYNC; } + + // Respond to zoom in start. + rpc RespondZoomInStart(RespondZoomInStartRequest) returns(RespondZoomInStartResponse) { option (mavsdk.options.async_type) = SYNC; } + + // Subscribe to zoom out start command + rpc SubscribeZoomOutStart(SubscribeZoomOutStartRequest) returns(stream ZoomOutStartResponse) { option (mavsdk.options.async_type) = ASYNC; } + + // Respond to zoom out start. + rpc RespondZoomOutStart(RespondZoomOutStartRequest) returns(RespondZoomOutStartResponse) { option (mavsdk.options.async_type) = SYNC; } + + // Subscribe to zoom stop command + rpc SubscribeZoomStop(SubscribeZoomStopRequest) returns(stream ZoomStopResponse) { option (mavsdk.options.async_type) = ASYNC; } + + // Respond to zoom stop. + rpc RespondZoomStop(RespondZoomStopRequest) returns(RespondZoomStopResponse) { option (mavsdk.options.async_type) = SYNC; } + + // Subscribe to zoom range command + rpc SubscribeZoomRange(SubscribeZoomRangeRequest) returns(stream ZoomRangeResponse) { option (mavsdk.options.async_type) = ASYNC; } + + // Respond to zoom range. + rpc RespondZoomRange(RespondZoomRangeRequest) returns(RespondZoomRangeResponse) { option (mavsdk.options.async_type) = SYNC; } } message SetInformationRequest { @@ -226,6 +250,54 @@ message RespondResetSettingsResponse { CameraServerResult camera_server_result = 1; } +message SubscribeZoomInStartRequest {} +message ZoomInStartResponse { + int32 reserved = 1; // reserved, just make protoc-gen-mavsdk working +} + +message RespondZoomInStartRequest { + CameraFeedback zoom_in_start_feedback = 1; // the feedback +} +message RespondZoomInStartResponse { + CameraServerResult camera_server_result = 1; +} + +message SubscribeZoomOutStartRequest {} +message ZoomOutStartResponse { + int32 reserved = 1; // reserved, just make protoc-gen-mavsdk working +} + +message RespondZoomOutStartRequest { + CameraFeedback zoom_out_start_feedback = 1; // the feedback +} +message RespondZoomOutStartResponse { + CameraServerResult camera_server_result = 1; +} + +message SubscribeZoomStopRequest {} +message ZoomStopResponse { + int32 reserved = 1; // reserved, just make protoc-gen-mavsdk working +} + +message RespondZoomStopRequest { + CameraFeedback zoom_stop_feedback = 1; // the feedback +} +message RespondZoomStopResponse { + CameraServerResult camera_server_result = 1; +} + +message SubscribeZoomRangeRequest {} +message ZoomRangeResponse { + float factor = 1; // The zoom factor, starting at 1x. +} + +message RespondZoomRangeRequest { + CameraFeedback zoom_range_feedback = 1; // the feedback +} +message RespondZoomRangeResponse { + CameraServerResult camera_server_result = 1; +} + // Possible feedback results for camera respond command. enum CameraFeedback { CAMERA_FEEDBACK_UNKNOWN = 0; // Unknown