Saved searches

Use saved searches to filter your results more quickly

Cancel Create saved search Sign up Reseting focus

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

ma-al / node-sumo Public

forked from forgeByAcision/node-sumo

A Node.js client for controlling Parrot Jumping Sumo drones.

License

Notifications You must be signed in to change notification settings

ma-al/node-sumo

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Go to file

Folders and files

Last commit message Last commit date

Latest commit

History

View all files

Repository files navigation

node-sumo

How to Install

To get started, install the npm module:

$ npm install git+https://github.com/forgeByAcision/node-sumo 

How to Use

This simple example postures the drone and moves it forwards for 1 second:

var sumo = require('node-sumo'); var drone = sumo.createClient(); drone.connect(function()  drone.postureJumper(); drone.forward(50); setTimeout(function()  drone.stop(); >, 1000); >);

API

createClient()

Returns a new Sumo

getVideoStream()

Returns a stream of MJPEG frames through the data event.

connect(callback)

Connects to the drone and executes the callback when the drone is ready to drive. Also fires the ready event when teh drone is ready.

forward(speed)

Move the drone forward at the specified speed (between 0 and 127).

backward(speed)

Move the drone backward at the specified speed (between 0 and 127).

right(speed)

Turn the drone right at the specified speed (between 0 and 127).

left(speed)

Turn the drone right at the specified speed (between 0 and 127).

stop()

Tell the drone to stop moving.

animationsLongJump()

Perform a long jump. The drone needs to be in the jumper or kicker posture to use this API.

When in kicker posture the first call will retract the drone's jump mechanism and the second will release it. You need to wait for the drone's jump mechanism to be fully retracted before releasing it. You can move the drone after the jump mechanism has been pulled in (for example, reversing up to a wall or object to kick) and before you release it.

animationsHighJump()

Perform a high jump. The drone needs to be in the jumper posture to use this API.

animationsStop()

Stop the pre-programmed animation.