Git Product home page Git Product logo

mavsdk-python's Introduction

Build Status

MAVLink

MAVLink -- Micro Air Vehicle Message Marshalling Library.

MAVLink is a very lightweight, header-only message library for communication between drones and/or ground control stations. It consists primarily of message-set specifications for different systems ("dialects") defined in XML files, and Python tools that convert these into appropriate source code for supported languages. There are additional Python scripts providing examples and utilities for working with MAVLink data.

Tip MAVLink is very well suited for applications with very limited communication bandwidth. Its reference implementation in C is highly optimized for resource-constrained systems with limited RAM and flash memory. It is field-proven and deployed in many products where it serves as interoperability interface between components of different manufacturers.

Quick start

Generate C headers

To install the minimal MAVLink environment on Ubuntu LTS 20.04 or 22.04, enter the following on a terminal:

# Dependencies
sudo apt install python3-pip

# Clone mavlink into the directory of your choice
git clone https://github.com/mavlink/mavlink.git --recursive
cd mavlink

python3 -m pip install -r pymavlink/requirements.txt

You can then build the MAVLink2 C-library for message_definitions/v1.0/common.xml from the /mavlink directory as shown:

python3 -m pymavlink.tools.mavgen --lang=C --wire-protocol=2.0 --output=generated/include/mavlink/v2.0 message_definitions/v1.0/common.xml

Use from cmake

To include the headers in cmake, install them locally, e.g. into the directory install:

cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=install -DMAVLINK_DIALECT=common -DMAVLINK_VERSION=2.0
cmake --build build --target install

Then use find_package to get the dependency in CMakeLists.txt:

find_package(MAVLink REQUIRED)

add_executable(my_program my_program.c)

target_link_libraries(my_program PRIVATE MAVLink::mavlink)

And pass the local install directory to cmake (adapt to your directory structure):

cd ../my_program
cmake -Bbuild -H. -DCMAKE_PREFIX_PATH=../mavlink/install

For a full example, check examples/c.

Note: even though we use target_link_libraries in cmake, it doesn't actually "link" to MAVLink as it's just a header-only library.

Other instructions

Instructions for using the C libraries are then covered in Using C MAVLink Libraries (mavgen).

Note: Installing the MAVLink Toolchain explains how to install MAVLink on other Ubuntu platforms and Windows, while Generating MAVLink Libraries explains how to build MAVLink for the other programming languages supported by the project. The sub-topics of Using MAVLink Libraries explain how to use the generated libraries.

Key Links

mavsdk-python's People

Contributors

arpitpara avatar bbworld1 avatar coderkalyan avatar cswkim avatar danylevskyi avatar dayjaby avatar dlech avatar donatellox avatar dopplegangster avatar farhangnaderi avatar griffinmack avatar hamishwillee avatar hrnbot avatar irsdkv avatar jonasvautherin avatar julianblanco avatar julianoes avatar lyraik avatar mattes-bru avatar muhammadbilal1 avatar muramura avatar nicolasm0 avatar petergerten avatar potaito avatar qthibeault avatar shafspecs avatar thesharad avatar tsc21 avatar woosal1337 avatar xvzf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mavsdk-python's Issues

MAVSDK-Python 0.3.0 not available on pip for macOS

For some reason, I can't upgrade to mavsdk 0.3.0.

Whenever I try pip install mavsdk or pip install --upgrade mavsdk, it only gives me version 0.2.0. I've also tried --force-reinstall, but it still installs 0.2.0.

When I run pip install mavsdk==0.3.0 it says:

"RROR: Could not find a version that satisfies the requirement mavsdk==0.3.0 (from versions: 0.1.0, 0.2.0)
ERROR: No matching distribution found for mavsdk==0.3.0"

Yet, if I run pip search mavsdk, it shows the latest version is indeed 0.3.0 and that I have the 0.2.0 version installed.

Provide an arm64 version on PyPI

Currently there are just versions of the mavsdk package in PyPI for linux, windows and macOS using the x86_64/ amd64 architecture. Is it possible to also provide a linux version for arm64 and armhf (older raspberry pi).

And maybe you should add to the pip readme section, what operating systems and processor architectures are supported, so you don't have to dig through the pip verbose output to find, what the issue really is.

Thanks

Abstract away gRPC errors

As reported in #49, the way we handle gRPC errors is not elegant (and leaking gRPC to the user.

For instance, this is the output if the backend is not reachable:

[ ERROR] <_Rendezvous of RPC that terminated with:
        status = StatusCode.UNAVAILABLE
        details = "Name resolution failure"
        debug_error_string = "{"created":"@1550220055.531945000","description":"Failed to create subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":2261,"referenced_errors":[{"created":"@1550220055.531943000","description":"Name resolution failure","file":"src/core/ext/filters/client_channel/request_routing.cc","file_line":163,"grpc_status":14}]}"
>
Traceback (most recent call last):
File "/Users/docs/boulot/controleur/controleur/Autopilot.py", line 68, in connect
autopilot_type = await Autopilot.vehicle.info.get_version()
File "/Users/docs/boulot/controleur/controleur/Libs/DronecodeSDK-Python/dronecode_sdk/plugins/info.py", line 288, in get_version
response = await self._stub.GetVersion(request)
File "/Users/.local/share/virtualenvs/controleur-7At54XPt/lib/python3.6/site-packages/aiogrpc/channel.py", line 40, in __call__
return await fut
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
        status = StatusCode.UNAVAILABLE
        details = "Name resolution failure"
        debug_error_string = "{"created":"@1550220055.531945000","description":"Failed to create subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":2261,"referenced_errors":[{"created":"@1550220055.531943000","description":"Name resolution failure","file":"src/core/ext/filters/client_channel/request_routing.cc","file_line":163,"grpc_status":14}]}"
>

As mentioned by @zulufoxtrot, the error can be handled with something like:

except grpc.RpcError as e:
logger.exception("Exception in telemetry handler: ")

if e._state.code == grpc.StatusCode.UNAVAILABLE:
logger.error("DronecodeSDK backend is unreacheable.")

We should probably handle that inside the SDK and raise a proper exception when that happens.

Error - No module named SDK

Hi,
We are having issues with the Python-wrapper. We have the wrapper installed in the MAVSDK src folder, upgraded to python3.7 from 3.5 to run it, and we keep getting a "No module named MAVSDK" error message. Please see the output below, and any assistance is greatly appreciated.

Python 3.7.2 (default, Jul 28 2019, 17:34:51)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.

This console is running in an asyncio event loop.
It allows you to wait for coroutines using the 'await' syntax.
Try: await asyncio.sleep(1, result=3)

from mavsdk import connect
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aioconsole-0.1.15.dev0-py3.7.egg/aioconsole/execute.py", line 95, in aexec
result, new_local = yield from coro
File "", line 2, in __corofn
ModuleNotFoundError: No module named 'mavsdk'
import mavsdk
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aioconsole-0.1.15.dev0-py3.7.egg/aioconsole/execute.py", line 95, in aexec
result, new_local = yield from coro
File "", line 2, in __corofn
ModuleNotFoundError: No module named 'mavsdk'

Get single latest telemetry item

Is there a way to make a call to just get the latest telemetry (e.g. position)? I'd rather not create an entire co-routine using async for position in drone.telemetry.position(): syntax.

It seems that currently, drone.telemetry.position() uses yield rather than return so thenext() data point will not be the latest, but will be the first one since the last time it was called.

UDP, serial port connection

I installed mavsdk(0.2.0) at Python3.6(/usr/bin/python3.6) using pip.
And I start 2 SITL(jmavsim), one drone has udp:127.0.0.1:14540, the other drone has udp:127.0.0.1:14541.
The problem is that when I do

start_mavlink()
drone = mavsdk_connect(host="127.0.0.1")

It works well with the drone using 14540 port. (When I put "127.0.0.1:14540", it shows error)

But I also wanted to connect with 14541, but it shows error. (host="127.0.0.1:14541")
And
I connected actual drone (Yuneec H520, pixhawk4 1.8.0) with command
drone = mavsdk_connect(host="serial:///dev/ttyACM0")
it also didn't work. I checked the actual drone is using /dev/ttyACM0.

How can I solve this??

run_protoc.sh is broken

The run_protoc.sh seems to find files as directories

~/github/dronecore/DroneCore-Python$ ./tools/run_protoc.sh
cp: cannot stat '/home/ubuntu/github/dronecore/DroneCore-Python/tools/../proto/README.md/*.proto': Not a directory
/home/ubuntu/github/dronecore/DroneCore-Python/tools/../src/dronecore_README.md/dronecore_README.md/*.proto: No such file or directory

SyntaxError: protoc-gen-cu

Hello,

I've been trying to install the python wrapper as stated here: DronecodeSDK-Python README.md

Everything works fine until using the helper script to generate the wrapper. As soon as I start it, I get the following error log:

eve@eve-ThinkPad-X1-Carbon-3rd:~/Downloads/DronecodeSDK-Python$ ./other/tools/run_protoc.sh 
[+] Installing the DronecodeSDK autogenerator
Processing /home/eve/Downloads/DronecodeSDK-Python/proto/pb_plugins
Collecting protobuf (from dcsdkgen===0.1a0)
  Using cached https://files.pythonhosted.org/packages/81/59/c7b0815a78fd641141f24a6ece878293eae6bf1fce40632a6ab9672346aa/protobuf-3.7.1-cp35-cp35m-manylinux1_x86_64.whl
Collecting jinja2 (from dcsdkgen===0.1a0)
  Using cached https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl
Collecting six>=1.9 (from protobuf->dcsdkgen===0.1a0)
  Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting setuptools (from protobuf->dcsdkgen===0.1a0)
  Using cached https://files.pythonhosted.org/packages/d1/6a/4b2fcefd2ea0868810e92d519dacac1ddc64a2e53ba9e3422c3b62b378a6/setuptools-40.8.0-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from jinja2->dcsdkgen===0.1a0)
  Using cached https://files.pythonhosted.org/packages/6e/57/d40124076756c19ff2269678de7ae25a14ebbb3f6314eb5ce9477f191350/MarkupSafe-1.1.1-cp35-cp35m-manylinux1_x86_64.whl
Installing collected packages: six, setuptools, protobuf, MarkupSafe, jinja2, dcsdkgen
  Running setup.py install for dcsdkgen ... done
Successfully installed MarkupSafe-1.1.1 dcsdkgen-0.1a0 jinja2-2.10 protobuf-3.7.1 setuptools-40.8.0 six-1.12.0
You are using pip version 8.1.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[+] Done
[+] Generating plugins from 
 -> [+] Generated protobuf and gRPC bindings for gimbal
Traceback (most recent call last):
  File "/home/eve/.local/bin/dcsdkgen", line 11, in <module>
    load_entry_point('dcsdkgen==0.1a0', 'console_scripts', 'dcsdkgen')()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/__init__.py", line 5, in <module>
    from .autogen import AutoGen
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/autogen.py", line 64
    f.name = f"{plugin_name}.{params['file_ext']}"
                                                 ^
SyntaxError: invalid syntax
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: Aufruf von stat für '/home/eve/Downloads/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Gimbal.py' nicht möglich: Datei oder Verzeichnis nicht gefunden
 -> [+] Generated plugin for gimbal
 -> [+] Generated protobuf and gRPC bindings for core
Traceback (most recent call last):
  File "/home/eve/.local/bin/dcsdkgen", line 11, in <module>
    load_entry_point('dcsdkgen==0.1a0', 'console_scripts', 'dcsdkgen')()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/__init__.py", line 5, in <module>
    from .autogen import AutoGen
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/autogen.py", line 64
    f.name = f"{plugin_name}.{params['file_ext']}"
                                                 ^
SyntaxError: invalid syntax
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: Aufruf von stat für '/home/eve/Downloads/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Core.py' nicht möglich: Datei oder Verzeichnis nicht gefunden
 -> [+] Generated plugin for core
 -> [+] Generated protobuf and gRPC bindings for info
Traceback (most recent call last):
  File "/home/eve/.local/bin/dcsdkgen", line 11, in <module>
    load_entry_point('dcsdkgen==0.1a0', 'console_scripts', 'dcsdkgen')()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/__init__.py", line 5, in <module>
    from .autogen import AutoGen
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/autogen.py", line 64
    f.name = f"{plugin_name}.{params['file_ext']}"
                                                 ^
SyntaxError: invalid syntax
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: Aufruf von stat für '/home/eve/Downloads/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Info.py' nicht möglich: Datei oder Verzeichnis nicht gefunden
 -> [+] Generated plugin for info
 -> [+] Generated protobuf and gRPC bindings for discovery
Traceback (most recent call last):
  File "/home/eve/.local/bin/dcsdkgen", line 11, in <module>
    load_entry_point('dcsdkgen==0.1a0', 'console_scripts', 'dcsdkgen')()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/__init__.py", line 5, in <module>
    from .autogen import AutoGen
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/autogen.py", line 64
    f.name = f"{plugin_name}.{params['file_ext']}"
                                                 ^
SyntaxError: invalid syntax
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: Aufruf von stat für '/home/eve/Downloads/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Discovery.py' nicht möglich: Datei oder Verzeichnis nicht gefunden
 -> [+] Generated plugin for discovery
 -> [+] Generated protobuf and gRPC bindings for calibration
^CTraceback (most recent call last):
  File "/home/eve/.local/bin/dcsdkgen", line 11, in <module>
    load_entry_point('dcsdkgen==0.1a0', 'console_scripts', 'dcsdkgen')()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/__init__.py", line 5, in <module>
    from .autogen import AutoGen
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/autogen.py", line 64
    f.name = f"{plugin_name}.{params['file_ext']}"
                                                 ^
SyntaxError: invalid syntax
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 15, in <module>
    import xml.dom, xml.dom.minidom
KeyboardInterrupt

Original exception was:
Traceback (most recent call last):
  File "/home/eve/.local/bin/dcsdkgen", line 11, in <module>
    load_entry_point('dcsdkgen==0.1a0', 'console_scripts', 'dcsdkgen')()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/__init__.py", line 5, in <module>
    from .autogen import AutoGen
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/autogen.py", line 64
    f.name = f"{plugin_name}.{params['file_ext']}"
                                                 ^
SyntaxError: invalid syntax
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/eve/.local/lib/python3.5/site-packages/grpc_tools/protoc.py", line 36, in <module>
    sys.exit(main(sys.argv + ['-I{}'.format(proto_include)]))
  File "/home/eve/.local/lib/python3.5/site-packages/grpc_tools/protoc.py", line 31, in main
    return _protoc_compiler.run_main(command_arguments)
KeyboardInterrupt
mv: Aufruf von stat für '/home/eve/Downloads/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Calibration.py' nicht möglich: Datei oder Verzeichnis nicht gefunden
 -> [+] Generated plugin for calibration
 -> [+] Generated protobuf and gRPC bindings for mission
Traceback (most recent call last):
  File "/home/eve/.local/bin/dcsdkgen", line 11, in <module>
    load_entry_point('dcsdkgen==0.1a0', 'console_scripts', 'dcsdkgen')()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/__init__.py", line 5, in <module>
    from .autogen import AutoGen
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/autogen.py", line 64
    f.name = f"{plugin_name}.{params['file_ext']}"
                                                 ^
SyntaxError: invalid syntax
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: Aufruf von stat für '/home/eve/Downloads/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Mission.py' nicht möglich: Datei oder Verzeichnis nicht gefunden
 -> [+] Generated plugin for mission
 -> [+] Generated protobuf and gRPC bindings for camera
Traceback (most recent call last):
  File "/home/eve/.local/bin/dcsdkgen", line 11, in <module>
    load_entry_point('dcsdkgen==0.1a0', 'console_scripts', 'dcsdkgen')()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/__init__.py", line 5, in <module>
    from .autogen import AutoGen
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/autogen.py", line 64
    f.name = f"{plugin_name}.{params['file_ext']}"
                                                 ^
SyntaxError: invalid syntax
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: Aufruf von stat für '/home/eve/Downloads/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Camera.py' nicht möglich: Datei oder Verzeichnis nicht gefunden
 -> [+] Generated plugin for camera
 -> [+] Generated protobuf and gRPC bindings for action
Traceback (most recent call last):
  File "/home/eve/.local/bin/dcsdkgen", line 11, in <module>
    load_entry_point('dcsdkgen==0.1a0', 'console_scripts', 'dcsdkgen')()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/__init__.py", line 5, in <module>
    from .autogen import AutoGen
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/autogen.py", line 64
    f.name = f"{plugin_name}.{params['file_ext']}"
                                                 ^
SyntaxError: invalid syntax
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: Aufruf von stat für '/home/eve/Downloads/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Action.py' nicht möglich: Datei oder Verzeichnis nicht gefunden
 -> [+] Generated plugin for action
 -> [+] Generated protobuf and gRPC bindings for telemetry
Traceback (most recent call last):
  File "/home/eve/.local/bin/dcsdkgen", line 11, in <module>
    load_entry_point('dcsdkgen==0.1a0', 'console_scripts', 'dcsdkgen')()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2793, in load_entry_point
    return ep.load()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2411, in load
    return self.resolve()
  File "/home/eve/.local/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2417, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/__init__.py", line 5, in <module>
    from .autogen import AutoGen
  File "/home/eve/.local/lib/python3.5/site-packages/dcsdkgen/autogen.py", line 64
    f.name = f"{plugin_name}.{params['file_ext']}"
                                                 ^
SyntaxError: invalid syntax
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: Aufruf von stat für '/home/eve/Downloads/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Telemetry.py' nicht möglich: Datei oder Verzeichnis nicht gefunden
 -> [+] Generated plugin for telemetry
[+] Done

I guess it's an error to protoc-gen-custom, but I'm quite new to ubuntu and not sure how to fix this. Can anyone maybe assist?

Packaging with backend

Summarizing slack discussions with @xvzf @julianoes @mrpollo.

The python wrappers connect to the backend (a C++ binary), which in turns connects over mavlink to the drone. Using the python wrappers therefore requires to have an instance of the backend running. Building the backend is not trivial and not convenient on some environments (typically a companion computer without a build toolchain and with low computational power).

The question here is the following: how do we package the python wrappers together with the backend, so that a user can simply pip install the SDK and start using it?

Because the backend is a C++ library, it needs to be built for the different supported platforms (i.e. we cannot have one universal binary that would work everywhere).

We thought about a few solutions:

  1. We give the responsibility to the user (who can build or install the backend somehow), and distribute the python wrappers over pip.
  2. We build the backend for the platforms we support and distribute that through the platform's package manager (be it apt, homebrew, etc).
  3. We build the backend for the platforms we support and distribute that with pip.

We tend to like the last two solutions better, because it makes it easier for a user to get started. 2) requires us to maintain different package managers, while 3) goes exclusively through pip.

One question comes with 3), though: can/should we make a binary that would work for all (/most) linux distributions? It would imply statically linking all the system libraries that are not common to all (/most) linux distributions.

Examples need more instructions

I tried to build the examples in a virtual env named mytemp. Followed build instructions and end up with pip list as below.

(mytemp) ubuntu@ubuntu:~/github/dronecore/3test/DroneCore-Python/examples$ pip list
Package             Version    
------------------- -----------
dronecore-action    0.2        
dronecore-core      0.2        
dronecore-mission   0.2        
dronecore-telemetry 0.2        
enum34              1.1.6      
futures             3.2.0      
grpcio              1.11.0     
grpcio-tools        1.11.0     
pip                 10.0.1     
pkg-resources       0.0.0      
protobuf            3.5.2.post1
setuptools          39.1.0     
six                 1.11.0     
wheel               0.31.1     
  1. When I try running any example script I get the error No module named dronecore_core.core_pb2
    Traceback (most recent call last):
      File "sync_client.py", line 7, in <module>
        import dronecore_core.core_pb2 as dc_core
    ImportError: No module named dronecore_core.core_pb2
    
  2. How do I set up the vehicle? Ie can I use SITL? Do I need to set up anything to tell the client about the MAV system id I want to connect to? Can I use a real device over serial?

Upshot, how are these examples supposed to be run?

`NameError: name 'e' is not defined` when running example

I'm now getting this error after running example/takeoff_and_land.py

Traceback (most recent call last):
  File "examples/takeoff_and_land.py", line 5, in <module>
    from dronecode_sdk import connect as dronecode_sdk_connect
  File "/Users/myuser/Desktop/dronecodesdk-python/dronecode_sdk/__init__.py", line 48, in <module>
    from .plugins import * # NOQA
  File "/Users/myuser/Desktop/dronecodesdk-python/dronecode_sdk/plugins/__init__.py", line 1, in <module>
    -e # -*- coding: utf-8 -*-
NameError: name 'e' is not defined

Here is the entire log for everything I'm doing, hope this helps. I want to add that this is on a fresh install of MacOS on a MacBook Air.

Originally posted by @unipheas in #68 (comment)

KeyError: 'Action' when running example script

I just completed the build of DronecodeSDK-Python as per directions I got from the dev team. I did all the updates and installed Python 3.6, and everything appeared to install OK.

The GUI runs and I can get the drone to takeoff and land with manual commands. The backend is installed and works fine. But I just can't get the script to run. I tried to run the sample script but it threw an error. Can someone look at this and see what the problem might be?

Thanks,
Joe

joe-pl@joe-PL:/src/DronecodeSDK/DronecodeSDK-Python$  python3.6 examples/takeoff_and_land.py
Traceback (most recent call last):
  File "examples/takeoff_and_land.py", line 7, in <module>
    drone = dronecode_sdk_connect(host="127.0.0.1")
  File "/src/DronecodeSDK/DronecodeSDK-Python/dronecode_sdk/__init__.py", line 49, in connect
    globals()[plugin](plugin_manager)
KeyError: 'Action'

Support for import_qgroundcontrol_mission

Hi,

it seems there is currently no support for the import_qgroundcontrol_mission() method.
I am a bit confused on how this works. If the wrapper is auto-generated, wouldn't it have the same functionality as the "main" MAVSDK?

Peter

Offboard Mode Problem (status = StatusCode.UNIMPLEMENTED)

Hello I' tried to switch offboard mode from examples/offboard.py by running examples/offboard.py in PX4 Sitl gazebo v1.9.0.

But I got following error:

bozkurthan@bozkurthan:~/Desktop/MAVSDK-Python-master$ python3 examples/offboard.py
-- Arming
-- Setting initial setpoint
Traceback (most recent call last):
File "examples/offboard.py", line 217, in <module>
loop.run_until_complete(run_offb_ctrl_velocity_ned())
File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "examples/offboard.py", line 38, in run_offb_ctrl_velocity_ned
await drone.offboard.set_velocity_ned(VelocityNEDYaw(0.0, 0.0, 0.0, 0.0))
File "/home/bozkurthan/.local/lib/python3.6/site-packages/mavsdk/plugins/offboard.py", line 704, in set_velocity_ned
response = await self._stub.SetVelocityNed(request)
File "/home/bozkurthan/.local/lib/python3.6/site-packages/aiogrpc/channel.py", line 40, in __call__
return await fut
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
        status = StatusCode.UNIMPLEMENTED
        details = ""
        debug_error_string = "{"created":"@1561876519.775117151","description":"Error received from peer ipv4:127.0.0.1:50051","file":"src/core/lib/surface/call.cc","file_line":1046,"grpc_message":"","grpc_status":12}"
>

I tried to run with python3 examples/offboard.py as well but same error appeared. examples/takeoff_and_land.py worked without error.
By the way, I installed MAVSDK with pip3.

Thanks for helping

Can't sync with DroneCore-Proto submodule on Ubuntu

I get the following error:

~/github/dronecore/DroneCore-Python$ git submodule update
Cloning into 'proto'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of '[email protected]:dronecore/DroneCore-Proto.git' into submodule path 'proto' failed

I can separately clone DroneCore-Proto repo

./other/tools/run_protoc.sh got empty plugins direction on macOS

➜  DronecodeSDK-Python git:(master) ✗ ./other/tools/run_protoc.sh
Successfully installed dcsdkgen-0.1a0
[+] Done
[+] Generating plugins from
 -> [+] Generated protobuf and gRPC bindings for gimbal
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/huibean/Work/DronecodeSDK-Python/other/tools/../../dronecode_sdk/plugins/Gimbal.py to /Users/huibean/Work/DronecodeSDK-Python/other/tools/../../dronecode_sdk/plugins/gimbal.py: No such file or directory
 -> [+] Generated plugin for gimbal
 -> [+] Generated protobuf and gRPC bindings for core
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1
➜  DronecodeSDK-Python git:(master) ipython3 examples/takeoff_and_land.py
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
~/Work/DronecodeSDK-Python/examples/takeoff_and_land.py in <module>()
      3 import asyncio
      4
----> 5 from dronecode_sdk import connect as dronecode_sdk_connect
      6
      7 drone = dronecode_sdk_connect(host="127.0.0.1")

~/Work/DronecodeSDK-Python/dronecode_sdk/__init__.py in <module>()
     36 # Plugins rely on the eventloop
     37 from .async_plugin_manager import AsyncPluginManager
---> 38 from .plugins import *
     39
     40

~/Work/DronecodeSDK-Python/dronecode_sdk/plugins/__init__.py in <module>()
      1 # -*- coding: utf-8 -*-
      2
----> 3 from .gimbal import *
      4 from .core import *
      5 from .calibration import *

ModuleNotFoundError: No module named 'dronecode_sdk.plugins.gimbal'```

How can I use MAVSDK with an existing blocking library (i.e. not based on asyncio)?

Say, I have a camera(OpenMV), I can get some data from that camera.

I need to fly the drone according to the real-time data transferred from the camera sensor.

The problem is MAVSDK-Python is asynchronous, but the camera program is synchronous.

Since MAVSDK-Python doesn't have any documentation, meanwhile the example of this use case is not covered, I really don't know how to make it happen.

zlib not found in dockcross compilation

I tried to build for arm64 but it failed to find zlib:

docker run --rm dockcross/linux-arm64 > ./dockcross-linux-arm64
chmod +x dockcross-linux-arm64
./dockcross-linux-arm64 cmake -Bbuild -S. -DBUILD_BACKEND=ON
./dockcross-linux-arm64 cmake --build build

The output was:

-- The C compiler identification is GNU 4.9.4
-- The CXX compiler identification is GNU 4.9.4
-- Check for working C compiler: /usr/xcc/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc
-- Check for working C compiler: /usr/xcc/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/xcc/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-g++
-- Check for working CXX compiler: /usr/xcc/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at cmake/zlib.cmake:42 (find_package):
  Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
  Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  CMake variable ZLIB_ROOT is set to:

    /work/build/third_party/install

  For compatibility, CMake is ignoring the variable.
Call Stack (most recent call first):
  CMakeLists.txt:140 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.13/Modules/FindZLIB.cmake:114 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  cmake/zlib.cmake:42 (find_package)
  CMakeLists.txt:140 (include)


-- Configuring incomplete, errors occurred!

encoding into SDK and sending mavlink messages to the drone.

I have already imported a teleoperation package from github which uses keyboard and written in python also I think that I should use the offboard mode for my task but I don't know how I can encode this teleoperation package into SDK and how to send this mavlink message to the drone.

Failed to build and run.

******@******:/media/salimterryli/dev-linux/px4/DronecodeSDK-Python/examples$ python3 takeoff_and_land.py Traceback (most recent call last): File "takeoff_and_land.py", line 5, in <module> from dronecode_sdk import connect as dronecode_sdk_connect File "/media/salimterryli/dev-linux/px4/DronecodeSDK-Python/dronecode_sdk/__init__.py", line 48, in <module> from .plugins import * # NOQA File "/media/salimterryli/dev-linux/px4/DronecodeSDK-Python/dronecode_sdk/plugins/__init__.py", line 3, in <module> from .core import * ModuleNotFoundError: No module named 'dronecode_sdk.plugins.core'
It seems not be installed correctly. Actually, when I execute ./other/tools/run_protoc.sh it complains about wrong path.
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" WORK_DIR="${SCRIPT_DIR}/../../" PROTO_DIR="${WORK_DIR}proto" GENERATED_DIR="${WORK_DIR}dronecode_sdk/generated" PLUGIN_DIR="${WORK_DIR}dronecode_sdk/plugins" PLUGIN_INIT="${PLUGIN_DIR}/__init__.py" export TEMPLATE_PATH="${WORK_DIR}/other/templates/"
This modification works but there is nothing in the dir at all.

Troubles installing on macOS

I'm trying to set this up on macOS but I'm getting some errors.

I've installed the requirements like this:

python3 -m pip install --user grpcio grpcio-tools
python3 -m pip install --user protobuf
python3 -m pip install --user aiogrpc
python3 -m pip install --user grpcio

Then I tried this script:

./other/tools/run_protoc.sh

[+] Installing the DronecodeSDK autogenerator
Processing /Users/julianoes/src/DronecodeSDK-Python/proto/pb_plugins
Requirement already satisfied: protobuf in /Users/julianoes/Library/Python/3.7/lib/python/site-packages (from dcsdkgen==0.1a0) (3.6.1)
Requirement already satisfied: jinja2 in /Users/julianoes/Library/Python/3.7/lib/python/site-packages (from dcsdkgen==0.1a0) (2.10)
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/site-packages (from protobuf->dcsdkgen==0.1a0) (40.0.0)
Requirement already satisfied: six>=1.9 in /Users/julianoes/Library/Python/3.7/lib/python/site-packages (from protobuf->dcsdkgen==0.1a0) (1.11.0)
Requirement already satisfied: MarkupSafe>=0.23 in /Users/julianoes/Library/Python/3.7/lib/python/site-packages (from jinja2->dcsdkgen==0.1a0) (1.0)
Building wheels for collected packages: dcsdkgen
  Running setup.py bdist_wheel for dcsdkgen: started
  Running setup.py bdist_wheel for dcsdkgen: finished with status 'done'
  Stored in directory: /private/var/folders/6h/nc4rf_dj3bdd9_0yz7vgtwb00000gn/T/pip-ephem-wheel-cache-dr7a4pnl/wheels/76/58/d2/7a926efaca7b5a6468f13775931776959adf41f3b2ee2a4edc
Successfully built dcsdkgen
Installing collected packages: dcsdkgen
  Found existing installation: dcsdkgen 0.1a0
    Uninstalling dcsdkgen-0.1a0:
      Successfully uninstalled dcsdkgen-0.1a0
  The script dcsdkgen is installed in '/Users/julianoes/Library/Python/3.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed dcsdkgen-0.1a0
[+] Done
[+] Generating plugins from 
sed: -i: No such file or directory
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import gimbal_pb2 as gimbal__pb2


class GimbalServiceStub(object):
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.SetPitchAndYaw = channel.unary_unary(
        '/dronecode_sdk.rpc.gimbal.GimbalService/SetPitchAndYaw',
        request_serializer=gimbal__pb2.SetPitchAndYawRequest.SerializeToString,
        response_deserializer=gimbal__pb2.SetPitchAndYawResponse.FromString,
        )


class GimbalServiceServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def SetPitchAndYaw(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_GimbalServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'SetPitchAndYaw': grpc.unary_unary_rpc_method_handler(
          servicer.SetPitchAndYaw,
          request_deserializer=gimbal__pb2.SetPitchAndYawRequest.FromString,
          response_serializer=gimbal__pb2.SetPitchAndYawResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'dronecode_sdk.rpc.gimbal.GimbalService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
 -> [+] Generated protobuf and gRPC bindings for gimbal
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Gimbal.py to /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/gimbal.py: No such file or directory
 -> [+] Generated plugin for gimbal
sed: -i: No such file or directory
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import core_pb2 as core__pb2


class CoreServiceStub(object):
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.SubscribeDiscover = channel.unary_stream(
        '/dronecode_sdk.rpc.core.CoreService/SubscribeDiscover',
        request_serializer=core__pb2.SubscribeDiscoverRequest.SerializeToString,
        response_deserializer=core__pb2.DiscoverResponse.FromString,
        )
    self.SubscribeTimeout = channel.unary_stream(
        '/dronecode_sdk.rpc.core.CoreService/SubscribeTimeout',
        request_serializer=core__pb2.SubscribeTimeoutRequest.SerializeToString,
        response_deserializer=core__pb2.TimeoutResponse.FromString,
        )
    self.ListRunningPlugins = channel.unary_unary(
        '/dronecode_sdk.rpc.core.CoreService/ListRunningPlugins',
        request_serializer=core__pb2.ListRunningPluginsRequest.SerializeToString,
        response_deserializer=core__pb2.ListRunningPluginsResponse.FromString,
        )


class CoreServiceServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def SubscribeDiscover(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeTimeout(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ListRunningPlugins(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_CoreServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'SubscribeDiscover': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeDiscover,
          request_deserializer=core__pb2.SubscribeDiscoverRequest.FromString,
          response_serializer=core__pb2.DiscoverResponse.SerializeToString,
      ),
      'SubscribeTimeout': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeTimeout,
          request_deserializer=core__pb2.SubscribeTimeoutRequest.FromString,
          response_serializer=core__pb2.TimeoutResponse.SerializeToString,
      ),
      'ListRunningPlugins': grpc.unary_unary_rpc_method_handler(
          servicer.ListRunningPlugins,
          request_deserializer=core__pb2.ListRunningPluginsRequest.FromString,
          response_serializer=core__pb2.ListRunningPluginsResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'dronecode_sdk.rpc.core.CoreService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
 -> [+] Generated protobuf and gRPC bindings for core
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Core.py to /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/core.py: No such file or directory
 -> [+] Generated plugin for core
sed: -i: No such file or directory
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import calibration_pb2 as calibration__pb2


class CalibrationServiceStub(object):
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.CalibrateGyro = channel.unary_stream(
        '/dronecode_sdk.rpc.calibration.CalibrationService/CalibrateGyro',
        request_serializer=calibration__pb2.CalibrateGyroRequest.SerializeToString,
        response_deserializer=calibration__pb2.CalibrateGyroResponse.FromString,
        )
    self.CalibrateAccelerometer = channel.unary_stream(
        '/dronecode_sdk.rpc.calibration.CalibrationService/CalibrateAccelerometer',
        request_serializer=calibration__pb2.CalibrateAccelerometerRequest.SerializeToString,
        response_deserializer=calibration__pb2.CalibrateAccelerometerResponse.FromString,
        )
    self.CalibrateMagnetometer = channel.unary_stream(
        '/dronecode_sdk.rpc.calibration.CalibrationService/CalibrateMagnetometer',
        request_serializer=calibration__pb2.CalibrateMagnetometerRequest.SerializeToString,
        response_deserializer=calibration__pb2.CalibrateMagnetometerResponse.FromString,
        )
    self.CalibrateGimbalAccelerometer = channel.unary_stream(
        '/dronecode_sdk.rpc.calibration.CalibrationService/CalibrateGimbalAccelerometer',
        request_serializer=calibration__pb2.CalibrateGimbalAccelerometerRequest.SerializeToString,
        response_deserializer=calibration__pb2.CalibrateGimbalAccelerometerResponse.FromString,
        )


class CalibrationServiceServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def CalibrateGyro(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def CalibrateAccelerometer(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def CalibrateMagnetometer(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def CalibrateGimbalAccelerometer(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_CalibrationServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'CalibrateGyro': grpc.unary_stream_rpc_method_handler(
          servicer.CalibrateGyro,
          request_deserializer=calibration__pb2.CalibrateGyroRequest.FromString,
          response_serializer=calibration__pb2.CalibrateGyroResponse.SerializeToString,
      ),
      'CalibrateAccelerometer': grpc.unary_stream_rpc_method_handler(
          servicer.CalibrateAccelerometer,
          request_deserializer=calibration__pb2.CalibrateAccelerometerRequest.FromString,
          response_serializer=calibration__pb2.CalibrateAccelerometerResponse.SerializeToString,
      ),
      'CalibrateMagnetometer': grpc.unary_stream_rpc_method_handler(
          servicer.CalibrateMagnetometer,
          request_deserializer=calibration__pb2.CalibrateMagnetometerRequest.FromString,
          response_serializer=calibration__pb2.CalibrateMagnetometerResponse.SerializeToString,
      ),
      'CalibrateGimbalAccelerometer': grpc.unary_stream_rpc_method_handler(
          servicer.CalibrateGimbalAccelerometer,
          request_deserializer=calibration__pb2.CalibrateGimbalAccelerometerRequest.FromString,
          response_serializer=calibration__pb2.CalibrateGimbalAccelerometerResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'dronecode_sdk.rpc.calibration.CalibrationService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
 -> [+] Generated protobuf and gRPC bindings for calibration
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Calibration.py to /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/calibration.py: No such file or directory
 -> [+] Generated plugin for calibration
sed: -i: No such file or directory
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import camera_pb2 as camera__pb2


class CameraServiceStub(object):
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.TakePhoto = channel.unary_unary(
        '/dronecode_sdk.rpc.camera.CameraService/TakePhoto',
        request_serializer=camera__pb2.TakePhotoRequest.SerializeToString,
        response_deserializer=camera__pb2.TakePhotoResponse.FromString,
        )
    self.StartPhotoInterval = channel.unary_unary(
        '/dronecode_sdk.rpc.camera.CameraService/StartPhotoInterval',
        request_serializer=camera__pb2.StartPhotoIntervalRequest.SerializeToString,
        response_deserializer=camera__pb2.StartPhotoIntervalResponse.FromString,
        )
    self.StopPhotoInterval = channel.unary_unary(
        '/dronecode_sdk.rpc.camera.CameraService/StopPhotoInterval',
        request_serializer=camera__pb2.StopPhotoIntervalRequest.SerializeToString,
        response_deserializer=camera__pb2.StopPhotoIntervalResponse.FromString,
        )
    self.StartVideo = channel.unary_unary(
        '/dronecode_sdk.rpc.camera.CameraService/StartVideo',
        request_serializer=camera__pb2.StartVideoRequest.SerializeToString,
        response_deserializer=camera__pb2.StartVideoResponse.FromString,
        )
    self.StopVideo = channel.unary_unary(
        '/dronecode_sdk.rpc.camera.CameraService/StopVideo',
        request_serializer=camera__pb2.StopVideoRequest.SerializeToString,
        response_deserializer=camera__pb2.StopVideoResponse.FromString,
        )
    self.StartVideoStreaming = channel.unary_unary(
        '/dronecode_sdk.rpc.camera.CameraService/StartVideoStreaming',
        request_serializer=camera__pb2.StartVideoStreamingRequest.SerializeToString,
        response_deserializer=camera__pb2.StartVideoStreamingResponse.FromString,
        )
    self.StopVideoStreaming = channel.unary_unary(
        '/dronecode_sdk.rpc.camera.CameraService/StopVideoStreaming',
        request_serializer=camera__pb2.StopVideoStreamingRequest.SerializeToString,
        response_deserializer=camera__pb2.StopVideoStreamingResponse.FromString,
        )
    self.SetMode = channel.unary_unary(
        '/dronecode_sdk.rpc.camera.CameraService/SetMode',
        request_serializer=camera__pb2.SetModeRequest.SerializeToString,
        response_deserializer=camera__pb2.SetModeResponse.FromString,
        )
    self.SubscribeMode = channel.unary_stream(
        '/dronecode_sdk.rpc.camera.CameraService/SubscribeMode',
        request_serializer=camera__pb2.SubscribeModeRequest.SerializeToString,
        response_deserializer=camera__pb2.ModeResponse.FromString,
        )
    self.SetVideoStreamSettings = channel.unary_unary(
        '/dronecode_sdk.rpc.camera.CameraService/SetVideoStreamSettings',
        request_serializer=camera__pb2.SetVideoStreamSettingsRequest.SerializeToString,
        response_deserializer=camera__pb2.SetVideoStreamSettingsResponse.FromString,
        )
    self.SubscribeVideoStreamInfo = channel.unary_stream(
        '/dronecode_sdk.rpc.camera.CameraService/SubscribeVideoStreamInfo',
        request_serializer=camera__pb2.SubscribeVideoStreamInfoRequest.SerializeToString,
        response_deserializer=camera__pb2.VideoStreamInfoResponse.FromString,
        )
    self.SubscribeCaptureInfo = channel.unary_stream(
        '/dronecode_sdk.rpc.camera.CameraService/SubscribeCaptureInfo',
        request_serializer=camera__pb2.SubscribeCaptureInfoRequest.SerializeToString,
        response_deserializer=camera__pb2.CaptureInfoResponse.FromString,
        )
    self.SubscribeCameraStatus = channel.unary_stream(
        '/dronecode_sdk.rpc.camera.CameraService/SubscribeCameraStatus',
        request_serializer=camera__pb2.SubscribeCameraStatusRequest.SerializeToString,
        response_deserializer=camera__pb2.CameraStatusResponse.FromString,
        )
    self.SubscribeCurrentSettings = channel.unary_stream(
        '/dronecode_sdk.rpc.camera.CameraService/SubscribeCurrentSettings',
        request_serializer=camera__pb2.SubscribeCurrentSettingsRequest.SerializeToString,
        response_deserializer=camera__pb2.CurrentSettingsResponse.FromString,
        )
    self.SubscribePossibleSettingOptions = channel.unary_stream(
        '/dronecode_sdk.rpc.camera.CameraService/SubscribePossibleSettingOptions',
        request_serializer=camera__pb2.SubscribePossibleSettingOptionsRequest.SerializeToString,
        response_deserializer=camera__pb2.PossibleSettingOptionsResponse.FromString,
        )
    self.SetSetting = channel.unary_unary(
        '/dronecode_sdk.rpc.camera.CameraService/SetSetting',
        request_serializer=camera__pb2.SetSettingRequest.SerializeToString,
        response_deserializer=camera__pb2.SetSettingResponse.FromString,
        )


class CameraServiceServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def TakePhoto(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def StartPhotoInterval(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def StopPhotoInterval(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def StartVideo(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def StopVideo(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def StartVideoStreaming(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def StopVideoStreaming(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SetMode(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeMode(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SetVideoStreamSettings(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeVideoStreamInfo(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeCaptureInfo(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeCameraStatus(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeCurrentSettings(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribePossibleSettingOptions(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SetSetting(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_CameraServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'TakePhoto': grpc.unary_unary_rpc_method_handler(
          servicer.TakePhoto,
          request_deserializer=camera__pb2.TakePhotoRequest.FromString,
          response_serializer=camera__pb2.TakePhotoResponse.SerializeToString,
      ),
      'StartPhotoInterval': grpc.unary_unary_rpc_method_handler(
          servicer.StartPhotoInterval,
          request_deserializer=camera__pb2.StartPhotoIntervalRequest.FromString,
          response_serializer=camera__pb2.StartPhotoIntervalResponse.SerializeToString,
      ),
      'StopPhotoInterval': grpc.unary_unary_rpc_method_handler(
          servicer.StopPhotoInterval,
          request_deserializer=camera__pb2.StopPhotoIntervalRequest.FromString,
          response_serializer=camera__pb2.StopPhotoIntervalResponse.SerializeToString,
      ),
      'StartVideo': grpc.unary_unary_rpc_method_handler(
          servicer.StartVideo,
          request_deserializer=camera__pb2.StartVideoRequest.FromString,
          response_serializer=camera__pb2.StartVideoResponse.SerializeToString,
      ),
      'StopVideo': grpc.unary_unary_rpc_method_handler(
          servicer.StopVideo,
          request_deserializer=camera__pb2.StopVideoRequest.FromString,
          response_serializer=camera__pb2.StopVideoResponse.SerializeToString,
      ),
      'StartVideoStreaming': grpc.unary_unary_rpc_method_handler(
          servicer.StartVideoStreaming,
          request_deserializer=camera__pb2.StartVideoStreamingRequest.FromString,
          response_serializer=camera__pb2.StartVideoStreamingResponse.SerializeToString,
      ),
      'StopVideoStreaming': grpc.unary_unary_rpc_method_handler(
          servicer.StopVideoStreaming,
          request_deserializer=camera__pb2.StopVideoStreamingRequest.FromString,
          response_serializer=camera__pb2.StopVideoStreamingResponse.SerializeToString,
      ),
      'SetMode': grpc.unary_unary_rpc_method_handler(
          servicer.SetMode,
          request_deserializer=camera__pb2.SetModeRequest.FromString,
          response_serializer=camera__pb2.SetModeResponse.SerializeToString,
      ),
      'SubscribeMode': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeMode,
          request_deserializer=camera__pb2.SubscribeModeRequest.FromString,
          response_serializer=camera__pb2.ModeResponse.SerializeToString,
      ),
      'SetVideoStreamSettings': grpc.unary_unary_rpc_method_handler(
          servicer.SetVideoStreamSettings,
          request_deserializer=camera__pb2.SetVideoStreamSettingsRequest.FromString,
          response_serializer=camera__pb2.SetVideoStreamSettingsResponse.SerializeToString,
      ),
      'SubscribeVideoStreamInfo': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeVideoStreamInfo,
          request_deserializer=camera__pb2.SubscribeVideoStreamInfoRequest.FromString,
          response_serializer=camera__pb2.VideoStreamInfoResponse.SerializeToString,
      ),
      'SubscribeCaptureInfo': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeCaptureInfo,
          request_deserializer=camera__pb2.SubscribeCaptureInfoRequest.FromString,
          response_serializer=camera__pb2.CaptureInfoResponse.SerializeToString,
      ),
      'SubscribeCameraStatus': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeCameraStatus,
          request_deserializer=camera__pb2.SubscribeCameraStatusRequest.FromString,
          response_serializer=camera__pb2.CameraStatusResponse.SerializeToString,
      ),
      'SubscribeCurrentSettings': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeCurrentSettings,
          request_deserializer=camera__pb2.SubscribeCurrentSettingsRequest.FromString,
          response_serializer=camera__pb2.CurrentSettingsResponse.SerializeToString,
      ),
      'SubscribePossibleSettingOptions': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribePossibleSettingOptions,
          request_deserializer=camera__pb2.SubscribePossibleSettingOptionsRequest.FromString,
          response_serializer=camera__pb2.PossibleSettingOptionsResponse.SerializeToString,
      ),
      'SetSetting': grpc.unary_unary_rpc_method_handler(
          servicer.SetSetting,
          request_deserializer=camera__pb2.SetSettingRequest.FromString,
          response_serializer=camera__pb2.SetSettingResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'dronecode_sdk.rpc.camera.CameraService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
 -> [+] Generated protobuf and gRPC bindings for camera
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Camera.py to /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/camera.py: No such file or directory
 -> [+] Generated plugin for camera
sed: -i: No such file or directory
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import discovery_pb2 as discovery__pb2


class DiscoveryServiceStub(object):
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.SubscribeDiscoveredSystems = channel.unary_stream(
        '/dronecode_sdk.rpc.discovery.DiscoveryService/SubscribeDiscoveredSystems',
        request_serializer=discovery__pb2.SubscribeDiscoveredSystemsRequest.SerializeToString,
        response_deserializer=discovery__pb2.DiscoveredSystemResponse.FromString,
        )


class DiscoveryServiceServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def SubscribeDiscoveredSystems(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_DiscoveryServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'SubscribeDiscoveredSystems': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeDiscoveredSystems,
          request_deserializer=discovery__pb2.SubscribeDiscoveredSystemsRequest.FromString,
          response_serializer=discovery__pb2.DiscoveredSystemResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'dronecode_sdk.rpc.discovery.DiscoveryService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
 -> [+] Generated protobuf and gRPC bindings for discovery
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Discovery.py to /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/discovery.py: No such file or directory
 -> [+] Generated plugin for discovery
sed: -i: No such file or directory
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import mission_pb2 as mission__pb2


class MissionServiceStub(object):
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.UploadMission = channel.unary_unary(
        '/dronecode_sdk.rpc.mission.MissionService/UploadMission',
        request_serializer=mission__pb2.UploadMissionRequest.SerializeToString,
        response_deserializer=mission__pb2.UploadMissionResponse.FromString,
        )
    self.DownloadMission = channel.unary_unary(
        '/dronecode_sdk.rpc.mission.MissionService/DownloadMission',
        request_serializer=mission__pb2.DownloadMissionRequest.SerializeToString,
        response_deserializer=mission__pb2.DownloadMissionResponse.FromString,
        )
    self.StartMission = channel.unary_unary(
        '/dronecode_sdk.rpc.mission.MissionService/StartMission',
        request_serializer=mission__pb2.StartMissionRequest.SerializeToString,
        response_deserializer=mission__pb2.StartMissionResponse.FromString,
        )
    self.PauseMission = channel.unary_unary(
        '/dronecode_sdk.rpc.mission.MissionService/PauseMission',
        request_serializer=mission__pb2.PauseMissionRequest.SerializeToString,
        response_deserializer=mission__pb2.PauseMissionResponse.FromString,
        )
    self.SetCurrentMissionItemIndex = channel.unary_unary(
        '/dronecode_sdk.rpc.mission.MissionService/SetCurrentMissionItemIndex',
        request_serializer=mission__pb2.SetCurrentMissionItemIndexRequest.SerializeToString,
        response_deserializer=mission__pb2.SetCurrentMissionItemIndexResponse.FromString,
        )
    self.GetCurrentMissionItemIndex = channel.unary_unary(
        '/dronecode_sdk.rpc.mission.MissionService/GetCurrentMissionItemIndex',
        request_serializer=mission__pb2.GetCurrentMissionItemIndexRequest.SerializeToString,
        response_deserializer=mission__pb2.GetCurrentMissionItemIndexResponse.FromString,
        )
    self.GetMissionCount = channel.unary_unary(
        '/dronecode_sdk.rpc.mission.MissionService/GetMissionCount',
        request_serializer=mission__pb2.GetMissionCountRequest.SerializeToString,
        response_deserializer=mission__pb2.GetMissionCountResponse.FromString,
        )
    self.IsMissionFinished = channel.unary_unary(
        '/dronecode_sdk.rpc.mission.MissionService/IsMissionFinished',
        request_serializer=mission__pb2.IsMissionFinishedRequest.SerializeToString,
        response_deserializer=mission__pb2.IsMissionFinishedResponse.FromString,
        )
    self.SubscribeMissionProgress = channel.unary_stream(
        '/dronecode_sdk.rpc.mission.MissionService/SubscribeMissionProgress',
        request_serializer=mission__pb2.SubscribeMissionProgressRequest.SerializeToString,
        response_deserializer=mission__pb2.MissionProgressResponse.FromString,
        )
    self.GetReturnToLaunchAfterMission = channel.unary_unary(
        '/dronecode_sdk.rpc.mission.MissionService/GetReturnToLaunchAfterMission',
        request_serializer=mission__pb2.GetReturnToLaunchAfterMissionRequest.SerializeToString,
        response_deserializer=mission__pb2.GetReturnToLaunchAfterMissionResponse.FromString,
        )
    self.SetReturnToLaunchAfterMission = channel.unary_unary(
        '/dronecode_sdk.rpc.mission.MissionService/SetReturnToLaunchAfterMission',
        request_serializer=mission__pb2.SetReturnToLaunchAfterMissionRequest.SerializeToString,
        response_deserializer=mission__pb2.SetReturnToLaunchAfterMissionResponse.FromString,
        )


class MissionServiceServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def UploadMission(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def DownloadMission(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def StartMission(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def PauseMission(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SetCurrentMissionItemIndex(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetCurrentMissionItemIndex(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetMissionCount(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def IsMissionFinished(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeMissionProgress(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetReturnToLaunchAfterMission(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SetReturnToLaunchAfterMission(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_MissionServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'UploadMission': grpc.unary_unary_rpc_method_handler(
          servicer.UploadMission,
          request_deserializer=mission__pb2.UploadMissionRequest.FromString,
          response_serializer=mission__pb2.UploadMissionResponse.SerializeToString,
      ),
      'DownloadMission': grpc.unary_unary_rpc_method_handler(
          servicer.DownloadMission,
          request_deserializer=mission__pb2.DownloadMissionRequest.FromString,
          response_serializer=mission__pb2.DownloadMissionResponse.SerializeToString,
      ),
      'StartMission': grpc.unary_unary_rpc_method_handler(
          servicer.StartMission,
          request_deserializer=mission__pb2.StartMissionRequest.FromString,
          response_serializer=mission__pb2.StartMissionResponse.SerializeToString,
      ),
      'PauseMission': grpc.unary_unary_rpc_method_handler(
          servicer.PauseMission,
          request_deserializer=mission__pb2.PauseMissionRequest.FromString,
          response_serializer=mission__pb2.PauseMissionResponse.SerializeToString,
      ),
      'SetCurrentMissionItemIndex': grpc.unary_unary_rpc_method_handler(
          servicer.SetCurrentMissionItemIndex,
          request_deserializer=mission__pb2.SetCurrentMissionItemIndexRequest.FromString,
          response_serializer=mission__pb2.SetCurrentMissionItemIndexResponse.SerializeToString,
      ),
      'GetCurrentMissionItemIndex': grpc.unary_unary_rpc_method_handler(
          servicer.GetCurrentMissionItemIndex,
          request_deserializer=mission__pb2.GetCurrentMissionItemIndexRequest.FromString,
          response_serializer=mission__pb2.GetCurrentMissionItemIndexResponse.SerializeToString,
      ),
      'GetMissionCount': grpc.unary_unary_rpc_method_handler(
          servicer.GetMissionCount,
          request_deserializer=mission__pb2.GetMissionCountRequest.FromString,
          response_serializer=mission__pb2.GetMissionCountResponse.SerializeToString,
      ),
      'IsMissionFinished': grpc.unary_unary_rpc_method_handler(
          servicer.IsMissionFinished,
          request_deserializer=mission__pb2.IsMissionFinishedRequest.FromString,
          response_serializer=mission__pb2.IsMissionFinishedResponse.SerializeToString,
      ),
      'SubscribeMissionProgress': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeMissionProgress,
          request_deserializer=mission__pb2.SubscribeMissionProgressRequest.FromString,
          response_serializer=mission__pb2.MissionProgressResponse.SerializeToString,
      ),
      'GetReturnToLaunchAfterMission': grpc.unary_unary_rpc_method_handler(
          servicer.GetReturnToLaunchAfterMission,
          request_deserializer=mission__pb2.GetReturnToLaunchAfterMissionRequest.FromString,
          response_serializer=mission__pb2.GetReturnToLaunchAfterMissionResponse.SerializeToString,
      ),
      'SetReturnToLaunchAfterMission': grpc.unary_unary_rpc_method_handler(
          servicer.SetReturnToLaunchAfterMission,
          request_deserializer=mission__pb2.SetReturnToLaunchAfterMissionRequest.FromString,
          response_serializer=mission__pb2.SetReturnToLaunchAfterMissionResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'dronecode_sdk.rpc.mission.MissionService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
 -> [+] Generated protobuf and gRPC bindings for mission
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Mission.py to /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/mission.py: No such file or directory
 -> [+] Generated plugin for mission
sed: -i: No such file or directory
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import action_pb2 as action__pb2


class ActionServiceStub(object):
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.Arm = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/Arm',
        request_serializer=action__pb2.ArmRequest.SerializeToString,
        response_deserializer=action__pb2.ArmResponse.FromString,
        )
    self.Disarm = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/Disarm',
        request_serializer=action__pb2.DisarmRequest.SerializeToString,
        response_deserializer=action__pb2.DisarmResponse.FromString,
        )
    self.Takeoff = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/Takeoff',
        request_serializer=action__pb2.TakeoffRequest.SerializeToString,
        response_deserializer=action__pb2.TakeoffResponse.FromString,
        )
    self.Land = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/Land',
        request_serializer=action__pb2.LandRequest.SerializeToString,
        response_deserializer=action__pb2.LandResponse.FromString,
        )
    self.Kill = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/Kill',
        request_serializer=action__pb2.KillRequest.SerializeToString,
        response_deserializer=action__pb2.KillResponse.FromString,
        )
    self.ReturnToLaunch = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/ReturnToLaunch',
        request_serializer=action__pb2.ReturnToLaunchRequest.SerializeToString,
        response_deserializer=action__pb2.ReturnToLaunchResponse.FromString,
        )
    self.TransitionToFixedWing = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/TransitionToFixedWing',
        request_serializer=action__pb2.TransitionToFixedWingRequest.SerializeToString,
        response_deserializer=action__pb2.TransitionToFixedWingResponse.FromString,
        )
    self.TransitionToMulticopter = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/TransitionToMulticopter',
        request_serializer=action__pb2.TransitionToMulticopterRequest.SerializeToString,
        response_deserializer=action__pb2.TransitionToMulticopterResponse.FromString,
        )
    self.GetTakeoffAltitude = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/GetTakeoffAltitude',
        request_serializer=action__pb2.GetTakeoffAltitudeRequest.SerializeToString,
        response_deserializer=action__pb2.GetTakeoffAltitudeResponse.FromString,
        )
    self.SetTakeoffAltitude = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/SetTakeoffAltitude',
        request_serializer=action__pb2.SetTakeoffAltitudeRequest.SerializeToString,
        response_deserializer=action__pb2.SetTakeoffAltitudeResponse.FromString,
        )
    self.GetMaximumSpeed = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/GetMaximumSpeed',
        request_serializer=action__pb2.GetMaximumSpeedRequest.SerializeToString,
        response_deserializer=action__pb2.GetMaximumSpeedResponse.FromString,
        )
    self.SetMaximumSpeed = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/SetMaximumSpeed',
        request_serializer=action__pb2.SetMaximumSpeedRequest.SerializeToString,
        response_deserializer=action__pb2.SetMaximumSpeedResponse.FromString,
        )
    self.GetReturnToLaunchAltitude = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/GetReturnToLaunchAltitude',
        request_serializer=action__pb2.GetReturnToLaunchAltitudeRequest.SerializeToString,
        response_deserializer=action__pb2.GetReturnToLaunchAltitudeResponse.FromString,
        )
    self.SetReturnToLaunchAltitude = channel.unary_unary(
        '/dronecode_sdk.rpc.action.ActionService/SetReturnToLaunchAltitude',
        request_serializer=action__pb2.SetReturnToLaunchAltitudeRequest.SerializeToString,
        response_deserializer=action__pb2.SetReturnToLaunchAltitudeResponse.FromString,
        )


class ActionServiceServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def Arm(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Disarm(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Takeoff(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Land(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Kill(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def ReturnToLaunch(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def TransitionToFixedWing(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def TransitionToMulticopter(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetTakeoffAltitude(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SetTakeoffAltitude(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetMaximumSpeed(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SetMaximumSpeed(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def GetReturnToLaunchAltitude(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SetReturnToLaunchAltitude(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_ActionServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Arm': grpc.unary_unary_rpc_method_handler(
          servicer.Arm,
          request_deserializer=action__pb2.ArmRequest.FromString,
          response_serializer=action__pb2.ArmResponse.SerializeToString,
      ),
      'Disarm': grpc.unary_unary_rpc_method_handler(
          servicer.Disarm,
          request_deserializer=action__pb2.DisarmRequest.FromString,
          response_serializer=action__pb2.DisarmResponse.SerializeToString,
      ),
      'Takeoff': grpc.unary_unary_rpc_method_handler(
          servicer.Takeoff,
          request_deserializer=action__pb2.TakeoffRequest.FromString,
          response_serializer=action__pb2.TakeoffResponse.SerializeToString,
      ),
      'Land': grpc.unary_unary_rpc_method_handler(
          servicer.Land,
          request_deserializer=action__pb2.LandRequest.FromString,
          response_serializer=action__pb2.LandResponse.SerializeToString,
      ),
      'Kill': grpc.unary_unary_rpc_method_handler(
          servicer.Kill,
          request_deserializer=action__pb2.KillRequest.FromString,
          response_serializer=action__pb2.KillResponse.SerializeToString,
      ),
      'ReturnToLaunch': grpc.unary_unary_rpc_method_handler(
          servicer.ReturnToLaunch,
          request_deserializer=action__pb2.ReturnToLaunchRequest.FromString,
          response_serializer=action__pb2.ReturnToLaunchResponse.SerializeToString,
      ),
      'TransitionToFixedWing': grpc.unary_unary_rpc_method_handler(
          servicer.TransitionToFixedWing,
          request_deserializer=action__pb2.TransitionToFixedWingRequest.FromString,
          response_serializer=action__pb2.TransitionToFixedWingResponse.SerializeToString,
      ),
      'TransitionToMulticopter': grpc.unary_unary_rpc_method_handler(
          servicer.TransitionToMulticopter,
          request_deserializer=action__pb2.TransitionToMulticopterRequest.FromString,
          response_serializer=action__pb2.TransitionToMulticopterResponse.SerializeToString,
      ),
      'GetTakeoffAltitude': grpc.unary_unary_rpc_method_handler(
          servicer.GetTakeoffAltitude,
          request_deserializer=action__pb2.GetTakeoffAltitudeRequest.FromString,
          response_serializer=action__pb2.GetTakeoffAltitudeResponse.SerializeToString,
      ),
      'SetTakeoffAltitude': grpc.unary_unary_rpc_method_handler(
          servicer.SetTakeoffAltitude,
          request_deserializer=action__pb2.SetTakeoffAltitudeRequest.FromString,
          response_serializer=action__pb2.SetTakeoffAltitudeResponse.SerializeToString,
      ),
      'GetMaximumSpeed': grpc.unary_unary_rpc_method_handler(
          servicer.GetMaximumSpeed,
          request_deserializer=action__pb2.GetMaximumSpeedRequest.FromString,
          response_serializer=action__pb2.GetMaximumSpeedResponse.SerializeToString,
      ),
      'SetMaximumSpeed': grpc.unary_unary_rpc_method_handler(
          servicer.SetMaximumSpeed,
          request_deserializer=action__pb2.SetMaximumSpeedRequest.FromString,
          response_serializer=action__pb2.SetMaximumSpeedResponse.SerializeToString,
      ),
      'GetReturnToLaunchAltitude': grpc.unary_unary_rpc_method_handler(
          servicer.GetReturnToLaunchAltitude,
          request_deserializer=action__pb2.GetReturnToLaunchAltitudeRequest.FromString,
          response_serializer=action__pb2.GetReturnToLaunchAltitudeResponse.SerializeToString,
      ),
      'SetReturnToLaunchAltitude': grpc.unary_unary_rpc_method_handler(
          servicer.SetReturnToLaunchAltitude,
          request_deserializer=action__pb2.SetReturnToLaunchAltitudeRequest.FromString,
          response_serializer=action__pb2.SetReturnToLaunchAltitudeResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'dronecode_sdk.rpc.action.ActionService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
 -> [+] Generated protobuf and gRPC bindings for action
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Action.py to /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/action.py: No such file or directory
 -> [+] Generated plugin for action
sed: -i: No such file or directory
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from . import telemetry_pb2 as telemetry__pb2


class TelemetryServiceStub(object):
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.SubscribePosition = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribePosition',
        request_serializer=telemetry__pb2.SubscribePositionRequest.SerializeToString,
        response_deserializer=telemetry__pb2.PositionResponse.FromString,
        )
    self.SubscribeHome = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeHome',
        request_serializer=telemetry__pb2.SubscribeHomeRequest.SerializeToString,
        response_deserializer=telemetry__pb2.HomeResponse.FromString,
        )
    self.SubscribeInAir = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeInAir',
        request_serializer=telemetry__pb2.SubscribeInAirRequest.SerializeToString,
        response_deserializer=telemetry__pb2.InAirResponse.FromString,
        )
    self.SubscribeArmed = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeArmed',
        request_serializer=telemetry__pb2.SubscribeArmedRequest.SerializeToString,
        response_deserializer=telemetry__pb2.ArmedResponse.FromString,
        )
    self.SubscribeAttitudeQuaternion = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeAttitudeQuaternion',
        request_serializer=telemetry__pb2.SubscribeAttitudeQuaternionRequest.SerializeToString,
        response_deserializer=telemetry__pb2.AttitudeQuaternionResponse.FromString,
        )
    self.SubscribeAttitudeEuler = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeAttitudeEuler',
        request_serializer=telemetry__pb2.SubscribeAttitudeEulerRequest.SerializeToString,
        response_deserializer=telemetry__pb2.AttitudeEulerResponse.FromString,
        )
    self.SubscribeCameraAttitudeQuaternion = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeCameraAttitudeQuaternion',
        request_serializer=telemetry__pb2.SubscribeCameraAttitudeQuaternionRequest.SerializeToString,
        response_deserializer=telemetry__pb2.CameraAttitudeQuaternionResponse.FromString,
        )
    self.SubscribeCameraAttitudeEuler = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeCameraAttitudeEuler',
        request_serializer=telemetry__pb2.SubscribeCameraAttitudeEulerRequest.SerializeToString,
        response_deserializer=telemetry__pb2.CameraAttitudeEulerResponse.FromString,
        )
    self.SubscribeGroundSpeedNED = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeGroundSpeedNED',
        request_serializer=telemetry__pb2.SubscribeGroundSpeedNEDRequest.SerializeToString,
        response_deserializer=telemetry__pb2.GroundSpeedNEDResponse.FromString,
        )
    self.SubscribeGPSInfo = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeGPSInfo',
        request_serializer=telemetry__pb2.SubscribeGPSInfoRequest.SerializeToString,
        response_deserializer=telemetry__pb2.GPSInfoResponse.FromString,
        )
    self.SubscribeBattery = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeBattery',
        request_serializer=telemetry__pb2.SubscribeBatteryRequest.SerializeToString,
        response_deserializer=telemetry__pb2.BatteryResponse.FromString,
        )
    self.SubscribeFlightMode = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeFlightMode',
        request_serializer=telemetry__pb2.SubscribeFlightModeRequest.SerializeToString,
        response_deserializer=telemetry__pb2.FlightModeResponse.FromString,
        )
    self.SubscribeHealth = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeHealth',
        request_serializer=telemetry__pb2.SubscribeHealthRequest.SerializeToString,
        response_deserializer=telemetry__pb2.HealthResponse.FromString,
        )
    self.SubscribeRCStatus = channel.unary_stream(
        '/dronecode_sdk.rpc.telemetry.TelemetryService/SubscribeRCStatus',
        request_serializer=telemetry__pb2.SubscribeRCStatusRequest.SerializeToString,
        response_deserializer=telemetry__pb2.RCStatusResponse.FromString,
        )


class TelemetryServiceServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def SubscribePosition(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeHome(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeInAir(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeArmed(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeAttitudeQuaternion(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeAttitudeEuler(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeCameraAttitudeQuaternion(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeCameraAttitudeEuler(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeGroundSpeedNED(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeGPSInfo(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeBattery(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeFlightMode(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeHealth(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def SubscribeRCStatus(self, request, context):
    # missing associated documentation comment in .proto file
    pass
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_TelemetryServiceServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'SubscribePosition': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribePosition,
          request_deserializer=telemetry__pb2.SubscribePositionRequest.FromString,
          response_serializer=telemetry__pb2.PositionResponse.SerializeToString,
      ),
      'SubscribeHome': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeHome,
          request_deserializer=telemetry__pb2.SubscribeHomeRequest.FromString,
          response_serializer=telemetry__pb2.HomeResponse.SerializeToString,
      ),
      'SubscribeInAir': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeInAir,
          request_deserializer=telemetry__pb2.SubscribeInAirRequest.FromString,
          response_serializer=telemetry__pb2.InAirResponse.SerializeToString,
      ),
      'SubscribeArmed': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeArmed,
          request_deserializer=telemetry__pb2.SubscribeArmedRequest.FromString,
          response_serializer=telemetry__pb2.ArmedResponse.SerializeToString,
      ),
      'SubscribeAttitudeQuaternion': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeAttitudeQuaternion,
          request_deserializer=telemetry__pb2.SubscribeAttitudeQuaternionRequest.FromString,
          response_serializer=telemetry__pb2.AttitudeQuaternionResponse.SerializeToString,
      ),
      'SubscribeAttitudeEuler': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeAttitudeEuler,
          request_deserializer=telemetry__pb2.SubscribeAttitudeEulerRequest.FromString,
          response_serializer=telemetry__pb2.AttitudeEulerResponse.SerializeToString,
      ),
      'SubscribeCameraAttitudeQuaternion': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeCameraAttitudeQuaternion,
          request_deserializer=telemetry__pb2.SubscribeCameraAttitudeQuaternionRequest.FromString,
          response_serializer=telemetry__pb2.CameraAttitudeQuaternionResponse.SerializeToString,
      ),
      'SubscribeCameraAttitudeEuler': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeCameraAttitudeEuler,
          request_deserializer=telemetry__pb2.SubscribeCameraAttitudeEulerRequest.FromString,
          response_serializer=telemetry__pb2.CameraAttitudeEulerResponse.SerializeToString,
      ),
      'SubscribeGroundSpeedNED': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeGroundSpeedNED,
          request_deserializer=telemetry__pb2.SubscribeGroundSpeedNEDRequest.FromString,
          response_serializer=telemetry__pb2.GroundSpeedNEDResponse.SerializeToString,
      ),
      'SubscribeGPSInfo': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeGPSInfo,
          request_deserializer=telemetry__pb2.SubscribeGPSInfoRequest.FromString,
          response_serializer=telemetry__pb2.GPSInfoResponse.SerializeToString,
      ),
      'SubscribeBattery': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeBattery,
          request_deserializer=telemetry__pb2.SubscribeBatteryRequest.FromString,
          response_serializer=telemetry__pb2.BatteryResponse.SerializeToString,
      ),
      'SubscribeFlightMode': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeFlightMode,
          request_deserializer=telemetry__pb2.SubscribeFlightModeRequest.FromString,
          response_serializer=telemetry__pb2.FlightModeResponse.SerializeToString,
      ),
      'SubscribeHealth': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeHealth,
          request_deserializer=telemetry__pb2.SubscribeHealthRequest.FromString,
          response_serializer=telemetry__pb2.HealthResponse.SerializeToString,
      ),
      'SubscribeRCStatus': grpc.unary_stream_rpc_method_handler(
          servicer.SubscribeRCStatus,
          request_deserializer=telemetry__pb2.SubscribeRCStatusRequest.FromString,
          response_serializer=telemetry__pb2.RCStatusResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'dronecode_sdk.rpc.telemetry.TelemetryService', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
 -> [+] Generated protobuf and gRPC bindings for telemetry
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Telemetry.py to /Users/julianoes/src/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/telemetry.py: No such file or directory
 -> [+] Generated plugin for telemetry
[+] Done

Python Script Errors

Now that I have the DronecodeSDK-Python simulation environment running, I have been trying some of the example scripts. takeoff_and_land.py works. However, I tried several of the others and they fail. Here's two examples.
1)

joe-pl@joe-PL:~/src/DronecodeSDK/DronecodeSDK-Python/examples$ python3.6 mission.py
Task exception was never retrieved
future: <Task finished coro=<run() done, defined at mission.py:11> exception=TypeError('__init__() takes 10 positional arguments but 11 were given',)>
Traceback (most recent call last):
  File "mission.py", line 22, in run
    float('nan')))
TypeError: __init__() takes 10 positional arguments but 11 were given


^CTraceback (most recent call last):
  File "mission.py", line 83, in <module>
    asyncio.get_event_loop().run_until_complete(observe_is_in_air())
  File "/usr/lib/python3.6/asyncio/base_events.py", line 471, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.6/asyncio/base_events.py", line 438, in run_forever
    self._run_once()
  File "/usr/lib/python3.6/asyncio/base_events.py", line 1415, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/lib/python3.6/selectors.py", line 445, in select
    fd_event_list = self._epoll.poll(timeout, max_ev)
KeyboardInterrupt

^CError in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 40, in _python_exit
    t.join()
  File "/usr/lib/python3.6/threading.py", line 1056, in join
    self._wait_for_tstate_lock()
  File "/usr/lib/python3.6/threading.py", line 1072, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt
joe-pl@joe-PL:~/src/DronecodeSDK/DronecodeSDK-Python/examples$ python3.6 calibration.py
-- Starting gyro calibration
Traceback (most recent call last):
  File "calibration.py", line 21, in <module>
    loop.run_until_complete(run())
  File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
  File "calibration.py", line 13, in run
    async for progress_data in drone.calibration.calibrate_gyro():
AttributeError: 'NoneType' object has no attribute 'calibrate_gyro'

Do they fail because they have to be used in conjunction with another script? Can I run several scripts at the same time? Looking for an explanation so I can be prepared to start writing some mission scripts.

Thanks,
Joe

Performance benchmark

Hi guys,
I'm playing around with a ROS2 node using the MAVSDK-Python to take care of the mavlink side of things.
I was wondering if any of you have done a performance benchmark with telemetry broadcasting (global position, battery, system health, etc).
The highest rate I can get so far is about 0.5 Hz.
I don't think the intent behind the SDK is to provide high-freq control (at least not for now) but those rates super slow even for high-level mission control

Any ideas/suggestions on that would be really appreciated!

thanks

backend_bin is not built.

Hi guys,

I was trying to give it a test and I followed the instructions detailed in README.md. I can build MAVSDK without any error but I cannot find this particular binary file "./src/backend/src/backend_bin", and it seems that this file has been renamed as

grep -r "add_executable" | grep "backend_bin"

gives no result.

Any suggestion would be great, thanks!
Joey

Improve connection error handling

One may face 2 types of connection errors:

  • Connection from the wrapper to the backend (via gRPC)
  • Connection from the backend to PX4 (via mavlink)

Right now I see several issues:

  • There is no clear distinction between connection errors
  • Clearly identifying connection errors is not trivial
  • Connect() does not return a result (success or failure)
  • There are no methods in place to know the state of 1) the connection to the backend and 2) the connection to PX4, or they are not implemented, or buggy

Here are some examples:

Backend unreachable (DNS resolution failure):

[   ERROR] <_Rendezvous of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "Name resolution failure"
	debug_error_string = "{"created":"@1550220055.531945000","description":"Failed to create subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":2261,"referenced_errors":[{"created":"@1550220055.531943000","description":"Name resolution failure","file":"src/core/ext/filters/client_channel/request_routing.cc","file_line":163,"grpc_status":14}]}"
>
Traceback (most recent call last):
  File "/Users/docs/boulot/controleur/controleur/Autopilot.py", line 68, in connect
    autopilot_type = await Autopilot.vehicle.info.get_version()
  File "/Users/docs/boulot/controleur/controleur/Libs/DronecodeSDK-Python/dronecode_sdk/plugins/info.py", line 288, in get_version
    response = await self._stub.GetVersion(request)
  File "/Users/.local/share/virtualenvs/controleur-7At54XPt/lib/python3.6/site-packages/aiogrpc/channel.py", line 40, in __call__
    return await fut
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "Name resolution failure"
	debug_error_string = "{"created":"@1550220055.531945000","description":"Failed to create subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":2261,"referenced_errors":[{"created":"@1550220055.531943000","description":"Name resolution failure","file":"src/core/ext/filters/client_channel/request_routing.cc","file_line":163,"grpc_status":14}]}"
>

Backend unreacheable (connection refused):

Traceback (most recent call last):
  File "/Users/docs/boulot/controleur/controleur/Autopilot.py", line 68, in connect
    autopilot_type = await Autopilot.vehicle.info.get_version()
  File "/Users/docs/boulot/controleur/controleur/Libs/DronecodeSDK-Python/dronecode_sdk/plugins/info.py", line 288, in get_version
    response = await self._stub.GetVersion(request)
  File "/Users/.local/share/virtualenvs/controleur-7At54XPt/lib/python3.6/site-packages/aiogrpc/channel.py", line 40, in __call__
    return await fut
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "Connect Failed"
	debug_error_string = "{"created":"@1550221187.353538000","description":"Failed to create subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":2261,"referenced_errors":[{"created":"@1550221187.353357000","description":"Pick Cancelled","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":245,"referenced_errors":[{"created":"@1550221187.353329000","description":"Connect Failed","file":"src/core/ext/filters/client_channel/subchannel.cc","file_line":867,"grpc_status":14,"referenced_errors":[{"created":"@1550221187.353326000","description":"OS Error","errno":65,"file":"src/core/lib/iomgr/tcp_client_posix.cc","file_line":313,"os_error":"No route to host","syscall":"connect"}]}]}]}"

Identifying errors

If found how to correctly identify the type of error by getting grpc.RpcError._state.code:

        except grpc.RpcError as e:
            logger.exception("Exception in telemetry handler: ")

            if e._state.code == grpc.StatusCode.UNAVAILABLE:
                logger.error("DronecodeSDK backend is unreacheable.")

But that looks like bad practice. I don't want to have to dig so deep into the dependencies to do proper error handling. Plus I'm not even supposed to use grpc.RpcError._state (private attribute)

Backend reachable but not PX4

I have not found a clean way to verify the connection with PX4 succeeded. A workaround is to try to get data from PX4 and catch an exception. For instance, using get_version() and catching InfoError. The problem is: 1) there could be other reasons for this exception to be raised. 2) there is a delay (timeout?) for the exception to be raised.

INFORMATION_NOT_RECEIVED_YET: 'Information not received yet'; origin: get_version(); params: ()
Traceback (most recent call last):
  File "/Users/docs/boulot/controleur/controleur/Autopilot.py", line 68, in connect
    autopilot_type = await Autopilot.vehicle.info.get_version()
  File "/Users/docs/boulot/controleur/controleur/Libs/DronecodeSDK-Python/dronecode_sdk/plugins/info.py", line 294, in get_version
    raise InfoError(result, "get_version()")
dronecode_sdk.plugins.info.InfoError: INFORMATION_NOT_RECEIVED_YET: 'Information not received yet'; origin: get_version(); params: ()

Connect() result

The connect() function does not appear to return a result. So in order to know if the connection is established, one has to use other ways like catching telemetry exceptions.

connection_state

I’ve tried 2 things:

  • system.is_connected: documented, but System doesn’t appear to be implemented yet in the python wrapper
  • core.connection_state(): undocumented, is implemented, but raises attributeerror: 'NoneType' object has no attribute 'connection_state'

Can't change takeoff altitude using set_takeoff_altitude()

Hey guys,
I tried to change the altitude in takeoff_and_land.py through the following code but ran into an error. Looks like a bug. Would be grateful for insights and help on this!

#!/usr/bin/env python3

import asyncio
import time

from mavsdk import start_mavlink
from mavsdk import connect as mavsdk_connect

start_mavlink()
drone = mavsdk_connect(host="127.0.0.1")


async def run():

    print("Waiting for drone...")
    async for state in drone.core.connection_state():
        if state.is_connected:
            print(f"Drone discovered with UUID: {state.uuid}")
            break

    print("-- Arming")
    await drone.action.arm()

    print("-- Taking off")
    await drone.action.set_takeoff_altitude(100)
    print (await drone.action.get_takeoff_altitude())
    await drone.action.takeoff()
    await asyncio.sleep(30)
    
    print("-- Landing")
    await drone.action.land()



loop = asyncio.get_event_loop()
loop.run_until_complete(run())

Terminal output:

python3 takeoff_and_land.py
Waiting for drone...
Drone discovered with UUID: 5283920058631409231
-- Arming
-- Taking off
Traceback (most recent call last):
 File "takeoff_and_land.py", line 36, in <module>
   loop.run_until_complete(run())
 File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
   return future.result()
 File "takeoff_and_land.py", line 25, in run
   await drone.action.set_takeoff_altitude(100)
 File "/usr/local/lib/python3.6/dist-packages/mavsdk/plugins/action.py", line 331, in set_takeoff_altitude
   raise ActionError(result, "set_takeoff_altitude()", altitude)
mavsdk.plugins.action.ActionError: UNKNOWN: ''; origin: set_takeoff_altitude(); params: (100,)

aiogrpc pip error

While compiling from source, I found an error:

Collecting aiogrpc>=1.5 (from -r requirements.txt (line 2))
  ERROR: Could not find a version that satisfies the requirement aiogrpc>=1.5 (from -r requirements.txt (line 2)) (from versions: none)
ERROR: No matching distribution found for aiogrpc>=1.5 (from -r requirements.txt (line 2))

I manually installed aiogrpc using "pip3". Seems like there is no aiogrpc in the pip verion.

Example with multiple drones

It would be good to provide an example how we can use the Python wrappers to connect to multiple drones at the same time.

It's a bit tricky because we need to run a mavsdk_server for each drone.

How to implement real-time interrupts?

Hi again. I've spent a lot of time in here getting educated on using DronecodeSDK-Python and have a working SITL. Thanks, this help has been much appreciated.

My current question involves the need to write a Python script that can cause a real-time interrupt to a mission while it is running, and change the mission to something else. Let's say the drone is moving from waypoint 3 to waypoint 4 and it gets a signal to stop the mission and start moving towards a different waypoint, say, waypoint 4A in another location. The signal to interrupt the current mission and begin a revised mission can be caused by either an external message sent from a keyboard, or an on-board signal from a sensor.

It seems to me that there needs to be a "listener" routine running in the background to always be ready to recognize the signal(s), and then call another routine to run the new mission. I hope to accomplish this on a companion computer (ie, Raspberry Pi) which is in communication with a ground station and the on-board sensors. I'm assuming the Python scripts to accomplish real-time interrupts can be run on the SITL so they can be tested prior to actual flight.

I'm looking for any reference material on this topic, and would like to talk to anyone that has experience with this . I've scoured the web for information on process interrupts and most of them have dealt with
multithreading, and mulitprocessing. It seems that keyboard interrupts can be done with several cumbersome approaches. There are also references to using pygame for keyboard interrupts. The only references I've found to sensor input is in the arduino / RPi camp, and most of those occur over the GPIO system.

I would think that the asyncio system has some built-in tools just made for this, but have not found anything concrete to work with yet. If there is some tutorial or other resource dealing with this, I would like to know.

If this of off-topic here, let me know where it belongs.

Thanks again,
Joe

Not possible to connect using serial - ttyUSB with python?

From the MAVSDK (C++) it is possible to connect an offboard computer (i.e.Odroid XU4) using a serial connection, specifying the correct path (i.e. "/dev/ttyUSB0:57600"). In the Python examples, the connection is always done as "drone = mavsdk_connect(host="127.0.0.1")", which works great with jmavsim or other simulators. However, it does not work with a serial connection to the pixhawk (using a USB to FTDI adapter). Is it possible to entablish such kind of connection from the Python MAVSDK API? How?

Thank you in advance

Inconsistent reporting of health data

I’m trying to simulate a loss of GPS lock in SITL, using gpssim stop as suggested by the documentation. While QGC correctly reports the loss, the SDK’s Health query still returns is_local_position_ok: True, is_global_position_ok: True, is_home_position_ok: True.

Steps to reproduce

  1. Launch an instance of PX4 in SITL and wait for EKF to get a position.

  2. Launch your piece of code.

async for health in vehicle.telemetry.health():  
    print(str(health))

Make sure the parameters mentioned above return True.

  1. run gpssim stop in the PX4 console.
pxh> gpssim stop
INFO  [gpssim] exiting
pxh> WARN  [ecl/EKF] EKF GPS data stopped
WARN  [ecl/EKF] EKF stopping navigation

Check EKF status with ekf2 status:

pxh> ekf2 status
INFO  [ekf2] local position: invalid
INFO  [ekf2] global position: invalid
INFO  [ekf2] time slip: 0 us

The parameters still return True. They should be returning False.

Observations

I have noticed 2 different behaviors depending on the order the steps are done:

  • stop GPS, then start SDK: is_global_position_ok is correctly reported as False. Then start GPS again, and is_global_position_ok correctly (and immediately) switches to True.
  • start SDK, then stop GPS: is_global_position incorrectly stays True indefinitely.

System info

PX4: 1.9.0

MAVSDK-Python: 0.1.0 (pypi)

Issue Modifying Python Script

I am starting to use the DronecodeSDK-Python system. It runs the canned mission.py script so I know it works. But when I change the GPS parameters for my location, the script throws an error message. I did not make any other changes to the script, just the location parameters. Note that the script freezes up and needs ^C to exit. I also notice that the error message references another mission.py script in the
/home/joe-pl/DronecodeSDK/DronecodeSDK-Python/dronecode_sdk/plugins/mission.py directory.
This is a completely different script, so why the same name? Will this other mission.py work with other Python scripts I write?

It would be useful if there was a tutorial to assist in getting started using the Python wrapper to start experimenting.
Thanks for any help.
Joe

joe-pl@joe-PL:~/DronecodeSDK/DronecodeSDK-Python/my_examples$ python3.6 mission-nh.py
-- Uploading mission
-- Arming
-- Starting mission
Task exception was never retrieved
future: <Task finished coro=<run() done, defined at mission-nh.py:11> exception=MissionError(<dronecode_sdk.plugins.mission.MissionResult object at 0x7fc3f6a6df98>, 'start_mission()')>
Traceback (most recent call last):
  File "mission-nh.py", line 53, in run
    await drone.mission.start_mission()
  File "/home/joe-pl/DronecodeSDK/DronecodeSDK-Python/dronecode_sdk/plugins/mission.py", line 478, in start_mission
    raise MissionError(result, "start_mission()")
dronecode_sdk.plugins.mission.MissionError: ERROR: 'Error'; origin: start_mission(); params: ()

^CTraceback (most recent call last):
  File "mission-nh.py", line 83, in <module>
    asyncio.get_event_loop().run_until_complete(observe_is_in_air())
  File "/usr/lib/python3.6/asyncio/base_events.py", line 471, in run_until_complete
    self.run_forever()
  File "/usr/lib/python3.6/asyncio/base_events.py", line 438, in run_forever
    self._run_once()
  File "/usr/lib/python3.6/asyncio/base_events.py", line 1415, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/lib/python3.6/selectors.py", line 445, in select
    fd_event_list = self._epoll.poll(timeout, max_ev)

KeyboardInterrupt
^CError in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 40, in _python_exit
    t.join()
  File "/usr/lib/python3.6/threading.py", line 1056, in join
    self._wait_for_tstate_lock()
  File "/usr/lib/python3.6/threading.py", line 1072, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt

Connection state raises an error

As reported by @zulufoxtrot in #49, the SDK crashes when subscribing to the connection state:

Autopilot.py", line 268, in get_connection_status
async for connection_state in Autopilot.vehicle.core.connection_state():
AttributeError: 'NoneType' object has no attribute 'connection_state'

run_protoc.sh doesn't work

Log below

ubuntu@ubuntu:~/github/dronecore/2test/DroneCore-Python$ ./tools/run_protoc.sh
cp: cannot stat '/home/ubuntu/github/dronecore/2test/DroneCore-Python/tools/../proto/README.md/*.proto': Not a directory
/home/ubuntu/github/dronecore/2test/DroneCore-Python/tools/../src/dronecore_README.md/dronecore_README.md/*.proto: No such file or directory

Program not found or is not executable --custom_out: protoc-gen-custom

My apologies for using a close issue. However, it's the only post I found about issues running run_protoc.sh

In my case, it cannot generate the plugins. The server builds and works fine, but I'm not sure why run_protoc.sh fails.

[+] Installing the DronecodeSDK autogenerator
Processing /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/proto/pb_plugins
Requirement already satisfied: protobuf in /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from dcsdkgen==0.1a0) (3.7.0)
Requirement already satisfied: jinja2 in /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from dcsdkgen==0.1a0) (2.10)
Requirement already satisfied: six>=1.9 in /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from protobuf->dcsdkgen==0.1a0) (1.12.0)
Requirement already satisfied: setuptools in /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from protobuf->dcsdkgen==0.1a0) (40.8.0)
Requirement already satisfied: MarkupSafe>=0.23 in /opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from jinja2->dcsdkgen==0.1a0) (1.1.0)
Installing collected packages: dcsdkgen
  Found existing installation: dcsdkgen 0.1a0
    Uninstalling dcsdkgen-0.1a0:
      Successfully uninstalled dcsdkgen-0.1a0
  Running setup.py install for dcsdkgen ... done
Successfully installed dcsdkgen-0.1a0
[+] Done
[+] Generating plugins from 
 -> [+] Generated protobuf and gRPC bindings for action
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Action.py to /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/action.py: No such file or directory
 -> [+] Generated plugin for action
 -> [+] Generated protobuf and gRPC bindings for calibration
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Calibration.py to /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/calibration.py: No such file or directory
 -> [+] Generated plugin for calibration
 -> [+] Generated protobuf and gRPC bindings for camera
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Camera.py to /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/camera.py: No such file or directory
 -> [+] Generated plugin for camera
 -> [+] Generated protobuf and gRPC bindings for core
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Core.py to /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/core.py: No such file or directory
 -> [+] Generated plugin for core
 -> [+] Generated protobuf and gRPC bindings for discovery
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Discovery.py to /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/discovery.py: No such file or directory
 -> [+] Generated plugin for discovery
 -> [+] Generated protobuf and gRPC bindings for gimbal
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Gimbal.py to /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/gimbal.py: No such file or directory
 -> [+] Generated plugin for gimbal
 -> [+] Generated protobuf and gRPC bindings for info
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Info.py to /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/info.py: No such file or directory
 -> [+] Generated plugin for info
 -> [+] Generated protobuf and gRPC bindings for mission
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Mission.py to /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/mission.py: No such file or directory
 -> [+] Generated plugin for mission
 -> [+] Generated protobuf and gRPC bindings for telemetry
: program not found or is not executable
--custom_out: protoc-gen-custom: Plugin failed with status code 1.
mv: rename /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/Telemetry.py to /Users/abencomo/git/DronecodeSDK/DronecodeSDK-Python/other/tools/../..//dronecode_sdk/plugins/telemetry.py: No such file or directory
 -> [+] Generated plugin for telemetry
[+] Done

Originally posted by @IeiuniumLux in #48 (comment)

Subscribing to a stream cancels older subscriptions

Currently, at the C++ level, streams like position_async() register one unique callback. This means that one cannot register two callbacks: the second call will erase the previous one.

I believe that this is not the behavior we want in Python. Already in Swift and Java, a stream is shared between the consumers at the language binding level (by using Rx mechanics).

I made a proof of concept for position() (thanks to Samyash for the help), essentially trying to call _stub.SubscribePosition(request) only once and sharing that with all the consumers.

I looks like below, exposing position() as before and instantiating the factory in a lazy way (only when the first consumer registers).

position_factory = None

...

def position(self):
    if not self.position_factory:
        self.position_factory = self._position_factory()

    return self.position_factory()

def _position_factory(self):
    import collections

    request = telemetry_pb2.SubscribePositionRequest()
    position_stream = self._stub.SubscribePosition(request)

    deques = []
    already_gone = []

    def new_position_generator():
        new_deque = collections.deque()
        new_deque.extend(already_gone)
        deques.append(new_deque)

        async def gen(my_deque):
            while True:
                if not my_deque:
                    rpc_pos = await position_stream.__anext__()
                    new_pos = Position.translate_from_rpc(rpc_pos.position)

                    for d in deques:
                        d.append(new_pos)
                yield my_deque.popleft()

        return gen(new_deque)

    return new_position_generator

Still to be investigated:

  • This is currently caching all the events, but a new consumer is only interested in the current state. That can be improved thanks to Samyash suggestion here.
  • What happens when a consumer wants to unregister? It should get erased from the queues, probably.
  • Can we stop the gRPC connection when all the consumers unregister?

Error running python examples

Hey guys,
I have just tried building the back end and wrappers as it is described in the instructions here.
I don't get compilation errors, but when I run any of the python examples I get gRPC status code UNIMPLEMENTED.

I'm not knowledgeable in gRPC servers at all but as far I understand the problem is in the server? Or at least it seems the messages in the server and wrapper and not the same?

Any one has any insight into this? I'm trying to write a ROS2 node using the MAVSDK as comm library between OBC and Autopilot.

Appreciate any insights

More than one nested enum cause error.

Putting more than one enum in proto message cause error.
Example:

message TestMessage {
enum FirstEnum {
STUB_FIRST = 0;
}

enum OneMoreEnum {
STUB_ONE_MORE = 0;
}

FirstEnum first_enum_val = 1;
OneMoreEnum second_enum_val = 2;
}

Run protoc:

$ ./other/tools/run_protoc.sh

Error:

Traceback (most recent call last):
File "mavsdk-python/.venv/bin/protoc-gen-dcsdk", line 11, in <module>
load_entry_point('protoc-gen-dcsdk', 'console_scripts', 'protoc-gen-dcsdk')()
File "mavsdk-python/proto/pb_plugins/protoc_gen_dcsdk/__main__.py", line 17, in main
AutoGen.generate_reactive(request).SerializeToString())
File "mavsdk-python/proto/pb_plugins/protoc_gen_dcsdk/autogen.py", line 34, in generate_reactive
docs = Docs.collect_docs(proto_file.source_code_info)
File "mavsdk-python/proto/pb_plugins/protoc_gen_dcsdk/docs.py", line 60, in collect_docs
docs['structs'][struct_id]['enums'][nested_enum_id]['params'].append(
IndexError: list index out of range

Is there set_configuration() function in MAVSDK-Python ?

I wanna use MAVSDK as CompanionComputer, not as GroundStation.

I just got to know set_configuration function in MAVSDK-C++.

So, I thought that would be in MAVSDK-Python, too.
But I couldn't find that. Is there set_configuration() function in MAVSDK-Python ?

PyPI package needs updating?

The package in the Python Package Index still contains references to the old names (Drone vs now System). Running those examples will give errors on 'System'. Updating the PyPI package will bring the 'pip install mavsdk' back in sync with the current examples.

Generate wrapper again at raspberry pi 3b+ will get weird thing

The system image is 2019-07-10-raspbian-buster-lite.iso

The python version is Python 3.7.3 (default, Apr 3 2019, 05:39:12)

The generate command I was using is ./other/tools/run_protoc.sh

The result I got is something like this: from . from . import geofence_pb2 as geofence__pb2, which cause a syntax error.

If I do the generation process again, I'll get something like this: from . from . from . import geofence_pb2 as geofence__pb2, which also cause the error of cause.

AttributeError: type object 'GpsInfo' has no attribute 'FixType'

Getting this error on the latest commit.

GpsInfo appears to be the only thing that's affected. All my other telemetry callbacks work as expected.

Traceback (most recent call last):
  File "Autopilot.py", line 196, in get_gps_info
    async for gps_info in Autopilot.vehicle.telemetry.gps_info():
  File "Libs/DronecodeSDK-Python/dronecode_sdk/plugins/telemetry.py", line 903, in gps_info
    yield GpsInfo.translate_from_rpc(response.gps_info)
  File "Libs/DronecodeSDK-Python/dronecode_sdk/plugins/telemetry.py", line 465, in translate_from_rpc
    GpsInfo.FixType.translate_from_rpc(rpcGpsInfo.fix_type)
AttributeError: type object 'GpsInfo' has no attribute 'FixType'

Source:

        async for gps_info in Autopilot.vehicle.telemetry.gps_info():

            logger.info(f"GPS info: {gps_info}")

Move docs/examples to /examples

@xvzf The new structure good, but can we move the examples back into the root. Docs are going to be stored in a separate gitbook. If you want to have intermediate docs, put them in the wiki and let me know :-)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.