Giter Club home page Giter Club logo

node-bebop's Introduction

node-bebop

Build Status Test Coverage

Control your Parrot Bebop drone using JavaScript!

This module allows you to control, receive nav data, and receive video data from the Parrot Bebop WiFi controlled drone.

The implementation attempts to use the same interface as the node-ar-drone node module from @felixge and @rmehner, so it can be mostly NodeCopter compatible.

How to Install

To get started, install the npm module:

$ npm install node-bebop

How to Use

This simple example takes off, then lands after 5 seconds:

var bebop = require('node-bebop');

var drone = bebop.createClient();

drone.connect(function() {
  drone.takeOff();

  setTimeout(function() {
    drone.land();
  }, 5000);
});

NodeCopter-compatible API

createClient()

Returns a new Bebop

connect(callback)

Connects to the drone and executes the callback when the drone is ready to fly.

getVideoStream()

Returns a stream of h.264 frames.

getMjpegStream()

Returns a stream of mjpeg images.

takePicture()

Takes a picture and saves the image to the internal storage.

startRecording()

Starts recording video to the internal storage.

stopRecording()

Stops a previously started recording and saves to internal storage.

takeOff(callback)

Tell the drone to lift off the ground. Executes the callback when the drone is in the air.

land(callback)

Land the drone. Executes the callback when the drone is on the ground.

stop()

Tell the drone to hover in place.

emergency()

Tell the drone to drop like a stone.

up(val)

Cause the drone to increase in altitude at 0-100 speed

down(val)

Cause the drone to decrease in altitude at 0-100 speed

right(val)

Cause the drone to move to the right at 0-100 speed

left(val)

Cause the drone to move to the left at 0-100 speed

forward(val)

Cause the drone to move forward at 0-100 speed

backward(val)

Cause the drone to move backward at 0-100 speed

clockwise(val)

Cause the drone to spin in a clockwise direction at 0-100 speed

counterClockwise(val)

Cause the drone to spin in a counter clockwise direction at 0-100 speed

frontFlip()

Tell the drone to do a front flip

backFlip()

Tell the drone to do a back flip

rightFlip()

Tell the drone to do a flip to the right

leftFlip()

Tell the drone to do a flip to the left

Full API

The node-bebop module supports both the above NodeCopter-compatible interface, as well as the full Parrot 3.x API command and events set. For info on the full API, please check out the docs directory here:

https://github.com/hybridgroup/node-bebop/blob/master/docs/

Release History

0.6.0 Update for new 3.2.x drone firmware

0.5.0 Refactor Bebop command builder

0.4.0 Initial support for full Bebop command set

0.3.0 Add getVideoStream, getMjpegStream, picture taking and video recording methods

0.2.0 Add flip commands, implement ack processes, emit flying state and battery events

0.1.0 Initial release

License

Copyright (c) 2015-2016 The Hybrid Group. Licensed under the MIT license.

node-bebop's People

Contributors

deadprogram avatar johan-olsson avatar kakakikikeke-fork avatar zankich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-bebop's Issues

unknown event output is undisplayable unicode (Mac OSX 10.11, english)

Hi,
I was testing out the GPS / networking functionalities, and noticed that the output when an unknown event is received is unable to be displayed on my computer. Here's how to reproduce:

$ node
> var bebop = require("path to bebop lib");
undefined
> var drone = bebop.createClient()
undefined
> drone.connect()
undefined

after this, it will immediately start logging:

recived unknown event ๏ฟฝ

recived unknown event ๏ฟฝ

recived unknown event ๏ฟฝ

recived unknown event ๏ฟฝ

recived unknown event ๏ฟฝ

recived unknown event ๏ฟฝ

recived unknown event ๏ฟฝ

recived unknown event ๏ฟฝ

recived unknown event ๏ฟฝ

is there an alternative to simply console.logging whenever an unknown network event is received? it quickly clogs up the log and makes interacting with the drone through the node interpreter impossible.

Thanks!

what each row of data in the flightPlan.mavlink file means?

QGC WPL 120
0 0 3 2500 0.000000 30.000000 2073600.000000 0.000000 0.000000 0.000000 0.000000 1
1 0 3 178 0.000000 6.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 1
2 0 3 16 0.000000 5.000000 0.000000 360.000000 34.084763 -118.278091 3.000000 1
3 0 3 50000 0.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1
4 0 3 21 0.000000 0.000000 0.000000 360.000000 34.084763 -118.278091 3.000000 1
5 0 3 2501 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1

Guys none of the node-bebop program ending they dont come out to prompt at all

Hi Everyone,

I wrote below script to calibrate drone
calibrate.js
`var bebop = require('node-bebop');
var drone = bebop.createClient();
drone.connect(function(){
drone.Calibration.magnetoCalibration(1);

drone.on("MagnetoCalibrationStateChanged", function(data) {
  console.log(data);

});
});`

I executed it using nodejs like below
$ nodejs calibrate.js

The output is like below

{ xAxisCalibration: 0, yAxisCalibration: 0, zAxisCalibration: 0, calibrationFailed: 0 } { xAxisCalibration: 0, yAxisCalibration: 0, zAxisCalibration: 1, calibrationFailed: 0 } { xAxisCalibration: 0, yAxisCalibration: 1, zAxisCalibration: 1, calibrationFailed: 0 } { xAxisCalibration: 1, yAxisCalibration: 1, zAxisCalibration: 1, calibrationFailed: 0 }

After calibrating all axis program should end and come out to prompt. It doesnt happen, programs stays in loop with blank screen after shown output. I had to press Ctrl+C to stop program. Is there any solution to it?

Thanks and Regards
ManjuH
Once the calibration done it should

Live stream to browser

Is there a way to live stream the h264 video received from getVideoStream() to an html

Not compatible with Node.js 0.10.x

var bebop = require('node-bebop');

var drone = bebop.createClient();

drone.connect(function() {
drone.SpeedSettings.outdoor(0);
});

TypeError: value is out of bounds
at TypeError ()
at checkInt (buffer.js:784:11)
at Buffer.writeUInt8 (buffer.js:794:5)
at Object.module.exports.u8.write (/home/esra/node_modules/node-bebop/lib/types.js:9:14)
at /home/esra/node_modules/node-bebop/lib/commandToBuffer.js:59:22
at Array.forEach (native)
at writeBuffer (/home/esra/node_modules/node-bebop/lib/commandToBuffer.js:57:11)
at module.exports (/home/esra/node_modules/node-bebop/lib/commandToBuffer.js:68:10)
at SpeedSettings.outdoor (/home/esra/node_modules/node-bebop/lib/SpeedSettings.js:37:16)
at /home/esra/Projects/AVA/test.js:6:22

Bebop 2 change IP range

Hello,
Does anyone know of any way to change the IP range to, for example 192.16.0.0/16, of bebop 2?

Regards
Bruno Barbosa

Bebop 2 mjpeg-stream not working

Hello,

I was trying to run the sample "mjpeg-stream" in my Beboop 2, however I encounter the following error:

/home/bruno/app/node_modules/node-bebop/lib/types.js:86
return arg.enum[buffer.readInt32LE(index)].name;
^
TypeError: Cannot read property 'name' of undefined
at Object.module.exports.enum.read (/home/bruno/app/node_modules/node-bebop/lib/types.js:86:49)
at /home/bruno/app/node_modules/node-bebop/lib/bebop.js:330:18
at Array.forEach (native)
at Bebop._packetReceiver (/home/bruno/app/node_modules/node-bebop/lib/bebop.js:327:21)
at Socket.EventEmitter.emit (events.js:98:17)
at UDP.onMessage (dgram.js:440:8)

Any suggestion?

Greetings,
Bruno Barbosa

Still error with arg.enum[value].name node_modules/node-bebop/lib/types.js:102 name = arg.enum[value].name;

I used the standard example and still got

node_modules/node-bebop/lib/types.js:102
name = arg.enum[value].name;

TypeError: Cannot read property 'name' of undefined
at Object.module.exports.enum.read (/home/kuche/git/node_modules/node-bebop/lib/types.js:102:33)
at Bebop._packetReceiver (/home/kuche/git/node_modules/node-bebop/lib/bebop.js:343:16)
at emitTwo (events.js:87:13)
at Socket.emit (events.js:172:7)
at UDP.onMessage (dgram.js:480:8)

with Version 0.5.0.

Fixed it in types.js line 99-108 temporary with:

...
if (!arg.enum || value > arg.enum.length) {
          name = "unknown enum";
        } else {
          try {
              name = arg.enum[value].name;
          }catch(e){
              console.log("Exception in fix @types.js/105");
              name = "unknown enum";
          }
        }
...

Maybe there is a better Solution...

mavlink.start not working?

Hello,

I'm trying to run a flightPlan in mavlink format, but i get an error:
It seems that this lib cannot parse the string? there is no write method in string type.

Code and error description bellow.

code:
var obj = { filepath: "flightPlan.mavlink", type:"flightPlan" };
drone.Mavlink.start(obj);

error:
\node_modules\node-bebop\lib\commandToBuffer.js:64
types[part.type].write(buffer, parseInt(part.value, 10), offset);
^

TypeError: types[part.type].write is not a function
at path..\node_modules\node-bebop\lib\commandToBuffer.js:64:22
at Array.forEach (native)
at writeBuffer (path..\node_modules\node-bebop\lib\commandToBuffer.js:61:11)
at module.exports (path..\node_modules\node-bebop\lib\commandToBuffer.js:73:10)
at Mavlink.start (path..\node_modules\node-bebop\lib\Mavlink.js:13:16)
at path..\node_modules\node-bebop\examples\mavlink.js:11:19
at null. (path..\node_modules\node-bebop\lib\bebop.js:255:7)
at null. (path..\node_modules\node-bebop\lib\bebop.js:273:5)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)

Thank you

Video stream issues: Jumpy MJPEG stream / isolating H264 frames from the stream

Hi,

I'm trying to do image processing on the video stream (from a Bebop 2) outside of node (for example, in a Python process). My goal is to use a named pipe to send each frame to the other process. I've managed to achieve this with getMjpegStream, but that stream is very inconsistent (even without my sending images over the pipe) and gives me about 1 fps. When I run the example, I get the following error repeatedly:

Error: Error loading file at Error (native) at Timeout._repeat (/home/pi/roboTC/controller_files/node-bebop/examples/mjpeg-stream.js:25:8) at Timeout.wrapper [as _onTimeout] (timers.js:417:11) at tryOnTimeout (timers.js:224:11) at Timer.listOnTimeout (timers.js:198:5)

And occasionally, I get the following error:
Corrupt JPEG data: premature end of data segment

I'd either like to either figure out a way to improve the quality of the MJPEG stream, or figure out how to use the H264 stream. The example provided for using the H264 stream pipes the feed to a file, but I need to process in real time.

Can anyone recommend a fix for the MJPEG stream, or give me guidance / an example of how I can isolate H264 frames so I can convert them to Base64 and pipe them out?

Relevant previous threads:
#9 (Live stream to browser) / #14 (newbie question. how can i get videostream off the bebop)

Both of these are focused on using Broadway to display the feed in a browser. Since I'm keeping the feed local it seems like this doesn't apply to my situation, and I haven't been able to get anything working after playing with Broadway.

Hardware and OS:
Raspberry Pi 3 running Raspbian Jessie.

Thanks everyone, appreciate any help you can provide!

Unexpected NULs in flightpath filename

Following https://github.com/hybridgroup/node-bebop/blob/88512f1bfa0e8321c269961442a373fa4c9e1df5/examples/flightplan.js I am running into some issues.

I have tried both filepaths with the same results:

  drone.on("AvailabilityStateChanged", function(data) {
    console.log("AvailabilityStateChanged", data);
    console.log(data.AvailabilityState);
    if (data.AvailabilityState === 1 && !alreadyFlying) {
      alreadyFlying = true;
      //drone.Mavlink.start("/data/ftp/internal_000/flightplans/much-smaller-flightplan.mavlink", 0);
      drone.Mavlink.start("much-smaller-flightplan.mavlink", 0);
    }
  });
ready
BatteryStateChanged
76
unknown <Buffer 00 05 0b 00 00 0e 00 0e 00 00 00 00 00>
FlyingStateChanged
landed
ComponentStateListChanged { component: 'Calibration', State: 1 }
ComponentStateListChanged { component: 'GPS', State: 1 }
ComponentStateListChanged { component: 'Mavlink_File', State: 1 }
ComponentStateListChanged { component: 'TakeOff', State: 1 }
AvailabilityStateChanged { AvailabilityState: 1 }
1
MavlinkFilePlayingStateChanged { state: 'stopped',
  filepath: '/data/ftp/internal_000/flightplans/much-smaller-flightplan.mavlink\u0000\u0000\u0000\u0000\u0000',
  type: 'unknown enum' }
GPSFixStateChanged { fixed: 1 }
unknown <Buffer 01 14 07 00 01 00 00 00>
unknown <Buffer 01 14 08 00 01 00 00 00>
unknown <Buffer 01 14 09 00 00 00 00 00>
unknown <Buffer 86 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00>
unknown <Buffer 86 00 04 00 01 00 00 00 3f 00 7f 00>
unknown <Buffer 86 00 04 00 02 00 00 00 00 00 7f 00>
unknown <Buffer 86 00 04 00 03 00 00 00 00 00 7f 00>
MavlinkFilePlayingStateChanged { state: 'playing',
  filepath: '\u0000\u0000\u0000\u0000\u0000',
  type: 'invalid enum' }
ComponentStateListChanged { component: 'Mavlink_File', State: 1 }
ComponentStateListChanged { component: 'TakeOff', State: 1 }
ComponentStateListChanged { component: 'Mavlink_File', State: 0 }
AvailabilityStateChanged { AvailabilityState: 0 }
0
MavlinkFilePlayingStateChanged { state: 'stopped',
  filepath: '/data/ftp/internal_000/flightplans/much-smaller-flightplan.mavlink\u0000\u0000\u0000\u0000\u0000',
  type: 'unknown enum' }
unknown <Buffer 01 04 09 00 26 a3 7c 2e 40 6e 40 40 4e 16 0c ae 39 3c 58 c0 00 00 00 00 00 b0 60 40 00 00 00>
unknown <Buffer 01 04 09 00 26 8d e2 2f 40 6e 40 40 13 0c bf ae 39 3c 58 c0 00 00 00 00 00 b0 60 40 00 00 00>
unknown <Buffer 01 04 09 00 26 61 ae 32 40 6e 40 40 70 00 72 af 39 3c 58 c0 00 00 00 00 00 b0 60 40 00 00 00>
unknown <Buffer 01 04 09 00 66 77 48 31 40 6e 40 40 70 00 72 af 39 3c 58 c0 00 00 00 c0 cc ac 60 40 00 00 00>

I don't know why there are NULs in my filepath (this is probably resulting in my invalid enum type):

MavlinkFilePlayingStateChanged { state: 'stopped',
  filepath: '/data/ftp/internal_000/flightplans/much-smaller-flightplan.mavlink\u0000\u0000\u0000\u0000\u0000',
  type: 'unknown enum' }

MavlinkFilePlayingStateChanged { state: 'playing',
  filepath: '\u0000\u0000\u0000\u0000\u0000',
  type: 'invalid enum' }

Could I get some help regarding exactly which filepath I should give it and where there are null bytes being appended to the paths?

This is the mavlink for reference:

QGC WPL 110
0	0	0	16	0	0	0	0	32.861392	-96.940992	0	1
1	0	3	22	15	0	0	0	32.8613756	-96.94081343	15	1
2	0	3	16	0	0	0	0	32.86123519	-96.94079526	25	1
3	0	3	16	0	0	0	0	32.86122604	-96.94091699	15	1
4	0	2	20	0	0	0	0	32.86136033	-96.9410587	25	1

Would the line-endings being \r\n be an issue? Do they need to be \r, or \n?

How to use events for Battery

Hello! Thank you again for this nice code.
I am very new to node js.
Could someone briefly give me an example how to use events?
I am trying to display battery level, but I am having a difficulty.
Thank you!

Problem with battery get

Hi @deadprogram ,
I do not know if anyone has noticed, but the battery event is only released if the battery status change.

There is no possibility to pick immediately the battery status?

greetings

getMjpegStream is undefined

I was doing some testing with node-bebop and opencv when I stumbled upon this. I am currently using v0.2.0.

/Users/timotius02/code/drone/app.js:12
    var mjpg = drone.getMjpegStream();
                     ^
TypeError: undefined is not a function
    at /Users/timotius02/code/drone/app.js:12:22
    at Socket.<anonymous> (/Users/timotius02/code/drone/node_modules/node-bebop/lib/bebop.js:406:7)
    at Socket.emit (events.js:107:17)
    at readableAddChunk (_stream_readable.js:163:16)
    at Socket.Readable.push (_stream_readable.js:126:10)
    at TCP.onread (net.js:529:20)

flightplan.js didnt work

Hi Everyone,

I tried autoflight sample flightplan.js today. I executed it on Ubuntu 14.04LTS. It didnt run. I am updating steps involved in executing it.

  1. Switched on Drone (Calibration done before hand)
  2. Connected to drone file system using ftp
  3. /data/ftp/internal_000/flightplans directory structure was not there. Created it using mkdir.
  4. copied my flightPlan.mavlink to created directory
  5. Then modified below line
    drone.Mavlink.start("/data/ftp/internal_000/flightplans/flightpPan.mavlink", 0);
    (It didnt work as above which is default line in flightplan.js)
    Changed it to
    drone.Mavlink.start("flightpPan.mavlink", 0);
  6. Drone did not takeoff/fly. I am attaching output screen to this issue.

Please tell me what is wrong or the sample itself is missing something?

Thanks and Regards
ManjuH
flightplan-failure

Take Picture and Send to server?

Is there anyway that we can use takePicture and send it back to the server. We are controlling the drone, but want to be able to take a picture from the drone and send it to a visual recognition API so if we can get it back to the server where we are controlling the drone we can do the rest.

Example code 'mjpeg-stream.js' isn't working...

Hello,

I'm trying to run an example code 'mjpeg-stream.js', but I can't get images.

I checked this code, and I found variant buf's value is still 'null'.

I guess a Bebop Drone's image data was not transferred to variant 'data'.

mjpg.on("data", function(data) {
buf = data; -> The data was not transferred. I guess...
});

What should I do????

Somebody help me

Takeoff Issue

Hello.
I tried the following code and noticed that takeoff was not working properly: it initially ascended for 0.5 meter and then descended near to a ground. And this behavior (up and down) was kept going on. I also tried the sample code of takeoff.js and changed setTiemout time to 20seconds, but the same problem happened. I would like to ask whether the same problem happened to other people.
Thank you for your time.

P.S. Just to make sure that the problem is on the hardware, I checked via taking off through app, but it worked well with the app.

Personal code:

"use strict";

// Load modules
var bebop = require("../.")
var cv = require("opencv")

var drone = bebop.createClient()
var mjpg = drone.getMjpegStream()
var buf = null
var w = new cv.NamedWindow("Video", 0)

drone.connect(function() {

  // Drone is ready to operate
  drone.once("ready", function() {
    // Turn on mjepg streaming
    drone.takeoff() 

    drone.once("flying", function() {
      console.log("INFO: Drone take off success")

      loop = setInterval(function() {
        console.log("Do nothing")
      }, 100)
    })
  })
})

takeoff.js

"use strict";

var bebop = require("../.");

var drone = bebop.createClient();

drone.connect(function() {
  drone.takeOff();

  setTimeout(function() {
    drone.land();
  }, 20000);
});

opencv-face-tracking.js

So, I've installed opencv and ffmpeg in order to run this program, but nothing happen after I execute it? How do I make this work?

Making it easier to send commands to drone.

I was thinking of implementing an easier way to communicate with the drone. My suggestion is that we use a similar method to getting the events from the xml files.

For example if one would like to add a call to tilt/pan the camera:

First take a look in the xml to see what we need to do this.

    <class name="Camera" id="1">
        Ask the drone to move camera

        <cmd name="Orientation">
            Ask the drone to move camera.

            <arg name="tilt" type="i8">
                Tilt camera consign for the drone (in degree)
                The value is saturated by the drone.
                Saturation value is sent by thre drone through CameraSettingsChanged command.
            </arg>

            <arg name="pan" type="i8">
                Pan camera consign for the drone (in degree)
                The value is saturated by the drone.
                Saturation value is sent by thre drone through CameraSettingsChanged command.
            </arg>
        </cmd>
    </class>

Then call something like this:

Drone.cmd(1, "Camera", "Orientation", {
 tilt: 45,
 pan: 45
});
//Drone.cmd(<XMLFile>, <ClassName>, <CMDName>, <argumentObject>);

What do you think about this?

Video stream is 'jumpy'

I noticed that when recording or streaming video from my Parrot drone, the video stream does not seem to be consistent. It's almost as if it stops randomly and then starts again. Any ideas why this might be?

moving commands speed parameter

Hi,
I would like to know what is the unit used in implementing the speed parameter in the moving functions like "forward", "backward", "left" and "right". It says in the documentation that the speed are from 0 to 100 but what it is in term of what? like meter/sec? I need this information urgently as I am trying to make bebop moves in certain distance.

regards,

I need to send my bebop 2 to a GPS point

HI,

I nedd to send my bebop 2 to a GPS coordinate. Can i use this command "
GPSSettings.sendControllerGPS(obj)"? I try this but nothing happens.

Regards,
Bruno Barbosa

no data on MjpegStream

Hi,
Recently, for some reason I don't quite understand, the event on data of the mjpegStream is not activated, can someone please tell me why this is happening? I'm developing a project and its very important to me being to get the images captured by the drone.

image

keyboard control

Sorry it is not really a problem, I just wonder what would be the best approach to have control with the keyboard keys using this module. Currently, RTP example for firmware 4 seems to be working fine for video access, ideally it should be combined with video stream

Is the CameraOrientationChanged Event Missing?

Hi!

I don't seem to find an event which confirms the successful execution of the command Camera.Orientation(tilt, pan). Did I overlook it or is it missing?

The Parrot SDK API documentation states there is the 'Camera orientation changed' event after calling SetCameraOrientation(tilt, pan).

Any hints on how to implement that in case its missing? Need to extend constants.js and commands.js + bebop.js?

Thanks for your feedback.
Cheers,
Jonas

No Events fired

I registered to several events (ready,battery,landed,takingOff, Video, etc) but when running my application the only event that is fired is the ready event. All other events seem not be emitted or something. Even the example events.js is not working for me.
I installed the newest firmware on the drone and also got the latest version of node-bebop. Taking off and piloting works fine.

Any suggestions?

Drone starts drifting

It seems like once I make drone take off using drone.take Off() and then start doing any other movements clockwise or right and left it start s drifting a lot all over the place. I am wondering if I am missing something

Program is really straight forward with takeoff and clockwise wrapped into setTimeout just like in the dance.js example I would expect drone to stay in place but it drifts away for at few meters in the matter of 10-15 sec

lossing connection

Hello,

I we are using this module in our senior project to make the drone autonomously track a target .However , I tried the provided sample code and the drone kind of losing connection after taking off ,what happens exactly is that after executing the script the drone takes off and keeps taking off or sometimes just hanging in the air without executing the land command . This causes us a serious problem since we loose the control on the drone and the only way to stop it is by physically forcing it to land and that causes it to enter kind of emergency state .

We are new to the Drones field any advices or recommendations will be highly appreciated.

In addition we are looking for detailed documentation on how to use this module or any previous projects done using it .

Thank you in advance.

var bebop = require('node-bebop');

var drone = bebop.createClient();

drone.connect(function() {
drone.takeOff();

setTimeout(function() {
drone.land();
}, 5000);
});

CurrentDate and CurrentTime commands not working.

Hi, the code I am executing to try and change the date are as follows:

var today = new Date().toISOString().split('T');
drone.Common.currentDate(today[0]);
drone.Common.currentTime('T' + today[1]);

I've inspected the packet that is sent to the drone and compared it with what is sent from the phone app (FreeFlight 3).

Date, phone -> drone
04 0b 01 16 00 00 00 00 04 01 00 32 30 31 36 2d 31 31 2d 31 33 00

Date, computer -> drone
02 0a 04 15 00 00 00 00 04 01 00 32 30 31 36 2d 31 31 2d 31 33

From bebop.py I can see that the first 2 bytes correspond to the data type and id. How come these are different? Shouldn't they be the same as FreeFlight uses the official SDK?

dgram 404

Hello,
trying to create sample project in a browser for now.

Your JS has 3 dependencies: net/util/dgram.

"npm install dgram" results in a 404 however. Could you clarify where the dgram you used came from?

Thanks

Movements

I am using this for a competition and I have a question for you. Is there any way of making the bebop move forwards or backwards using this library or is there any way you could update to add that functionality. It would be greatly appreciated.

video

Having trouble grabbing the live video stream on my mac. Very new to all of this. was wondering if someone could explain a stepwise process on grabbing the video.

enable video

With my bebop 2 when i send the command MediaStreaming.videoEnable(1) the event VideoEnableChanged return { enabled: 'error' }.

I don't understand why.

Compatibility with bebop 1 ?

Hey i'm wondering what should i do to make this api compatible with be
currently it's working but the drone is hella drifting and hard to control

bind EADDRINUSE

Hello. I tried to run some sample code such as takeoff.js.
However, I am consistently getting the following error:

dkkim930122@dkkim930122:~/node-bebop/examples$ node takeoff.js 
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: bind EADDRINUSE
    at exports._errnoException (util.js:746:11)
    at dgram.js:224:28
    at dns.js:85:18
    at process._tickCallback (node.js:355:11)

Could someone help me with this error?

For more information,
I installed node-bebop through using the following command:
npm install git:github.com/hybridgroup/node-bebop.git
My node version is v0.12.6 and npm is 2.11.2.

Thank you for your help!

How to use "Common.currentDate()" and "Common.currentTime()"

Hello,
i can't set current date and time of controller.
i think use "Common.currentDate()" and "Common.currentTime()" code.
but, it will not happend CurrentDateChanged and CurrentTimeChanged.

(sample)

var bebop = require('node-bebop');
var drone = bebop.createClient();

drone.on("CurrentDateChanged", function(data) {
console.log("CurrentDateChanged", data );
});

drone.on("CurrentTimeChanged", function(data) {
console.log("CurrentTimeChanged", data );
});

drone.connect(function(){
drone.Common.currentDate("2016-05-22");
drone.Common.currentTime("'T'101533+0200");
});

Camera movement?

Hi guys.

Haven't had a chance to dig through every line yet but so far I'm thoroughly impressed.

One thing I didn't see was anything to do with moving the camera frame. I've noticed its mostly absent in all of the 3rd party bebop stuff. Is there a technical hurdle or is it just not implemented.

I appreciate all the hard work. Looking forward to participating where I can

Not possible to get video stream

I want to fetch the video stream from the bebop 2. I tried the following code:

var drone = require('node-bebop');
var client = drone.createClient();
client.connect();
var video = client.getVideoStream();
video.on('data', console.log);

This throws the following error, and also the video example scripts are throwing the same error:

/home/mh9r/node_modules/node-bebop/lib/types.js:86
      return arg.enum[buffer.readInt32LE(index)]._name;
                                                ^

TypeError: Cannot read property '_name' of undefined
    at Object.module.exports.enum.read (/home/mh9r/node_modules/node-bebop/lib/types.js:86:49)
    at /home/mh9r/node_modules/node-bebop/lib/bebop.js:330:18
    at Array.forEach (native)
    at Bebop._packetReceiver (/home/mh9r/node_modules/node-bebop/lib/bebop.js:327:21)
    at emitTwo (events.js:100:13)
    at Socket.emit (events.js:185:7)
    at UDP.onMessage (dgram.js:481:8)

It seems that some parsing is not working correctly? The bebop 2 is on the latest firmware.

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.