Giter Club home page Giter Club logo

dronecodesdk-python's Introduction

DronecodeSDK-Python

This is the Python wrapper for the Dronecode SDK.

The Python wrapper is based on a gRPC client communicating with the gRPC server written in C++. To use the Python wrapper the gRPC server called "backend" needs to be running on the same system. The wrapper is essentially auto-generated from the message definitions (proto files).

Important Notes

  • Python 3.6+ is required (because the wrapper is based on asyncio).

Build and run backend

First, we need to build and run the backend which is the gRPC server that the Python wrapper will connect to.

Note: it is planned to automate this step using package managers like brew, apt-get, etc. .

git clone https://github.com/Dronecode/DronecodeSDK --recursive
cd DronecodeSDK
make BUILD_BACKEND=1

For more help on this step, check the docs on how to build from source.

Once this is built, start PX4 SITL and run the backend:

./build/default/backend/src/backend_bin

By default, the backend will connect using MAVLink on UDP port 14540 which is running by default when PX4 is run in SITL (software in the loop simulation). To change the connection port, check this line in the backend. For now, the backend is limited to UDP even though the core supports UDP, TCP, and serial.

Get the Python wrapper

Clone this repo and recursively update submodules:

git clone https://github.com/Dronecode/DronecodeSDK-Python --recursive
cd DronecodeSDK-Python

Install prerequisites

pip3 install -r requirements.txt -r requirements-dev.txt

Generate wrapper

Run the following helper script. It will generate the Python wrappers for each plugin. If the submodules are not initialized already, the script will take care of it.

./other/tools/run_protoc.sh

Install the package locally

After generating the wrapper you can install a development (editable) version of the package using:

pip3 install -e .

Running the examples

Once the package has been installed, the examples can be run:

examples/takeoff_and_land.py

dronecodesdk-python's People

Contributors

xvzf avatar jonasvautherin avatar julianoes avatar hamishwillee avatar mrpollo avatar

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.