Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class CalibrationError(Exception):
""" Raised when a CalibrationResult is a fail code """
def __init__(self, result, origin, *params):
self._result = result
self._origin = origin
self._params = params
def __str__(self):
return f"{self._result.result}: '{self._result.result_str}'; origin: {self._origin}; params: {self._params}"
class Calibration(AsyncBase):
"""
Enable to calibrate sensors of a drone such as gyro, accelerometer, and magnetometer.
Generated by dcsdkgen - MAVSDK Calibration API
"""
# Plugin name
name = "Calibration"
def _setup_stub(self, channel):
""" Setups the api stub """
self._stub = calibration_pb2_grpc.CalibrationServiceStub(channel)
def _extract_result(self, response):
""" Returns the response status and description """
class OffboardError(Exception):
""" Raised when a OffboardResult is a fail code """
def __init__(self, result, origin, *params):
self._result = result
self._origin = origin
self._params = params
def __str__(self):
return f"{self._result.result}: '{self._result.result_str}'; origin: {self._origin}; params: {self._params}"
class Offboard(AsyncBase):
"""
*
Control a drone with position, velocity, attitude or motor commands.
The module is called offboard because the commands can be sent from external sources
as opposed to onboard control right inside the autopilot "board".
Client code must specify a setpoint before starting offboard mode.
Mavsdk automatically sends setpoints at 20Hz (PX4 Offboard mode requires that setpoints
are minimally sent at 2Hz).
Generated by dcsdkgen - MAVSDK Offboard API
"""
# Plugin name
name = "Offboard"
class ShellError(Exception):
""" Raised when a ShellResult is a fail code """
def __init__(self, result, origin, *params):
self._result = result
self._origin = origin
self._params = params
def __str__(self):
return f"{self._result.result}: '{self._result.result_str}'; origin: {self._origin}; params: {self._params}"
class Shell(AsyncBase):
"""
*
Allow to communicate with the vehicle's system shell.
Generated by dcsdkgen - MAVSDK Shell API
"""
# Plugin name
name = "Shell"
def _setup_stub(self, channel):
""" Setups the api stub """
self._stub = shell_pb2_grpc.ShellServiceStub(channel)
def _extract_result(self, response):
class GimbalError(Exception):
""" Raised when a GimbalResult is a fail code """
def __init__(self, result, origin, *params):
self._result = result
self._origin = origin
self._params = params
def __str__(self):
return f"{self._result.result}: '{self._result.result_str}'; origin: {self._origin}; params: {self._params}"
class Gimbal(AsyncBase):
"""
Provide control over a gimbal.
Generated by dcsdkgen - MAVSDK Gimbal API
"""
# Plugin name
name = "Gimbal"
def _setup_stub(self, channel):
""" Setups the api stub """
self._stub = gimbal_pb2_grpc.GimbalServiceStub(channel)
def _extract_result(self, response):
""" Returns the response status and description """
class CameraError(Exception):
""" Raised when a CameraResult is a fail code """
def __init__(self, result, origin, *params):
self._result = result
self._origin = origin
self._params = params
def __str__(self):
return f"{self._result.result}: '{self._result.result_str}'; origin: {self._origin}; params: {self._params}"
class Camera(AsyncBase):
"""
Can be used to manage cameras that implement the MAVLink
Camera Protocol: https://mavlink.io/en/protocol/camera.html.
Currently only a single camera is supported.
When multiple cameras are supported the plugin will need to be
instantiated separately for every camera and the camera selected using
`select_camera`.
Generated by dcsdkgen - MAVSDK Camera API
"""
# Plugin name
name = "Camera"
def _setup_stub(self, channel):
class ParamError(Exception):
""" Raised when a ParamResult is a fail code """
def __init__(self, result, origin, *params):
self._result = result
self._origin = origin
self._params = params
def __str__(self):
return f"{self._result.result}: '{self._result.result_str}'; origin: {self._origin}; params: {self._params}"
class Param(AsyncBase):
"""
Provide raw access to get and set parameters.
Generated by dcsdkgen - MAVSDK Param API
"""
# Plugin name
name = "Param"
def _setup_stub(self, channel):
""" Setups the api stub """
self._stub = param_pb2_grpc.ParamServiceStub(channel)
def _extract_result(self, response):
""" Returns the response status and description """
class MissionError(Exception):
""" Raised when a MissionResult is a fail code """
def __init__(self, result, origin, *params):
self._result = result
self._origin = origin
self._params = params
def __str__(self):
return f"{self._result.result}: '{self._result.result_str}'; origin: {self._origin}; params: {self._params}"
class Mission(AsyncBase):
"""
Enable waypoint missions.
Generated by dcsdkgen - MAVSDK Mission API
"""
# Plugin name
name = "Mission"
def _setup_stub(self, channel):
""" Setups the api stub """
self._stub = mission_pb2_grpc.MissionServiceStub(channel)
def _extract_result(self, response):
""" Returns the response status and description """
class ActionError(Exception):
""" Raised when a ActionResult is a fail code """
def __init__(self, result, origin, *params):
self._result = result
self._origin = origin
self._params = params
def __str__(self):
return f"{self._result.result}: '{self._result.result_str}'; origin: {self._origin}; params: {self._params}"
class Action(AsyncBase):
"""
Enable simple actions such as arming, taking off, and landing.
Generated by dcsdkgen - MAVSDK Action API
"""
# Plugin name
name = "Action"
def _setup_stub(self, channel):
""" Setups the api stub """
self._stub = action_pb2_grpc.ActionServiceStub(channel)
def _extract_result(self, response):
""" Returns the response status and description """
rpcPluginInfo.address = self.address
rpcPluginInfo.port = self.port
class Core(AsyncBase):
"""
Access to the connection state and running plugins.
Generated by dcsdkgen - MAVSDK Core API
"""
# Plugin name
name = "Core"
def _setup_stub(self, channel):
""" Setups the api stub """
self._stub = core_pb2_grpc.CoreServiceStub(channel)
async def connection_state(self):
rpcActuatorOutputStatus.active = self.active
for elem in self.actuator:
rpcActuatorOutputStatus.actuator.append(elem)
class Telemetry(AsyncBase):
"""
Allow users to get vehicle telemetry and state information
(e.g. battery, GPS, RC connection, flight mode etc.) and set telemetry update rates.
Generated by dcsdkgen - MAVSDK Telemetry API
"""
# Plugin name
name = "Telemetry"
def _setup_stub(self, channel):
""" Setups the api stub """
self._stub = telemetry_pb2_grpc.TelemetryServiceStub(channel)