From 065f63fa404940cfa7aa67a2aecf371a80946ec8 Mon Sep 17 00:00:00 2001 From: Adrian Dummermuth Date: Wed, 10 Jan 2024 10:56:55 +0100 Subject: [PATCH 1/3] Added gimbal function SetAngles --- protos/gimbal/gimbal.proto | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/protos/gimbal/gimbal.proto b/protos/gimbal/gimbal.proto index bbe9ea865..34d758ac2 100644 --- a/protos/gimbal/gimbal.proto +++ b/protos/gimbal/gimbal.proto @@ -7,6 +7,15 @@ option java_outer_classname = "GimbalProto"; // Provide control over a gimbal. service GimbalService { + /* + * + * Set gimbal pitch, yaw and roll angles. + * + * This sets the desired pitch, yaw and roll angles of a gimbal. + * Will return when the command is accepted, however, it might + * take the gimbal longer to actually be set to the new angles. + */ + rpc SetAngles(SetAnglesRequest) returns(SetAnglesResponse) {} /* * * Set gimbal pitch and yaw angles. @@ -71,6 +80,15 @@ service GimbalService { rpc SubscribeControl(SubscribeControlRequest) returns(stream ControlResponse) {} } +message SetAnglesRequest { + float pitch_deg = 1; // Pitch angle in degrees (negative points down) + float yaw_deg = 2; // Yaw angle in degrees (positive is clock-wise, range: -180 to 180 or 0 to 360) + float roll_deg = 3; // Roll angle in degrees +} +message SetAnglesResponse { + GimbalResult gimbal_result = 1; +} + message SetPitchAndYawRequest { float pitch_deg = 1; // Pitch angle in degrees (negative points down) float yaw_deg = 2; // Yaw angle in degrees (positive is clock-wise, range: -180 to 180 or 0 to 360) @@ -123,7 +141,7 @@ message ControlResponse { // Gimbal mode type. enum GimbalMode { GIMBAL_MODE_YAW_FOLLOW = 0; // Yaw follow will point the gimbal to the vehicle heading - GIMBAL_MODE_YAW_LOCK = 1; // Yaw lock will fix the gimbal pointing to an absolute direction + GIMBAL_MODE_YAW_LOCK = 1; // Yaw lock will fix the gimbal poiting to an absolute direction } // Control mode From 6bc2cac86c579ffe48963ed1ac49ab7e64caa717 Mon Sep 17 00:00:00 2001 From: Adrian Dummermuth Date: Fri, 12 Jan 2024 15:48:15 +0100 Subject: [PATCH 2/3] Fixed typo --- protos/gimbal/gimbal.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protos/gimbal/gimbal.proto b/protos/gimbal/gimbal.proto index 34d758ac2..f7de8e13c 100644 --- a/protos/gimbal/gimbal.proto +++ b/protos/gimbal/gimbal.proto @@ -141,7 +141,7 @@ message ControlResponse { // Gimbal mode type. enum GimbalMode { GIMBAL_MODE_YAW_FOLLOW = 0; // Yaw follow will point the gimbal to the vehicle heading - GIMBAL_MODE_YAW_LOCK = 1; // Yaw lock will fix the gimbal poiting to an absolute direction + GIMBAL_MODE_YAW_LOCK = 1; // Yaw lock will fix the gimbal pointing to an absolute direction } // Control mode From 2fd3f21eec6209584d2062499be0f8cab05ac4e5 Mon Sep 17 00:00:00 2001 From: Adrian Dummermuth Date: Mon, 22 Jan 2024 07:40:11 +0100 Subject: [PATCH 3/3] Changed order of angles to MAVLink order --- protos/gimbal/gimbal.proto | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/protos/gimbal/gimbal.proto b/protos/gimbal/gimbal.proto index f7de8e13c..b4374c63d 100644 --- a/protos/gimbal/gimbal.proto +++ b/protos/gimbal/gimbal.proto @@ -9,9 +9,9 @@ option java_outer_classname = "GimbalProto"; service GimbalService { /* * - * Set gimbal pitch, yaw and roll angles. + * Set gimbal roll, pitch and yaw angles. * - * This sets the desired pitch, yaw and roll angles of a gimbal. + * This sets the desired roll, pitch and yaw angles of a gimbal. * Will return when the command is accepted, however, it might * take the gimbal longer to actually be set to the new angles. */ @@ -81,9 +81,9 @@ service GimbalService { } message SetAnglesRequest { - float pitch_deg = 1; // Pitch angle in degrees (negative points down) - float yaw_deg = 2; // Yaw angle in degrees (positive is clock-wise, range: -180 to 180 or 0 to 360) - float roll_deg = 3; // Roll angle in degrees + float roll_deg = 1; // Roll angle in degrees + float pitch_deg = 2; // Pitch angle in degrees (negative points down) + float yaw_deg = 3; // Yaw angle in degrees (positive is clock-wise, range: -180 to 180 or 0 to 360) } message SetAnglesResponse { GimbalResult gimbal_result = 1;