Volons is still early access alpha software, use at your own risk.
Open Source Internet of Drones Platform
const { Hive } = require('volons');
(async function main() {
let hive = new Hive( 'ws://localhost:8656/admin' );
await hive.connect();
let vehicle = hive.vehicle( 'dev' );
await vehicle.connect();
await vehicle.takeoff();
})();
$ npm i -g volons
$ volons start
$ npm i volons
Volons is composed of 4 leading opensource software. You can download the source code, install and run it manually. : Coding and connecting mission for UAVs.
Main components:
- Vehicles ( arducopter / DJI ) are components directly connected to the flight controller
- The Hive is the backend application managing security and authorizations
- The Monitor is a web application using Volons Javascript SDK to watch and control flights in real-time
- Volons Javascript SDK is the part you are going to interact with to code dynamic missions and triggers
Volons' API is object-oriented and easy to install, use and run.
Let's start. You don't need to know everything about Volons at this point. You can get more information by browsing Volons' Github repositories and Volons WIKI (Work in process).
This document presents a step-by-step tutorial with short explanations on how to start coding for drones.
- Install and start Volons on your computer
- Docker Images
- Use Volons node module to write code for drones with nodejs
- Run and Monitor Mission
You are familiar with Nodejs and Docker! So, you are going to install your development platform then takeoff and monitor a simulator in ~5 minutes.
You need standard third-party software to run Volons.
- Node.js with npm https://nodejs.org
- Docker https://www.docker.com/
- Docker Compose https://docs.docker.com/compose/install/
- Git https://git-scm.com/
Its are probably already installed. If not, you should do it before to continue.
Volons node module comes with a command line interface (CLI). To install the Volons CLI run:
$ npm i -g volons
This software helps you to start Volons' local platform.
Volons CLI arguments:
volons start
: Start volons containers (Hive, simulator, vehicle-mavlinl)volons stop
: Stop volons running containersvolons ps
: Print information about running containers (IP address, ports, name, env...)volons help
: Print help message How to use volons CLIvolons pull
: Download latest docker images from Docker Hub
How it works
Four docker images compose the Volons local stack.
Volons CLI executes docker-compose and docker commands to handle volons' containers.
First, volons start
downloads three images from Docker Hub.
Then, by running docker-compose up
to start containers with docker.
If you are familiar with docker, you can download Volons' container images directly from Docker hub and configure more complicated stack.
Add many hives and drones.
Docker hub builds Volons docker images automatically from source code.
Your containers run altogether. Your local platform is ready, and you can connect with the SDK to start your first mission.
View running containers:
$ volons ps
This command displays information about Volons containers on your local machine.
You should see three running containers:
- simulator: Dronekit-SITL based docker image with custom Volons configuration
- vehicle-mavlink: the Volons adaptor for MAVLink vehicles (Arducupter)
- hive: the Fleet Management System to connect drone and SDK
Create a new folder to store your first program using Volons.
$ mkdir first-project-with-volons
$ cd first-project-with-volons
Init a Nodejs project and install Volons package. Copy Takeoff.js sample code from volons sample code folder.
$ npm install volons --save
$ cp ./node_modules/volons/examples/Takeoff.js ./Takeoff.js
Takeoff.js is a trival sample code.
$ cat ./takeoff.js
// This Volons script is a trivial script that
// - require Volons' library
// - connect Hive
// - connect aircraft
// - Send Takeoff command to drone
const { Hive } = require('volons');
async function main() {
let hive = new Hive('ws://localhost:8656/admin');
await hive.connect();
console.log('Connected to hive');
let vehicle = hive.vehicle('dev');
await vehicle.connect();
console.log('Connected to vehicle');
console.log('takeoff');
await vehicle.takeoff();
console.log('Dev is flying');
}
Watch the one minute video on Youtube: From 'npm install' to monitor takeoff
Get more examples
Browse the volons sample code directory to get more examples.
$ ls ./node_modules/volons/examples/
- Takeoff.js: Trivial mission to
Takeoff
. The one we've just talk about. - Goto.js: Demo of
vehicle.goto()
. - Events.js: Use
events
to connect drone's events, this demo prints drones telemetry.
You can handle volons images and containers manually.
$ docker pull volons/hive
$ docker run -i volons/hive
or docker-compose
$ docker-compose -f ./node_modules/volons/cli/volons-cli/volons-docker-compose.yml up
Volons CLI could help a lot: $ volons start
is entirely equivalent to the docker-compose command line.
The volons/simulator
docker image should connect to your local QGroundControl.
Coming soon: Volons provides a web-based application using the Volons SDK to display your Aircraft on a map with telemetry data.
You can find more information on our vehicle adaptors repositories:
- Mavlink aircrafts: https://github.com/volons/vehicle-mavlink
- DJI aircrafts: https://github.com/volons/vehicle-dji
Feel free to contact us to get help building software for your drones.
Copyright (c) 2019 Volons SAS, https://www.volons.fr
Volons is developed and maintained by Volons SAS, based in France, contact us!
Usefull links: