From 8130e4686a7834e5c44ccf78b93ad23ef9b34666 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 30 Nov 2021 18:16:13 +0100 Subject: [PATCH] Update mavsdk_server and proto submodule --- MAVSDK_SERVER_VERSION | 2 +- mavsdk/mission.py | 24 +++- mavsdk/mission_pb2.py | 36 +++-- mavsdk/offboard.py | 195 +++++++++++++++++++++++++ mavsdk/offboard_pb2.py | 279 ++++++++++++++++++++++++++++++------ mavsdk/offboard_pb2_grpc.py | 35 +++++ proto | 2 +- 7 files changed, 510 insertions(+), 63 deletions(-) diff --git a/MAVSDK_SERVER_VERSION b/MAVSDK_SERVER_VERSION index fe2725ea..f6460f6b 100644 --- a/MAVSDK_SERVER_VERSION +++ b/MAVSDK_SERVER_VERSION @@ -1 +1 @@ -v0.46.1 +v0.50.0 diff --git a/mavsdk/mission.py b/mavsdk/mission.py index 136db7e1..798bc6ee 100644 --- a/mavsdk/mission.py +++ b/mavsdk/mission.py @@ -53,6 +53,9 @@ class MissionItem: yaw_deg : float Absolute yaw angle (in degrees) + camera_photo_distance_m : float + Camera photo distance to use after this mission item (in meters) + """ @@ -154,7 +157,8 @@ def __init__( loiter_time_s, camera_photo_interval_s, acceptance_radius_m, - yaw_deg): + yaw_deg, + camera_photo_distance_m): """ Initializes the MissionItem object """ self.latitude_deg = latitude_deg self.longitude_deg = longitude_deg @@ -168,6 +172,7 @@ def __init__( self.camera_photo_interval_s = camera_photo_interval_s self.acceptance_radius_m = acceptance_radius_m self.yaw_deg = yaw_deg + self.camera_photo_distance_m = camera_photo_distance_m def __eq__(self, to_compare): """ Checks if two MissionItem are the same """ @@ -186,7 +191,8 @@ def __eq__(self, to_compare): (self.loiter_time_s == to_compare.loiter_time_s) and \ (self.camera_photo_interval_s == to_compare.camera_photo_interval_s) and \ (self.acceptance_radius_m == to_compare.acceptance_radius_m) and \ - (self.yaw_deg == to_compare.yaw_deg) + (self.yaw_deg == to_compare.yaw_deg) and \ + (self.camera_photo_distance_m == to_compare.camera_photo_distance_m) except AttributeError: return False @@ -205,7 +211,8 @@ def __str__(self): "loiter_time_s: " + str(self.loiter_time_s), "camera_photo_interval_s: " + str(self.camera_photo_interval_s), "acceptance_radius_m: " + str(self.acceptance_radius_m), - "yaw_deg: " + str(self.yaw_deg) + "yaw_deg: " + str(self.yaw_deg), + "camera_photo_distance_m: " + str(self.camera_photo_distance_m) ]) return f"MissionItem: [{struct_repr}]" @@ -248,7 +255,10 @@ def translate_from_rpc(rpcMissionItem): rpcMissionItem.acceptance_radius_m, - rpcMissionItem.yaw_deg + rpcMissionItem.yaw_deg, + + + rpcMissionItem.camera_photo_distance_m ) def translate_to_rpc(self, rpcMissionItem): @@ -327,6 +337,12 @@ def translate_to_rpc(self, rpcMissionItem): + + + rpcMissionItem.camera_photo_distance_m = self.camera_photo_distance_m + + + class MissionPlan: diff --git a/mavsdk/mission_pb2.py b/mavsdk/mission_pb2.py index 74161e03..d0bbe35d 100644 --- a/mavsdk/mission_pb2.py +++ b/mavsdk/mission_pb2.py @@ -20,7 +20,7 @@ syntax='proto3', serialized_options=b'\n\021io.mavsdk.missionB\014MissionProto', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x15mission/mission.proto\x12\x12mavsdk.rpc.mission\x1a\x14mavsdk_options.proto\"M\n\x14UploadMissionRequest\x12\x35\n\x0cmission_plan\x18\x01 \x01(\x0b\x32\x1f.mavsdk.rpc.mission.MissionPlan\"R\n\x15UploadMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x1c\n\x1a\x43\x61ncelMissionUploadRequest\"X\n\x1b\x43\x61ncelMissionUploadResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x18\n\x16\x44ownloadMissionRequest\"\x8b\x01\n\x17\x44ownloadMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\x12\x35\n\x0cmission_plan\x18\x02 \x01(\x0b\x32\x1f.mavsdk.rpc.mission.MissionPlan\"\x1e\n\x1c\x43\x61ncelMissionDownloadRequest\"Z\n\x1d\x43\x61ncelMissionDownloadResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x15\n\x13StartMissionRequest\"Q\n\x14StartMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x15\n\x13PauseMissionRequest\"Q\n\x14PauseMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x15\n\x13\x43learMissionRequest\"Q\n\x14\x43learMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"-\n\x1cSetCurrentMissionItemRequest\x12\r\n\x05index\x18\x01 \x01(\x05\"Z\n\x1dSetCurrentMissionItemResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x1a\n\x18IsMissionFinishedRequest\"k\n\x19IsMissionFinishedResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\x12\x13\n\x0bis_finished\x18\x02 \x01(\x08\"!\n\x1fSubscribeMissionProgressRequest\"X\n\x17MissionProgressResponse\x12=\n\x10mission_progress\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.mission.MissionProgress\"&\n$GetReturnToLaunchAfterMissionRequest\"r\n%GetReturnToLaunchAfterMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\x12\x0e\n\x06\x65nable\x18\x02 \x01(\x08\"6\n$SetReturnToLaunchAfterMissionRequest\x12\x0e\n\x06\x65nable\x18\x01 \x01(\x08\"b\n%SetReturnToLaunchAfterMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x92\x06\n\x0bMissionItem\x12(\n\x0clatitude_deg\x18\x01 \x01(\x01\x42\x12\x82\xb5\x18\x03NaN\x89\xb5\x18H\xaf\xbc\x9a\xf2\xd7z>\x12)\n\rlongitude_deg\x18\x02 \x01(\x01\x42\x12\x82\xb5\x18\x03NaN\x89\xb5\x18H\xaf\xbc\x9a\xf2\xd7z>\x12$\n\x13relative_altitude_m\x18\x03 \x01(\x02\x42\x07\x82\xb5\x18\x03NaN\x12\x1a\n\tspeed_m_s\x18\x04 \x01(\x02\x42\x07\x82\xb5\x18\x03NaN\x12!\n\x0eis_fly_through\x18\x05 \x01(\x08\x42\t\x82\xb5\x18\x05\x66\x61lse\x12,\n\x10gimbal_pitch_deg\x18\x06 \x01(\x02\x42\x12\x82\xb5\x18\x03NaN\x89\xb5\x18-C\x1c\xeb\xe2\x36\x1a?\x12*\n\x0egimbal_yaw_deg\x18\x07 \x01(\x02\x42\x12\x82\xb5\x18\x03NaN\x89\xb5\x18-C\x1c\xeb\xe2\x36\x1a?\x12\x43\n\rcamera_action\x18\x08 \x01(\x0e\x32,.mavsdk.rpc.mission.MissionItem.CameraAction\x12\x1e\n\rloiter_time_s\x18\t \x01(\x02\x42\x07\x82\xb5\x18\x03NaN\x12(\n\x17\x63\x61mera_photo_interval_s\x18\n \x01(\x01\x42\x07\x82\xb5\x18\x03\x31.0\x12$\n\x13\x61\x63\x63\x65ptance_radius_m\x18\x0b \x01(\x02\x42\x07\x82\xb5\x18\x03NaN\x12\x18\n\x07yaw_deg\x18\x0c \x01(\x02\x42\x07\x82\xb5\x18\x03NaN\"\x9f\x02\n\x0c\x43\x61meraAction\x12\x16\n\x12\x43\x41MERA_ACTION_NONE\x10\x00\x12\x1c\n\x18\x43\x41MERA_ACTION_TAKE_PHOTO\x10\x01\x12&\n\"CAMERA_ACTION_START_PHOTO_INTERVAL\x10\x02\x12%\n!CAMERA_ACTION_STOP_PHOTO_INTERVAL\x10\x03\x12\x1d\n\x19\x43\x41MERA_ACTION_START_VIDEO\x10\x04\x12\x1c\n\x18\x43\x41MERA_ACTION_STOP_VIDEO\x10\x05\x12&\n\"CAMERA_ACTION_START_PHOTO_DISTANCE\x10\x06\x12%\n!CAMERA_ACTION_STOP_PHOTO_DISTANCE\x10\x07\"E\n\x0bMissionPlan\x12\x36\n\rmission_items\x18\x01 \x03(\x0b\x32\x1f.mavsdk.rpc.mission.MissionItem\"1\n\x0fMissionProgress\x12\x0f\n\x07\x63urrent\x18\x01 \x01(\x05\x12\r\n\x05total\x18\x02 \x01(\x05\"\x99\x03\n\rMissionResult\x12\x38\n\x06result\x18\x01 \x01(\x0e\x32(.mavsdk.rpc.mission.MissionResult.Result\x12\x12\n\nresult_str\x18\x02 \x01(\t\"\xb9\x02\n\x06Result\x12\x12\n\x0eRESULT_UNKNOWN\x10\x00\x12\x12\n\x0eRESULT_SUCCESS\x10\x01\x12\x10\n\x0cRESULT_ERROR\x10\x02\x12!\n\x1dRESULT_TOO_MANY_MISSION_ITEMS\x10\x03\x12\x0f\n\x0bRESULT_BUSY\x10\x04\x12\x12\n\x0eRESULT_TIMEOUT\x10\x05\x12\x1b\n\x17RESULT_INVALID_ARGUMENT\x10\x06\x12\x16\n\x12RESULT_UNSUPPORTED\x10\x07\x12\x1f\n\x1bRESULT_NO_MISSION_AVAILABLE\x10\x08\x12\"\n\x1eRESULT_UNSUPPORTED_MISSION_CMD\x10\x0b\x12\x1d\n\x19RESULT_TRANSFER_CANCELLED\x10\x0c\x12\x14\n\x10RESULT_NO_SYSTEM\x10\r2\xcd\x0b\n\x0eMissionService\x12\x66\n\rUploadMission\x12(.mavsdk.rpc.mission.UploadMissionRequest\x1a).mavsdk.rpc.mission.UploadMissionResponse\"\x00\x12|\n\x13\x43\x61ncelMissionUpload\x12..mavsdk.rpc.mission.CancelMissionUploadRequest\x1a/.mavsdk.rpc.mission.CancelMissionUploadResponse\"\x04\x80\xb5\x18\x01\x12l\n\x0f\x44ownloadMission\x12*.mavsdk.rpc.mission.DownloadMissionRequest\x1a+.mavsdk.rpc.mission.DownloadMissionResponse\"\x00\x12\x82\x01\n\x15\x43\x61ncelMissionDownload\x12\x30.mavsdk.rpc.mission.CancelMissionDownloadRequest\x1a\x31.mavsdk.rpc.mission.CancelMissionDownloadResponse\"\x04\x80\xb5\x18\x01\x12\x63\n\x0cStartMission\x12\'.mavsdk.rpc.mission.StartMissionRequest\x1a(.mavsdk.rpc.mission.StartMissionResponse\"\x00\x12\x63\n\x0cPauseMission\x12\'.mavsdk.rpc.mission.PauseMissionRequest\x1a(.mavsdk.rpc.mission.PauseMissionResponse\"\x00\x12\x63\n\x0c\x43learMission\x12\'.mavsdk.rpc.mission.ClearMissionRequest\x1a(.mavsdk.rpc.mission.ClearMissionResponse\"\x00\x12~\n\x15SetCurrentMissionItem\x12\x30.mavsdk.rpc.mission.SetCurrentMissionItemRequest\x1a\x31.mavsdk.rpc.mission.SetCurrentMissionItemResponse\"\x00\x12v\n\x11IsMissionFinished\x12,.mavsdk.rpc.mission.IsMissionFinishedRequest\x1a-.mavsdk.rpc.mission.IsMissionFinishedResponse\"\x04\x80\xb5\x18\x01\x12\x80\x01\n\x18SubscribeMissionProgress\x12\x33.mavsdk.rpc.mission.SubscribeMissionProgressRequest\x1a+.mavsdk.rpc.mission.MissionProgressResponse\"\x00\x30\x01\x12\x9a\x01\n\x1dGetReturnToLaunchAfterMission\x12\x38.mavsdk.rpc.mission.GetReturnToLaunchAfterMissionRequest\x1a\x39.mavsdk.rpc.mission.GetReturnToLaunchAfterMissionResponse\"\x04\x80\xb5\x18\x01\x12\x9a\x01\n\x1dSetReturnToLaunchAfterMission\x12\x38.mavsdk.rpc.mission.SetReturnToLaunchAfterMissionRequest\x1a\x39.mavsdk.rpc.mission.SetReturnToLaunchAfterMissionResponse\"\x04\x80\xb5\x18\x01\x42!\n\x11io.mavsdk.missionB\x0cMissionProtob\x06proto3' + serialized_pb=b'\n\x15mission/mission.proto\x12\x12mavsdk.rpc.mission\x1a\x14mavsdk_options.proto\"M\n\x14UploadMissionRequest\x12\x35\n\x0cmission_plan\x18\x01 \x01(\x0b\x32\x1f.mavsdk.rpc.mission.MissionPlan\"R\n\x15UploadMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x1c\n\x1a\x43\x61ncelMissionUploadRequest\"X\n\x1b\x43\x61ncelMissionUploadResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x18\n\x16\x44ownloadMissionRequest\"\x8b\x01\n\x17\x44ownloadMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\x12\x35\n\x0cmission_plan\x18\x02 \x01(\x0b\x32\x1f.mavsdk.rpc.mission.MissionPlan\"\x1e\n\x1c\x43\x61ncelMissionDownloadRequest\"Z\n\x1d\x43\x61ncelMissionDownloadResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x15\n\x13StartMissionRequest\"Q\n\x14StartMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x15\n\x13PauseMissionRequest\"Q\n\x14PauseMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x15\n\x13\x43learMissionRequest\"Q\n\x14\x43learMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"-\n\x1cSetCurrentMissionItemRequest\x12\r\n\x05index\x18\x01 \x01(\x05\"Z\n\x1dSetCurrentMissionItemResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\x1a\n\x18IsMissionFinishedRequest\"k\n\x19IsMissionFinishedResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\x12\x13\n\x0bis_finished\x18\x02 \x01(\x08\"!\n\x1fSubscribeMissionProgressRequest\"X\n\x17MissionProgressResponse\x12=\n\x10mission_progress\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.mission.MissionProgress\"&\n$GetReturnToLaunchAfterMissionRequest\"r\n%GetReturnToLaunchAfterMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\x12\x0e\n\x06\x65nable\x18\x02 \x01(\x08\"6\n$SetReturnToLaunchAfterMissionRequest\x12\x0e\n\x06\x65nable\x18\x01 \x01(\x08\"b\n%SetReturnToLaunchAfterMissionResponse\x12\x39\n\x0emission_result\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.mission.MissionResult\"\xbc\x06\n\x0bMissionItem\x12(\n\x0clatitude_deg\x18\x01 \x01(\x01\x42\x12\x82\xb5\x18\x03NaN\x89\xb5\x18H\xaf\xbc\x9a\xf2\xd7z>\x12)\n\rlongitude_deg\x18\x02 \x01(\x01\x42\x12\x82\xb5\x18\x03NaN\x89\xb5\x18H\xaf\xbc\x9a\xf2\xd7z>\x12$\n\x13relative_altitude_m\x18\x03 \x01(\x02\x42\x07\x82\xb5\x18\x03NaN\x12\x1a\n\tspeed_m_s\x18\x04 \x01(\x02\x42\x07\x82\xb5\x18\x03NaN\x12!\n\x0eis_fly_through\x18\x05 \x01(\x08\x42\t\x82\xb5\x18\x05\x66\x61lse\x12,\n\x10gimbal_pitch_deg\x18\x06 \x01(\x02\x42\x12\x82\xb5\x18\x03NaN\x89\xb5\x18-C\x1c\xeb\xe2\x36\x1a?\x12*\n\x0egimbal_yaw_deg\x18\x07 \x01(\x02\x42\x12\x82\xb5\x18\x03NaN\x89\xb5\x18-C\x1c\xeb\xe2\x36\x1a?\x12\x43\n\rcamera_action\x18\x08 \x01(\x0e\x32,.mavsdk.rpc.mission.MissionItem.CameraAction\x12\x1e\n\rloiter_time_s\x18\t \x01(\x02\x42\x07\x82\xb5\x18\x03NaN\x12(\n\x17\x63\x61mera_photo_interval_s\x18\n \x01(\x01\x42\x07\x82\xb5\x18\x03\x31.0\x12$\n\x13\x61\x63\x63\x65ptance_radius_m\x18\x0b \x01(\x02\x42\x07\x82\xb5\x18\x03NaN\x12\x18\n\x07yaw_deg\x18\x0c \x01(\x02\x42\x07\x82\xb5\x18\x03NaN\x12(\n\x17\x63\x61mera_photo_distance_m\x18\r \x01(\x02\x42\x07\x82\xb5\x18\x03NAN\"\x9f\x02\n\x0c\x43\x61meraAction\x12\x16\n\x12\x43\x41MERA_ACTION_NONE\x10\x00\x12\x1c\n\x18\x43\x41MERA_ACTION_TAKE_PHOTO\x10\x01\x12&\n\"CAMERA_ACTION_START_PHOTO_INTERVAL\x10\x02\x12%\n!CAMERA_ACTION_STOP_PHOTO_INTERVAL\x10\x03\x12\x1d\n\x19\x43\x41MERA_ACTION_START_VIDEO\x10\x04\x12\x1c\n\x18\x43\x41MERA_ACTION_STOP_VIDEO\x10\x05\x12&\n\"CAMERA_ACTION_START_PHOTO_DISTANCE\x10\x06\x12%\n!CAMERA_ACTION_STOP_PHOTO_DISTANCE\x10\x07\"E\n\x0bMissionPlan\x12\x36\n\rmission_items\x18\x01 \x03(\x0b\x32\x1f.mavsdk.rpc.mission.MissionItem\"1\n\x0fMissionProgress\x12\x0f\n\x07\x63urrent\x18\x01 \x01(\x05\x12\r\n\x05total\x18\x02 \x01(\x05\"\x99\x03\n\rMissionResult\x12\x38\n\x06result\x18\x01 \x01(\x0e\x32(.mavsdk.rpc.mission.MissionResult.Result\x12\x12\n\nresult_str\x18\x02 \x01(\t\"\xb9\x02\n\x06Result\x12\x12\n\x0eRESULT_UNKNOWN\x10\x00\x12\x12\n\x0eRESULT_SUCCESS\x10\x01\x12\x10\n\x0cRESULT_ERROR\x10\x02\x12!\n\x1dRESULT_TOO_MANY_MISSION_ITEMS\x10\x03\x12\x0f\n\x0bRESULT_BUSY\x10\x04\x12\x12\n\x0eRESULT_TIMEOUT\x10\x05\x12\x1b\n\x17RESULT_INVALID_ARGUMENT\x10\x06\x12\x16\n\x12RESULT_UNSUPPORTED\x10\x07\x12\x1f\n\x1bRESULT_NO_MISSION_AVAILABLE\x10\x08\x12\"\n\x1eRESULT_UNSUPPORTED_MISSION_CMD\x10\x0b\x12\x1d\n\x19RESULT_TRANSFER_CANCELLED\x10\x0c\x12\x14\n\x10RESULT_NO_SYSTEM\x10\r2\xcd\x0b\n\x0eMissionService\x12\x66\n\rUploadMission\x12(.mavsdk.rpc.mission.UploadMissionRequest\x1a).mavsdk.rpc.mission.UploadMissionResponse\"\x00\x12|\n\x13\x43\x61ncelMissionUpload\x12..mavsdk.rpc.mission.CancelMissionUploadRequest\x1a/.mavsdk.rpc.mission.CancelMissionUploadResponse\"\x04\x80\xb5\x18\x01\x12l\n\x0f\x44ownloadMission\x12*.mavsdk.rpc.mission.DownloadMissionRequest\x1a+.mavsdk.rpc.mission.DownloadMissionResponse\"\x00\x12\x82\x01\n\x15\x43\x61ncelMissionDownload\x12\x30.mavsdk.rpc.mission.CancelMissionDownloadRequest\x1a\x31.mavsdk.rpc.mission.CancelMissionDownloadResponse\"\x04\x80\xb5\x18\x01\x12\x63\n\x0cStartMission\x12\'.mavsdk.rpc.mission.StartMissionRequest\x1a(.mavsdk.rpc.mission.StartMissionResponse\"\x00\x12\x63\n\x0cPauseMission\x12\'.mavsdk.rpc.mission.PauseMissionRequest\x1a(.mavsdk.rpc.mission.PauseMissionResponse\"\x00\x12\x63\n\x0c\x43learMission\x12\'.mavsdk.rpc.mission.ClearMissionRequest\x1a(.mavsdk.rpc.mission.ClearMissionResponse\"\x00\x12~\n\x15SetCurrentMissionItem\x12\x30.mavsdk.rpc.mission.SetCurrentMissionItemRequest\x1a\x31.mavsdk.rpc.mission.SetCurrentMissionItemResponse\"\x00\x12v\n\x11IsMissionFinished\x12,.mavsdk.rpc.mission.IsMissionFinishedRequest\x1a-.mavsdk.rpc.mission.IsMissionFinishedResponse\"\x04\x80\xb5\x18\x01\x12\x80\x01\n\x18SubscribeMissionProgress\x12\x33.mavsdk.rpc.mission.SubscribeMissionProgressRequest\x1a+.mavsdk.rpc.mission.MissionProgressResponse\"\x00\x30\x01\x12\x9a\x01\n\x1dGetReturnToLaunchAfterMission\x12\x38.mavsdk.rpc.mission.GetReturnToLaunchAfterMissionRequest\x1a\x39.mavsdk.rpc.mission.GetReturnToLaunchAfterMissionResponse\"\x04\x80\xb5\x18\x01\x12\x9a\x01\n\x1dSetReturnToLaunchAfterMission\x12\x38.mavsdk.rpc.mission.SetReturnToLaunchAfterMissionRequest\x1a\x39.mavsdk.rpc.mission.SetReturnToLaunchAfterMissionResponse\"\x04\x80\xb5\x18\x01\x42!\n\x11io.mavsdk.missionB\x0cMissionProtob\x06proto3' , dependencies=[mavsdk__options__pb2.DESCRIPTOR,]) @@ -76,8 +76,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2173, - serialized_end=2460, + serialized_start=2215, + serialized_end=2502, ) _sym_db.RegisterEnumDescriptor(_MISSIONITEM_CAMERAACTION) @@ -151,8 +151,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2681, - serialized_end=2994, + serialized_start=2723, + serialized_end=3036, ) _sym_db.RegisterEnumDescriptor(_MISSIONRESULT_RESULT) @@ -975,6 +975,13 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=b'\202\265\030\003NaN', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='camera_photo_distance_m', full_name='mavsdk.rpc.mission.MissionItem.camera_photo_distance_m', index=12, + number=13, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=b'\202\265\030\003NAN', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -989,7 +996,7 @@ oneofs=[ ], serialized_start=1674, - serialized_end=2460, + serialized_end=2502, ) @@ -1020,8 +1027,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2462, - serialized_end=2531, + serialized_start=2504, + serialized_end=2573, ) @@ -1059,8 +1066,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2533, - serialized_end=2582, + serialized_start=2575, + serialized_end=2624, ) @@ -1099,8 +1106,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2585, - serialized_end=2994, + serialized_start=2627, + serialized_end=3036, ) _UPLOADMISSIONREQUEST.fields_by_name['mission_plan'].message_type = _MISSIONPLAN @@ -1361,6 +1368,7 @@ _MISSIONITEM.fields_by_name['camera_photo_interval_s']._options = None _MISSIONITEM.fields_by_name['acceptance_radius_m']._options = None _MISSIONITEM.fields_by_name['yaw_deg']._options = None +_MISSIONITEM.fields_by_name['camera_photo_distance_m']._options = None _MISSIONSERVICE = _descriptor.ServiceDescriptor( name='MissionService', @@ -1369,8 +1377,8 @@ index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=2997, - serialized_end=4482, + serialized_start=3039, + serialized_end=4524, methods=[ _descriptor.MethodDescriptor( name='UploadMission', diff --git a/mavsdk/offboard.py b/mavsdk/offboard.py index f2cf4220..c3bbaf04 100644 --- a/mavsdk/offboard.py +++ b/mavsdk/offboard.py @@ -463,6 +463,172 @@ def translate_to_rpc(self, rpcPositionNedYaw): +class PositionGlobalYaw: + """ + Type for position commands in Global (Latitude, Longitude, Altitude) coordinates and yaw. + + Parameters + ---------- + lat_deg : double + Latitude (in degrees) + + lon_deg : double + Longitude (in degrees) + + alt_m : float + altitude (in metres) + + yaw_deg : float + Yaw in degrees (0 North, positive is clock-wise looking from above) + + altitude_type : AltitudeType + altitude type for this position + + """ + + + + class AltitudeType(Enum): + """ + Possible altitude options + + Values + ------ + REL_HOME + Altitude relative to the Home position + + AMSL + Altitude above mean sea level (AMSL) + + AGL + Altitude above ground level (AGL) + + """ + + + REL_HOME = 0 + AMSL = 1 + AGL = 2 + + def translate_to_rpc(self): + if self == PositionGlobalYaw.AltitudeType.REL_HOME: + return offboard_pb2.PositionGlobalYaw.ALTITUDE_TYPE_REL_HOME + if self == PositionGlobalYaw.AltitudeType.AMSL: + return offboard_pb2.PositionGlobalYaw.ALTITUDE_TYPE_AMSL + if self == PositionGlobalYaw.AltitudeType.AGL: + return offboard_pb2.PositionGlobalYaw.ALTITUDE_TYPE_AGL + + @staticmethod + def translate_from_rpc(rpc_enum_value): + """ Parses a gRPC response """ + if rpc_enum_value == offboard_pb2.PositionGlobalYaw.ALTITUDE_TYPE_REL_HOME: + return PositionGlobalYaw.AltitudeType.REL_HOME + if rpc_enum_value == offboard_pb2.PositionGlobalYaw.ALTITUDE_TYPE_AMSL: + return PositionGlobalYaw.AltitudeType.AMSL + if rpc_enum_value == offboard_pb2.PositionGlobalYaw.ALTITUDE_TYPE_AGL: + return PositionGlobalYaw.AltitudeType.AGL + + def __str__(self): + return self.name + + + def __init__( + self, + lat_deg, + lon_deg, + alt_m, + yaw_deg, + altitude_type): + """ Initializes the PositionGlobalYaw object """ + self.lat_deg = lat_deg + self.lon_deg = lon_deg + self.alt_m = alt_m + self.yaw_deg = yaw_deg + self.altitude_type = altitude_type + + def __eq__(self, to_compare): + """ Checks if two PositionGlobalYaw are the same """ + try: + # Try to compare - this likely fails when it is compared to a non + # PositionGlobalYaw object + return \ + (self.lat_deg == to_compare.lat_deg) and \ + (self.lon_deg == to_compare.lon_deg) and \ + (self.alt_m == to_compare.alt_m) and \ + (self.yaw_deg == to_compare.yaw_deg) and \ + (self.altitude_type == to_compare.altitude_type) + + except AttributeError: + return False + + def __str__(self): + """ PositionGlobalYaw in string representation """ + struct_repr = ", ".join([ + "lat_deg: " + str(self.lat_deg), + "lon_deg: " + str(self.lon_deg), + "alt_m: " + str(self.alt_m), + "yaw_deg: " + str(self.yaw_deg), + "altitude_type: " + str(self.altitude_type) + ]) + + return f"PositionGlobalYaw: [{struct_repr}]" + + @staticmethod + def translate_from_rpc(rpcPositionGlobalYaw): + """ Translates a gRPC struct to the SDK equivalent """ + return PositionGlobalYaw( + + rpcPositionGlobalYaw.lat_deg, + + + rpcPositionGlobalYaw.lon_deg, + + + rpcPositionGlobalYaw.alt_m, + + + rpcPositionGlobalYaw.yaw_deg, + + + PositionGlobalYaw.AltitudeType.translate_from_rpc(rpcPositionGlobalYaw.altitude_type) + ) + + def translate_to_rpc(self, rpcPositionGlobalYaw): + """ Translates this SDK object into its gRPC equivalent """ + + + + + rpcPositionGlobalYaw.lat_deg = self.lat_deg + + + + + + rpcPositionGlobalYaw.lon_deg = self.lon_deg + + + + + + rpcPositionGlobalYaw.alt_m = self.alt_m + + + + + + rpcPositionGlobalYaw.yaw_deg = self.yaw_deg + + + + + + rpcPositionGlobalYaw.altitude_type = self.altitude_type.translate_to_rpc() + + + + + class VelocityBodyYawspeed: """ Type for velocity commands in body coordinates. @@ -1148,6 +1314,35 @@ async def set_position_ned(self, position_ned_yaw): raise OffboardError(result, "set_position_ned()", position_ned_yaw) + async def set_position_global(self, position_global_yaw): + """ + Set the position in Global coordinates (latitude, longitude, altitude) and yaw + + Parameters + ---------- + position_global_yaw : PositionGlobalYaw + Position and yaw + + Raises + ------ + OffboardError + If the request fails. The error contains the reason for the failure. + """ + + request = offboard_pb2.SetPositionGlobalRequest() + + position_global_yaw.translate_to_rpc(request.position_global_yaw) + + + response = await self._stub.SetPositionGlobal(request) + + + result = self._extract_result(response) + + if result.result != OffboardResult.Result.SUCCESS: + raise OffboardError(result, "set_position_global()", position_global_yaw) + + async def set_velocity_body(self, velocity_body_yawspeed): """ Set the velocity in body coordinates and yaw angular rate. Not available for fixed-wing aircraft. diff --git a/mavsdk/offboard_pb2.py b/mavsdk/offboard_pb2.py index a365c6cb..1ef208c6 100644 --- a/mavsdk/offboard_pb2.py +++ b/mavsdk/offboard_pb2.py @@ -20,12 +20,42 @@ syntax='proto3', serialized_options=b'\n\022io.mavsdk.offboardB\rOffboardProto', create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x17offboard/offboard.proto\x12\x13mavsdk.rpc.offboard\x1a\x14mavsdk_options.proto\"\x0e\n\x0cStartRequest\"M\n\rStartResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"\r\n\x0bStopRequest\"L\n\x0cStopResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"\x11\n\x0fIsActiveRequest\"%\n\x10IsActiveResponse\x12\x11\n\tis_active\x18\x01 \x01(\x08\"E\n\x12SetAttitudeRequest\x12/\n\x08\x61ttitude\x18\x01 \x01(\x0b\x32\x1d.mavsdk.rpc.offboard.Attitude\"S\n\x13SetAttitudeResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"[\n\x19SetActuatorControlRequest\x12>\n\x10\x61\x63tuator_control\x18\x01 \x01(\x0b\x32$.mavsdk.rpc.offboard.ActuatorControl\"Z\n\x1aSetActuatorControlResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"R\n\x16SetAttitudeRateRequest\x12\x38\n\rattitude_rate\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.offboard.AttitudeRate\"W\n\x17SetAttitudeRateResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"V\n\x15SetPositionNedRequest\x12=\n\x10position_ned_yaw\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.PositionNedYaw\"V\n\x16SetPositionNedResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"c\n\x16SetVelocityBodyRequest\x12I\n\x16velocity_body_yawspeed\x18\x01 \x01(\x0b\x32).mavsdk.rpc.offboard.VelocityBodyYawspeed\"W\n\x17SetVelocityBodyResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"V\n\x15SetVelocityNedRequest\x12=\n\x10velocity_ned_yaw\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.VelocityNedYaw\"V\n\x16SetVelocityNedResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"\x9d\x01\n\x1dSetPositionVelocityNedRequest\x12=\n\x10position_ned_yaw\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.PositionNedYaw\x12=\n\x10velocity_ned_yaw\x18\x02 \x01(\x0b\x32#.mavsdk.rpc.offboard.VelocityNedYaw\"^\n\x1eSetPositionVelocityNedResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"[\n\x19SetAccelerationNedRequest\x12>\n\x10\x61\x63\x63\x65leration_ned\x18\x01 \x01(\x0b\x32$.mavsdk.rpc.offboard.AccelerationNed\"Z\n\x1aSetAccelerationNedResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"V\n\x08\x41ttitude\x12\x10\n\x08roll_deg\x18\x01 \x01(\x02\x12\x11\n\tpitch_deg\x18\x02 \x01(\x02\x12\x0f\n\x07yaw_deg\x18\x03 \x01(\x02\x12\x14\n\x0cthrust_value\x18\x04 \x01(\x02\"(\n\x14\x41\x63tuatorControlGroup\x12\x10\n\x08\x63ontrols\x18\x01 \x03(\x02\"L\n\x0f\x41\x63tuatorControl\x12\x39\n\x06groups\x18\x01 \x03(\x0b\x32).mavsdk.rpc.offboard.ActuatorControlGroup\"`\n\x0c\x41ttitudeRate\x12\x12\n\nroll_deg_s\x18\x01 \x01(\x02\x12\x13\n\x0bpitch_deg_s\x18\x02 \x01(\x02\x12\x11\n\tyaw_deg_s\x18\x03 \x01(\x02\x12\x14\n\x0cthrust_value\x18\x04 \x01(\x02\"R\n\x0ePositionNedYaw\x12\x0f\n\x07north_m\x18\x01 \x01(\x02\x12\x0e\n\x06\x65\x61st_m\x18\x02 \x01(\x02\x12\x0e\n\x06\x64own_m\x18\x03 \x01(\x02\x12\x0f\n\x07yaw_deg\x18\x04 \x01(\x02\"h\n\x14VelocityBodyYawspeed\x12\x13\n\x0b\x66orward_m_s\x18\x01 \x01(\x02\x12\x11\n\tright_m_s\x18\x02 \x01(\x02\x12\x10\n\x08\x64own_m_s\x18\x03 \x01(\x02\x12\x16\n\x0eyawspeed_deg_s\x18\x04 \x01(\x02\"X\n\x0eVelocityNedYaw\x12\x11\n\tnorth_m_s\x18\x01 \x01(\x02\x12\x10\n\x08\x65\x61st_m_s\x18\x02 \x01(\x02\x12\x10\n\x08\x64own_m_s\x18\x03 \x01(\x02\x12\x0f\n\x07yaw_deg\x18\x04 \x01(\x02\"K\n\x0f\x41\x63\x63\x65lerationNed\x12\x12\n\nnorth_m_s2\x18\x01 \x01(\x02\x12\x11\n\teast_m_s2\x18\x02 \x01(\x02\x12\x11\n\tdown_m_s2\x18\x03 \x01(\x02\"\xa2\x02\n\x0eOffboardResult\x12:\n\x06result\x18\x01 \x01(\x0e\x32*.mavsdk.rpc.offboard.OffboardResult.Result\x12\x12\n\nresult_str\x18\x02 \x01(\t\"\xbf\x01\n\x06Result\x12\x12\n\x0eRESULT_UNKNOWN\x10\x00\x12\x12\n\x0eRESULT_SUCCESS\x10\x01\x12\x14\n\x10RESULT_NO_SYSTEM\x10\x02\x12\x1b\n\x17RESULT_CONNECTION_ERROR\x10\x03\x12\x0f\n\x0bRESULT_BUSY\x10\x04\x12\x19\n\x15RESULT_COMMAND_DENIED\x10\x05\x12\x12\n\x0eRESULT_TIMEOUT\x10\x06\x12\x1a\n\x16RESULT_NO_SETPOINT_SET\x10\x07\x32\xc7\t\n\x0fOffboardService\x12P\n\x05Start\x12!.mavsdk.rpc.offboard.StartRequest\x1a\".mavsdk.rpc.offboard.StartResponse\"\x00\x12M\n\x04Stop\x12 .mavsdk.rpc.offboard.StopRequest\x1a!.mavsdk.rpc.offboard.StopResponse\"\x00\x12]\n\x08IsActive\x12$.mavsdk.rpc.offboard.IsActiveRequest\x1a%.mavsdk.rpc.offboard.IsActiveResponse\"\x04\x80\xb5\x18\x01\x12\x66\n\x0bSetAttitude\x12\'.mavsdk.rpc.offboard.SetAttitudeRequest\x1a(.mavsdk.rpc.offboard.SetAttitudeResponse\"\x04\x80\xb5\x18\x01\x12{\n\x12SetActuatorControl\x12..mavsdk.rpc.offboard.SetActuatorControlRequest\x1a/.mavsdk.rpc.offboard.SetActuatorControlResponse\"\x04\x80\xb5\x18\x01\x12r\n\x0fSetAttitudeRate\x12+.mavsdk.rpc.offboard.SetAttitudeRateRequest\x1a,.mavsdk.rpc.offboard.SetAttitudeRateResponse\"\x04\x80\xb5\x18\x01\x12o\n\x0eSetPositionNed\x12*.mavsdk.rpc.offboard.SetPositionNedRequest\x1a+.mavsdk.rpc.offboard.SetPositionNedResponse\"\x04\x80\xb5\x18\x01\x12r\n\x0fSetVelocityBody\x12+.mavsdk.rpc.offboard.SetVelocityBodyRequest\x1a,.mavsdk.rpc.offboard.SetVelocityBodyResponse\"\x04\x80\xb5\x18\x01\x12o\n\x0eSetVelocityNed\x12*.mavsdk.rpc.offboard.SetVelocityNedRequest\x1a+.mavsdk.rpc.offboard.SetVelocityNedResponse\"\x04\x80\xb5\x18\x01\x12\x87\x01\n\x16SetPositionVelocityNed\x12\x32.mavsdk.rpc.offboard.SetPositionVelocityNedRequest\x1a\x33.mavsdk.rpc.offboard.SetPositionVelocityNedResponse\"\x04\x80\xb5\x18\x01\x12{\n\x12SetAccelerationNed\x12..mavsdk.rpc.offboard.SetAccelerationNedRequest\x1a/.mavsdk.rpc.offboard.SetAccelerationNedResponse\"\x04\x80\xb5\x18\x01\x42#\n\x12io.mavsdk.offboardB\rOffboardProtob\x06proto3' + serialized_pb=b'\n\x17offboard/offboard.proto\x12\x13mavsdk.rpc.offboard\x1a\x14mavsdk_options.proto\"\x0e\n\x0cStartRequest\"M\n\rStartResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"\r\n\x0bStopRequest\"L\n\x0cStopResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"\x11\n\x0fIsActiveRequest\"%\n\x10IsActiveResponse\x12\x11\n\tis_active\x18\x01 \x01(\x08\"E\n\x12SetAttitudeRequest\x12/\n\x08\x61ttitude\x18\x01 \x01(\x0b\x32\x1d.mavsdk.rpc.offboard.Attitude\"S\n\x13SetAttitudeResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"[\n\x19SetActuatorControlRequest\x12>\n\x10\x61\x63tuator_control\x18\x01 \x01(\x0b\x32$.mavsdk.rpc.offboard.ActuatorControl\"Z\n\x1aSetActuatorControlResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"R\n\x16SetAttitudeRateRequest\x12\x38\n\rattitude_rate\x18\x01 \x01(\x0b\x32!.mavsdk.rpc.offboard.AttitudeRate\"W\n\x17SetAttitudeRateResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"V\n\x15SetPositionNedRequest\x12=\n\x10position_ned_yaw\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.PositionNedYaw\"V\n\x16SetPositionNedResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"_\n\x18SetPositionGlobalRequest\x12\x43\n\x13position_global_yaw\x18\x01 \x01(\x0b\x32&.mavsdk.rpc.offboard.PositionGlobalYaw\"Y\n\x19SetPositionGlobalResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"c\n\x16SetVelocityBodyRequest\x12I\n\x16velocity_body_yawspeed\x18\x01 \x01(\x0b\x32).mavsdk.rpc.offboard.VelocityBodyYawspeed\"W\n\x17SetVelocityBodyResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"V\n\x15SetVelocityNedRequest\x12=\n\x10velocity_ned_yaw\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.VelocityNedYaw\"V\n\x16SetVelocityNedResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"\x9d\x01\n\x1dSetPositionVelocityNedRequest\x12=\n\x10position_ned_yaw\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.PositionNedYaw\x12=\n\x10velocity_ned_yaw\x18\x02 \x01(\x0b\x32#.mavsdk.rpc.offboard.VelocityNedYaw\"^\n\x1eSetPositionVelocityNedResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"[\n\x19SetAccelerationNedRequest\x12>\n\x10\x61\x63\x63\x65leration_ned\x18\x01 \x01(\x0b\x32$.mavsdk.rpc.offboard.AccelerationNed\"Z\n\x1aSetAccelerationNedResponse\x12<\n\x0foffboard_result\x18\x01 \x01(\x0b\x32#.mavsdk.rpc.offboard.OffboardResult\"V\n\x08\x41ttitude\x12\x10\n\x08roll_deg\x18\x01 \x01(\x02\x12\x11\n\tpitch_deg\x18\x02 \x01(\x02\x12\x0f\n\x07yaw_deg\x18\x03 \x01(\x02\x12\x14\n\x0cthrust_value\x18\x04 \x01(\x02\"(\n\x14\x41\x63tuatorControlGroup\x12\x10\n\x08\x63ontrols\x18\x01 \x03(\x02\"L\n\x0f\x41\x63tuatorControl\x12\x39\n\x06groups\x18\x01 \x03(\x0b\x32).mavsdk.rpc.offboard.ActuatorControlGroup\"`\n\x0c\x41ttitudeRate\x12\x12\n\nroll_deg_s\x18\x01 \x01(\x02\x12\x13\n\x0bpitch_deg_s\x18\x02 \x01(\x02\x12\x11\n\tyaw_deg_s\x18\x03 \x01(\x02\x12\x14\n\x0cthrust_value\x18\x04 \x01(\x02\"R\n\x0ePositionNedYaw\x12\x0f\n\x07north_m\x18\x01 \x01(\x02\x12\x0e\n\x06\x65\x61st_m\x18\x02 \x01(\x02\x12\x0e\n\x06\x64own_m\x18\x03 \x01(\x02\x12\x0f\n\x07yaw_deg\x18\x04 \x01(\x02\"\xfc\x01\n\x11PositionGlobalYaw\x12\x0f\n\x07lat_deg\x18\x01 \x01(\x01\x12\x0f\n\x07lon_deg\x18\x02 \x01(\x01\x12\r\n\x05\x61lt_m\x18\x03 \x01(\x02\x12\x0f\n\x07yaw_deg\x18\x04 \x01(\x02\x12J\n\raltitude_type\x18\x05 \x01(\x0e\x32\x33.mavsdk.rpc.offboard.PositionGlobalYaw.AltitudeType\"Y\n\x0c\x41ltitudeType\x12\x1a\n\x16\x41LTITUDE_TYPE_REL_HOME\x10\x00\x12\x16\n\x12\x41LTITUDE_TYPE_AMSL\x10\x01\x12\x15\n\x11\x41LTITUDE_TYPE_AGL\x10\x02\"h\n\x14VelocityBodyYawspeed\x12\x13\n\x0b\x66orward_m_s\x18\x01 \x01(\x02\x12\x11\n\tright_m_s\x18\x02 \x01(\x02\x12\x10\n\x08\x64own_m_s\x18\x03 \x01(\x02\x12\x16\n\x0eyawspeed_deg_s\x18\x04 \x01(\x02\"X\n\x0eVelocityNedYaw\x12\x11\n\tnorth_m_s\x18\x01 \x01(\x02\x12\x10\n\x08\x65\x61st_m_s\x18\x02 \x01(\x02\x12\x10\n\x08\x64own_m_s\x18\x03 \x01(\x02\x12\x0f\n\x07yaw_deg\x18\x04 \x01(\x02\"K\n\x0f\x41\x63\x63\x65lerationNed\x12\x12\n\nnorth_m_s2\x18\x01 \x01(\x02\x12\x11\n\teast_m_s2\x18\x02 \x01(\x02\x12\x11\n\tdown_m_s2\x18\x03 \x01(\x02\"\xa2\x02\n\x0eOffboardResult\x12:\n\x06result\x18\x01 \x01(\x0e\x32*.mavsdk.rpc.offboard.OffboardResult.Result\x12\x12\n\nresult_str\x18\x02 \x01(\t\"\xbf\x01\n\x06Result\x12\x12\n\x0eRESULT_UNKNOWN\x10\x00\x12\x12\n\x0eRESULT_SUCCESS\x10\x01\x12\x14\n\x10RESULT_NO_SYSTEM\x10\x02\x12\x1b\n\x17RESULT_CONNECTION_ERROR\x10\x03\x12\x0f\n\x0bRESULT_BUSY\x10\x04\x12\x19\n\x15RESULT_COMMAND_DENIED\x10\x05\x12\x12\n\x0eRESULT_TIMEOUT\x10\x06\x12\x1a\n\x16RESULT_NO_SETPOINT_SET\x10\x07\x32\xc1\n\n\x0fOffboardService\x12P\n\x05Start\x12!.mavsdk.rpc.offboard.StartRequest\x1a\".mavsdk.rpc.offboard.StartResponse\"\x00\x12M\n\x04Stop\x12 .mavsdk.rpc.offboard.StopRequest\x1a!.mavsdk.rpc.offboard.StopResponse\"\x00\x12]\n\x08IsActive\x12$.mavsdk.rpc.offboard.IsActiveRequest\x1a%.mavsdk.rpc.offboard.IsActiveResponse\"\x04\x80\xb5\x18\x01\x12\x66\n\x0bSetAttitude\x12\'.mavsdk.rpc.offboard.SetAttitudeRequest\x1a(.mavsdk.rpc.offboard.SetAttitudeResponse\"\x04\x80\xb5\x18\x01\x12{\n\x12SetActuatorControl\x12..mavsdk.rpc.offboard.SetActuatorControlRequest\x1a/.mavsdk.rpc.offboard.SetActuatorControlResponse\"\x04\x80\xb5\x18\x01\x12r\n\x0fSetAttitudeRate\x12+.mavsdk.rpc.offboard.SetAttitudeRateRequest\x1a,.mavsdk.rpc.offboard.SetAttitudeRateResponse\"\x04\x80\xb5\x18\x01\x12o\n\x0eSetPositionNed\x12*.mavsdk.rpc.offboard.SetPositionNedRequest\x1a+.mavsdk.rpc.offboard.SetPositionNedResponse\"\x04\x80\xb5\x18\x01\x12x\n\x11SetPositionGlobal\x12-.mavsdk.rpc.offboard.SetPositionGlobalRequest\x1a..mavsdk.rpc.offboard.SetPositionGlobalResponse\"\x04\x80\xb5\x18\x01\x12r\n\x0fSetVelocityBody\x12+.mavsdk.rpc.offboard.SetVelocityBodyRequest\x1a,.mavsdk.rpc.offboard.SetVelocityBodyResponse\"\x04\x80\xb5\x18\x01\x12o\n\x0eSetVelocityNed\x12*.mavsdk.rpc.offboard.SetVelocityNedRequest\x1a+.mavsdk.rpc.offboard.SetVelocityNedResponse\"\x04\x80\xb5\x18\x01\x12\x87\x01\n\x16SetPositionVelocityNed\x12\x32.mavsdk.rpc.offboard.SetPositionVelocityNedRequest\x1a\x33.mavsdk.rpc.offboard.SetPositionVelocityNedResponse\"\x04\x80\xb5\x18\x01\x12{\n\x12SetAccelerationNed\x12..mavsdk.rpc.offboard.SetAccelerationNedRequest\x1a/.mavsdk.rpc.offboard.SetAccelerationNedResponse\"\x04\x80\xb5\x18\x01\x42#\n\x12io.mavsdk.offboardB\rOffboardProtob\x06proto3' , dependencies=[mavsdk__options__pb2.DESCRIPTOR,]) +_POSITIONGLOBALYAW_ALTITUDETYPE = _descriptor.EnumDescriptor( + name='AltitudeType', + full_name='mavsdk.rpc.offboard.PositionGlobalYaw.AltitudeType', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='ALTITUDE_TYPE_REL_HOME', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='ALTITUDE_TYPE_AMSL', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='ALTITUDE_TYPE_AGL', index=2, number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=2555, + serialized_end=2644, +) +_sym_db.RegisterEnumDescriptor(_POSITIONGLOBALYAW_ALTITUDETYPE) + _OFFBOARDRESULT_RESULT = _descriptor.EnumDescriptor( name='Result', full_name='mavsdk.rpc.offboard.OffboardResult.Result', @@ -76,8 +106,8 @@ ], containing_type=None, serialized_options=None, - serialized_start=2576, - serialized_end=2767, + serialized_start=3019, + serialized_end=3210, ) _sym_db.RegisterEnumDescriptor(_OFFBOARDRESULT_RESULT) @@ -509,6 +539,70 @@ ) +_SETPOSITIONGLOBALREQUEST = _descriptor.Descriptor( + name='SetPositionGlobalRequest', + full_name='mavsdk.rpc.offboard.SetPositionGlobalRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='position_global_yaw', full_name='mavsdk.rpc.offboard.SetPositionGlobalRequest.position_global_yaw', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1006, + serialized_end=1101, +) + + +_SETPOSITIONGLOBALRESPONSE = _descriptor.Descriptor( + name='SetPositionGlobalResponse', + full_name='mavsdk.rpc.offboard.SetPositionGlobalResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='offboard_result', full_name='mavsdk.rpc.offboard.SetPositionGlobalResponse.offboard_result', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1103, + serialized_end=1192, +) + + _SETVELOCITYBODYREQUEST = _descriptor.Descriptor( name='SetVelocityBodyRequest', full_name='mavsdk.rpc.offboard.SetVelocityBodyRequest', @@ -536,8 +630,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1006, - serialized_end=1105, + serialized_start=1194, + serialized_end=1293, ) @@ -568,8 +662,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1107, - serialized_end=1194, + serialized_start=1295, + serialized_end=1382, ) @@ -600,8 +694,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1196, - serialized_end=1282, + serialized_start=1384, + serialized_end=1470, ) @@ -632,8 +726,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1284, - serialized_end=1370, + serialized_start=1472, + serialized_end=1558, ) @@ -671,8 +765,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1373, - serialized_end=1530, + serialized_start=1561, + serialized_end=1718, ) @@ -703,8 +797,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1532, - serialized_end=1626, + serialized_start=1720, + serialized_end=1814, ) @@ -735,8 +829,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1628, - serialized_end=1719, + serialized_start=1816, + serialized_end=1907, ) @@ -767,8 +861,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1721, - serialized_end=1811, + serialized_start=1909, + serialized_end=1999, ) @@ -820,8 +914,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1813, - serialized_end=1899, + serialized_start=2001, + serialized_end=2087, ) @@ -852,8 +946,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1901, - serialized_end=1941, + serialized_start=2089, + serialized_end=2129, ) @@ -884,8 +978,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1943, - serialized_end=2019, + serialized_start=2131, + serialized_end=2207, ) @@ -937,8 +1031,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2021, - serialized_end=2117, + serialized_start=2209, + serialized_end=2305, ) @@ -990,8 +1084,69 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2119, - serialized_end=2201, + serialized_start=2307, + serialized_end=2389, +) + + +_POSITIONGLOBALYAW = _descriptor.Descriptor( + name='PositionGlobalYaw', + full_name='mavsdk.rpc.offboard.PositionGlobalYaw', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='lat_deg', full_name='mavsdk.rpc.offboard.PositionGlobalYaw.lat_deg', index=0, + number=1, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='lon_deg', full_name='mavsdk.rpc.offboard.PositionGlobalYaw.lon_deg', index=1, + number=2, type=1, cpp_type=5, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='alt_m', full_name='mavsdk.rpc.offboard.PositionGlobalYaw.alt_m', index=2, + number=3, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='yaw_deg', full_name='mavsdk.rpc.offboard.PositionGlobalYaw.yaw_deg', index=3, + number=4, type=2, cpp_type=6, label=1, + has_default_value=False, default_value=float(0), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='altitude_type', full_name='mavsdk.rpc.offboard.PositionGlobalYaw.altitude_type', index=4, + number=5, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + _POSITIONGLOBALYAW_ALTITUDETYPE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2392, + serialized_end=2644, ) @@ -1043,8 +1198,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2203, - serialized_end=2307, + serialized_start=2646, + serialized_end=2750, ) @@ -1096,8 +1251,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2309, - serialized_end=2397, + serialized_start=2752, + serialized_end=2840, ) @@ -1142,8 +1297,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2399, - serialized_end=2474, + serialized_start=2842, + serialized_end=2917, ) @@ -1182,8 +1337,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2477, - serialized_end=2767, + serialized_start=2920, + serialized_end=3210, ) _STARTRESPONSE.fields_by_name['offboard_result'].message_type = _OFFBOARDRESULT @@ -1196,6 +1351,8 @@ _SETATTITUDERATERESPONSE.fields_by_name['offboard_result'].message_type = _OFFBOARDRESULT _SETPOSITIONNEDREQUEST.fields_by_name['position_ned_yaw'].message_type = _POSITIONNEDYAW _SETPOSITIONNEDRESPONSE.fields_by_name['offboard_result'].message_type = _OFFBOARDRESULT +_SETPOSITIONGLOBALREQUEST.fields_by_name['position_global_yaw'].message_type = _POSITIONGLOBALYAW +_SETPOSITIONGLOBALRESPONSE.fields_by_name['offboard_result'].message_type = _OFFBOARDRESULT _SETVELOCITYBODYREQUEST.fields_by_name['velocity_body_yawspeed'].message_type = _VELOCITYBODYYAWSPEED _SETVELOCITYBODYRESPONSE.fields_by_name['offboard_result'].message_type = _OFFBOARDRESULT _SETVELOCITYNEDREQUEST.fields_by_name['velocity_ned_yaw'].message_type = _VELOCITYNEDYAW @@ -1206,6 +1363,8 @@ _SETACCELERATIONNEDREQUEST.fields_by_name['acceleration_ned'].message_type = _ACCELERATIONNED _SETACCELERATIONNEDRESPONSE.fields_by_name['offboard_result'].message_type = _OFFBOARDRESULT _ACTUATORCONTROL.fields_by_name['groups'].message_type = _ACTUATORCONTROLGROUP +_POSITIONGLOBALYAW.fields_by_name['altitude_type'].enum_type = _POSITIONGLOBALYAW_ALTITUDETYPE +_POSITIONGLOBALYAW_ALTITUDETYPE.containing_type = _POSITIONGLOBALYAW _OFFBOARDRESULT.fields_by_name['result'].enum_type = _OFFBOARDRESULT_RESULT _OFFBOARDRESULT_RESULT.containing_type = _OFFBOARDRESULT DESCRIPTOR.message_types_by_name['StartRequest'] = _STARTREQUEST @@ -1222,6 +1381,8 @@ DESCRIPTOR.message_types_by_name['SetAttitudeRateResponse'] = _SETATTITUDERATERESPONSE DESCRIPTOR.message_types_by_name['SetPositionNedRequest'] = _SETPOSITIONNEDREQUEST DESCRIPTOR.message_types_by_name['SetPositionNedResponse'] = _SETPOSITIONNEDRESPONSE +DESCRIPTOR.message_types_by_name['SetPositionGlobalRequest'] = _SETPOSITIONGLOBALREQUEST +DESCRIPTOR.message_types_by_name['SetPositionGlobalResponse'] = _SETPOSITIONGLOBALRESPONSE DESCRIPTOR.message_types_by_name['SetVelocityBodyRequest'] = _SETVELOCITYBODYREQUEST DESCRIPTOR.message_types_by_name['SetVelocityBodyResponse'] = _SETVELOCITYBODYRESPONSE DESCRIPTOR.message_types_by_name['SetVelocityNedRequest'] = _SETVELOCITYNEDREQUEST @@ -1235,6 +1396,7 @@ DESCRIPTOR.message_types_by_name['ActuatorControl'] = _ACTUATORCONTROL DESCRIPTOR.message_types_by_name['AttitudeRate'] = _ATTITUDERATE DESCRIPTOR.message_types_by_name['PositionNedYaw'] = _POSITIONNEDYAW +DESCRIPTOR.message_types_by_name['PositionGlobalYaw'] = _POSITIONGLOBALYAW DESCRIPTOR.message_types_by_name['VelocityBodyYawspeed'] = _VELOCITYBODYYAWSPEED DESCRIPTOR.message_types_by_name['VelocityNedYaw'] = _VELOCITYNEDYAW DESCRIPTOR.message_types_by_name['AccelerationNed'] = _ACCELERATIONNED @@ -1339,6 +1501,20 @@ }) _sym_db.RegisterMessage(SetPositionNedResponse) +SetPositionGlobalRequest = _reflection.GeneratedProtocolMessageType('SetPositionGlobalRequest', (_message.Message,), { + 'DESCRIPTOR' : _SETPOSITIONGLOBALREQUEST, + '__module__' : 'offboard.offboard_pb2' + # @@protoc_insertion_point(class_scope:mavsdk.rpc.offboard.SetPositionGlobalRequest) + }) +_sym_db.RegisterMessage(SetPositionGlobalRequest) + +SetPositionGlobalResponse = _reflection.GeneratedProtocolMessageType('SetPositionGlobalResponse', (_message.Message,), { + 'DESCRIPTOR' : _SETPOSITIONGLOBALRESPONSE, + '__module__' : 'offboard.offboard_pb2' + # @@protoc_insertion_point(class_scope:mavsdk.rpc.offboard.SetPositionGlobalResponse) + }) +_sym_db.RegisterMessage(SetPositionGlobalResponse) + SetVelocityBodyRequest = _reflection.GeneratedProtocolMessageType('SetVelocityBodyRequest', (_message.Message,), { 'DESCRIPTOR' : _SETVELOCITYBODYREQUEST, '__module__' : 'offboard.offboard_pb2' @@ -1430,6 +1606,13 @@ }) _sym_db.RegisterMessage(PositionNedYaw) +PositionGlobalYaw = _reflection.GeneratedProtocolMessageType('PositionGlobalYaw', (_message.Message,), { + 'DESCRIPTOR' : _POSITIONGLOBALYAW, + '__module__' : 'offboard.offboard_pb2' + # @@protoc_insertion_point(class_scope:mavsdk.rpc.offboard.PositionGlobalYaw) + }) +_sym_db.RegisterMessage(PositionGlobalYaw) + VelocityBodyYawspeed = _reflection.GeneratedProtocolMessageType('VelocityBodyYawspeed', (_message.Message,), { 'DESCRIPTOR' : _VELOCITYBODYYAWSPEED, '__module__' : 'offboard.offboard_pb2' @@ -1468,8 +1651,8 @@ index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=2770, - serialized_end=3993, + serialized_start=3213, + serialized_end=4558, methods=[ _descriptor.MethodDescriptor( name='Start', @@ -1541,10 +1724,20 @@ serialized_options=b'\200\265\030\001', create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='SetPositionGlobal', + full_name='mavsdk.rpc.offboard.OffboardService.SetPositionGlobal', + index=7, + containing_service=None, + input_type=_SETPOSITIONGLOBALREQUEST, + output_type=_SETPOSITIONGLOBALRESPONSE, + serialized_options=b'\200\265\030\001', + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='SetVelocityBody', full_name='mavsdk.rpc.offboard.OffboardService.SetVelocityBody', - index=7, + index=8, containing_service=None, input_type=_SETVELOCITYBODYREQUEST, output_type=_SETVELOCITYBODYRESPONSE, @@ -1554,7 +1747,7 @@ _descriptor.MethodDescriptor( name='SetVelocityNed', full_name='mavsdk.rpc.offboard.OffboardService.SetVelocityNed', - index=8, + index=9, containing_service=None, input_type=_SETVELOCITYNEDREQUEST, output_type=_SETVELOCITYNEDRESPONSE, @@ -1564,7 +1757,7 @@ _descriptor.MethodDescriptor( name='SetPositionVelocityNed', full_name='mavsdk.rpc.offboard.OffboardService.SetPositionVelocityNed', - index=9, + index=10, containing_service=None, input_type=_SETPOSITIONVELOCITYNEDREQUEST, output_type=_SETPOSITIONVELOCITYNEDRESPONSE, @@ -1574,7 +1767,7 @@ _descriptor.MethodDescriptor( name='SetAccelerationNed', full_name='mavsdk.rpc.offboard.OffboardService.SetAccelerationNed', - index=10, + index=11, containing_service=None, input_type=_SETACCELERATIONNEDREQUEST, output_type=_SETACCELERATIONNEDRESPONSE, diff --git a/mavsdk/offboard_pb2_grpc.py b/mavsdk/offboard_pb2_grpc.py index a783e15c..835eaa42 100644 --- a/mavsdk/offboard_pb2_grpc.py +++ b/mavsdk/offboard_pb2_grpc.py @@ -58,6 +58,11 @@ def __init__(self, channel): request_serializer=offboard_dot_offboard__pb2.SetPositionNedRequest.SerializeToString, response_deserializer=offboard_dot_offboard__pb2.SetPositionNedResponse.FromString, ) + self.SetPositionGlobal = channel.unary_unary( + '/mavsdk.rpc.offboard.OffboardService/SetPositionGlobal', + request_serializer=offboard_dot_offboard__pb2.SetPositionGlobalRequest.SerializeToString, + response_deserializer=offboard_dot_offboard__pb2.SetPositionGlobalResponse.FromString, + ) self.SetVelocityBody = channel.unary_unary( '/mavsdk.rpc.offboard.OffboardService/SetVelocityBody', request_serializer=offboard_dot_offboard__pb2.SetVelocityBodyRequest.SerializeToString, @@ -156,6 +161,14 @@ def SetPositionNed(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def SetPositionGlobal(self, request, context): + """ + Set the position in Global coordinates (latitude, longitude, altitude) and yaw + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def SetVelocityBody(self, request, context): """ Set the velocity in body coordinates and yaw angular rate. Not available for fixed-wing aircraft. @@ -226,6 +239,11 @@ def add_OffboardServiceServicer_to_server(servicer, server): request_deserializer=offboard_dot_offboard__pb2.SetPositionNedRequest.FromString, response_serializer=offboard_dot_offboard__pb2.SetPositionNedResponse.SerializeToString, ), + 'SetPositionGlobal': grpc.unary_unary_rpc_method_handler( + servicer.SetPositionGlobal, + request_deserializer=offboard_dot_offboard__pb2.SetPositionGlobalRequest.FromString, + response_serializer=offboard_dot_offboard__pb2.SetPositionGlobalResponse.SerializeToString, + ), 'SetVelocityBody': grpc.unary_unary_rpc_method_handler( servicer.SetVelocityBody, request_deserializer=offboard_dot_offboard__pb2.SetVelocityBodyRequest.FromString, @@ -384,6 +402,23 @@ def SetPositionNed(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def SetPositionGlobal(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/mavsdk.rpc.offboard.OffboardService/SetPositionGlobal', + offboard_dot_offboard__pb2.SetPositionGlobalRequest.SerializeToString, + offboard_dot_offboard__pb2.SetPositionGlobalResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def SetVelocityBody(request, target, diff --git a/proto b/proto index 5b5bae46..11769a4e 160000 --- a/proto +++ b/proto @@ -1 +1 @@ -Subproject commit 5b5bae46bb332f0e28e7e9bd6bcfa006c4a8d44b +Subproject commit 11769a4ee6f3f9b0fef71532f773d40ab3e7d55c