Skip to content

Commit

Permalink
Merge pull request #294 from hrnbot/main
Browse files Browse the repository at this point in the history
0.35.0 MAVSDK Server based MAVSDK-Python
  • Loading branch information
JonasVautherin authored Jan 6, 2021
2 parents c16b040 + bbbdc44 commit 18636d7
Show file tree
Hide file tree
Showing 27 changed files with 603 additions and 116 deletions.
5 changes: 4 additions & 1 deletion MAVSDK_SERVER_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
v0.35.0
v0.35.1



2 changes: 1 addition & 1 deletion mavsdk/action.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import action_pb2, action_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/calibration.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import calibration_pb2, calibration_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/camera.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import camera_pb2, camera_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import core_pb2, core_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/failure.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import failure_pb2, failure_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/follow_me.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import follow_me_pb2, follow_me_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/ftp.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import ftp_pb2, ftp_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/geofence.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import geofence_pb2, geofence_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/gimbal.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import gimbal_pb2, gimbal_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/info.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import info_pb2, info_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/log_files.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import log_files_pb2, log_files_pb2_grpc
from enum import Enum
Expand Down
10 changes: 9 additions & 1 deletion mavsdk/manual_control.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import manual_control_pb2, manual_control_pb2_grpc
from enum import Enum
Expand Down Expand Up @@ -52,6 +52,9 @@ class Result(Enum):
INPUT_OUT_OF_RANGE
Input out of range
INPUT_NOT_SET
No Input set
"""


Expand All @@ -63,6 +66,7 @@ class Result(Enum):
COMMAND_DENIED = 5
TIMEOUT = 6
INPUT_OUT_OF_RANGE = 7
INPUT_NOT_SET = 8

def translate_to_rpc(self):
if self == ManualControlResult.Result.UNKNOWN:
Expand All @@ -81,6 +85,8 @@ def translate_to_rpc(self):
return manual_control_pb2.ManualControlResult.RESULT_TIMEOUT
if self == ManualControlResult.Result.INPUT_OUT_OF_RANGE:
return manual_control_pb2.ManualControlResult.RESULT_INPUT_OUT_OF_RANGE
if self == ManualControlResult.Result.INPUT_NOT_SET:
return manual_control_pb2.ManualControlResult.RESULT_INPUT_NOT_SET

@staticmethod
def translate_from_rpc(rpc_enum_value):
Expand All @@ -101,6 +107,8 @@ def translate_from_rpc(rpc_enum_value):
return ManualControlResult.Result.TIMEOUT
if rpc_enum_value == manual_control_pb2.ManualControlResult.RESULT_INPUT_OUT_OF_RANGE:
return ManualControlResult.Result.INPUT_OUT_OF_RANGE
if rpc_enum_value == manual_control_pb2.ManualControlResult.RESULT_INPUT_NOT_SET:
return ManualControlResult.Result.INPUT_NOT_SET

def __str__(self):
return self.name
Expand Down
15 changes: 10 additions & 5 deletions mavsdk/manual_control_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mavsdk/mission.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import mission_pb2, mission_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/mission_raw.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import mission_raw_pb2, mission_raw_pb2_grpc
from enum import Enum
Expand Down
2 changes: 1 addition & 1 deletion mavsdk/mocap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import mocap_pb2, mocap_pb2_grpc
from enum import Enum
Expand Down
38 changes: 37 additions & 1 deletion mavsdk/offboard.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# DO NOT EDIT! This file is auto-generated from
# https://github.com/mavlink/MAVSDK-Python/tree/master/other/templates/py
# https://github.com/mavlink/MAVSDK-Python/tree/main/other/templates/py
from ._base import AsyncBase
from . import offboard_pb2, offboard_pb2_grpc
from enum import Enum
Expand Down Expand Up @@ -1112,4 +1112,40 @@ async def set_velocity_ned(self, velocity_ned_yaw):

if result.result is not OffboardResult.Result.SUCCESS:
raise OffboardError(result, "set_velocity_ned()", velocity_ned_yaw)


async def set_position_velocity_ned(self, position_ned_yaw, velocity_ned_yaw):
"""
Set the position in NED coordinates, with the velocity to be used as feed-forward.
Parameters
----------
position_ned_yaw : PositionNedYaw
Position and yaw
velocity_ned_yaw : VelocityNedYaw
Velocity and yaw
Raises
------
OffboardError
If the request fails. The error contains the reason for the failure.
"""

request = offboard_pb2.SetPositionVelocityNedRequest()

position_ned_yaw.translate_to_rpc(request.position_ned_yaw)



velocity_ned_yaw.translate_to_rpc(request.velocity_ned_yaw)


response = await self._stub.SetPositionVelocityNed(request)


result = self._extract_result(response)

if result.result is not OffboardResult.Result.SUCCESS:
raise OffboardError(result, "set_position_velocity_ned()", position_ned_yaw, velocity_ned_yaw)

Loading

0 comments on commit 18636d7

Please sign in to comment.