Git Product home page Git Product logo

cloverjs's Introduction

CloverJS

This library allows you to program autonomous flight for the COEX Clover quadcopter in JavaScript language and you can perform almost all the tasks described in the Clover's documentation with alternative commands in the JS.

Pros:

The library has built-in color and QR code recognition with one command.

You can easily create user interfaces for your programs and use unique JS libraries.

The amount of code written in JS with my library for the most common tasks is significantly less compared to the amount of code in Python written for the same task


How to use:

1. Installation:

1.1 Download this repository to Clover's RaspberryPI, unzip and open folder CloverJS, then open console

1.2 Check if NodeJS is installed (type npm -v in your console, output should be like 6.4.1)

1.3 Type npm install child_process fs

1.4 Type pip install pyzbar

2. Syntax:

2.1 Library import:

const clover = require('./clover');

2.2 Navigate:

//Ascending to the altitude of 1.5 m with the climb rate of 0.5 m/s:
clover.navigate(x=0.0, y=0.0, z=1.5, yaw=0.0, yaw_rate=0.0, speed=0.5, frame_id='body', auto_arm=true);

//Also you can write like this:
clover.navigate(0, 0, 1.5, 0, 0, 0.5, 'body', true);

2.3 Setting the time to perform an action:

clover.sleep(2); //2 seconds

2.4 LED Strip control:

clover.led(effect = 'fill', r = 255, g = 0, b = 0) //or clover.led('fill', 255); - fill strip with red color
//Rainbow effect:
clover.led(effect = 'rainbow'); //or clover.led('rainbow');

2.5 Get telemetry and display it in console:

clover.get_telemetry();
console.log(clover.telemetry());

2.6 Get data from the rangefinder:

clover.get_range();
console.log(clover.range());

2.7 Get data from the QR code:

clover.get_qr();
console.log(clover.qr());

2.8 Determine the color:

clover.get_color();
console.log(clover.color());

2.9 Global Navigate:

clover.navigate_global(lat=55.707033, lon=37.725010, z=0, speed=5, frame_id='body'); //navigate to some coordinates

2.10 Landing:

clover.land();

Code example - test.js

cloverjs's People

Contributors

devmbs avatar

Watchers

 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.