Git Product home page Git Product logo

mavsdk-javascript's Introduction

MAVSDK-JavaScript

JS wrapper for mavlink/MAVSDK using grpc-web to generate a static http client, communicating through the Envoy proxy.

NOTE: this is still a proof of concept, don't try to use it in production!

Contributing

The next steps that are required are:

  1. Write a nice API for some selected features (e.g. action.arm, action.takeoff, and telemetry.position) using RxJS.
  2. (Optional) Make a small UI using those features (e.g. a "takeoff" button, and show the position values somewhere).
  3. Write templates based on 1) to auto-generate the full API from our proto definitions.
  4. Deploy the package.

Getting started

Prerequisites

This project is about providing a package to write frontend JS code, but this code needs to communicate to the drone through a backend. Two components are required:

  • Envoy proxy: it converts the websocket messages to/from the frontend into gRPC messages sent to mavsdk_server.
  • mavsdk_server: the MAVSDK gRPC server that handles the MAVLink communication with the drone.
  • (optional) Simulator (SITL): which is more convenient and safer than testing on a real drone.

To help getting started, we built those components as docker micro-services. Given that you have docker and docker-compose installed, simply run the following command to start those components:

$ cd docker
$ docker-compose up

Once the docker containers are running, you should be able to start QGroundControl, and it should connect to the simulator (headless gazebo in this case).

Install the SDK

Install the npm dependencies:

$ npm install

Generate the gRPC/protobut static files (those are the ones that will be used by the final API):

$ ./generator.sh

Finally, run the development server:

$ npm run build
$ npm start

It will say something like: Project is running at http://localhost:8080/. If docker-compose started correctly, opening this webpage should make the drone arm and takeoff. That would be visible from QGroundControl and from the docker-compose logs:

mavsdk_server_1         | [09:23:33|Debug] MAVLink: info: ARMED by Arm/Disarm component command (system_impl.cpp:306)
mavsdk_server_1         | [09:23:33|Debug] MAVLink: info: Using minimum takeoff altitude: 2.50 m (system_impl.cpp:306)
mavsdk_server_1         | [09:23:34|Debug] MAVLink: info: Takeoff detected (system_impl.cpp:306)

mavsdk-javascript's People

Contributors

julianoes avatar jonasvautherin avatar mrpollo avatar unipheas avatar dependabot[bot] avatar

Watchers

James Cloos 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.