cylon-crazyflie icon indicating copy to clipboard operation
cylon-crazyflie copied to clipboard

Can't implement the example code

Open chinweiliao opened this issue 11 years ago • 15 comments

Hi, Sorry I am a total beginner using nodejs but I kept getting: I, [2014-02-23T01:26:07.416Z] INFO -- : Initializing connections... I, [2014-02-23T01:26:07.418Z] INFO -- : Initializing connection 'crazyflie'... D, [2014-02-23T01:26:07.418Z] DEBUG -- : Loading adaptor 'crazyflie' Illegal instruction: 4 when I tried to implement the crazyflie.js. And tried to go back to aerogel but I still get "Illegal instruction: 4" and couldn't find way to solve it... THX:)

chinweiliao avatar Feb 23 '14 01:02 chinweiliao

Hi, @chinweiliao sounds to me like you need to install libusb. I've just updated the instructions here https://github.com/hybridgroup/cylon-crazyflie#getting-started it might help.

deadprogram avatar Feb 26 '14 18:02 deadprogram

@deadprogram Thanks a lot for replying:) I actually installed libusb and tried the way said on getting started, but get stuck while I tried to "node crazyflies.js" in examples folder. I googled the "Illegal instruction: 4" as well but seem like a tricky problem to solve so I posted here.

chinweiliao avatar Feb 26 '14 18:02 chinweiliao

@deadprogram would you be able to give us a hand with this? I do not have the hardware to test this.

edgarsilva avatar Aug 11 '14 18:08 edgarsilva

@solojavier has one.

deadprogram avatar Aug 11 '14 18:08 deadprogram

@chinweiliao Are you still having this issue? I'll got trough the setup process and let you know what I found...

solojavier avatar Aug 11 '14 21:08 solojavier

Sry still can't use it... But not in a hurry to solve, thanks for replying:)- Chin-Wei Liao Founder/ Designer @chinweiLiao

www.fotowith.com

On Mon, Aug 11, 2014 at 10:24 PM, Javier Cervantes [email protected] wrote:

@chinweiliao Are you still having this issue? I'll got trough the setup process and let you know what I found...

Reply to this email directly or view it on GitHub: https://github.com/hybridgroup/cylon-crazyflie/issues/4#issuecomment-51843017

chinweiliao avatar Aug 11 '14 21:08 chinweiliao

@chinweiliao, it seems the documentation on the Cylon.js driver page for the Crazyflie may be a bit outdated. Replace the example code you're using with the following:

var Cylon = require('cylon');

Cylon.robot({
  connection: { name: 'crazyflie', adaptor: 'crazyflie', port: 'radio://1/10/250KPS' },
  device: {name: 'drone', driver: 'crazyflie'},

  work: function(my) {
    my.drone.takeoff();
    after((10).seconds(), function() {
      my.drone.land();
    });
    after((15).seconds(), function() {
      my.drone.stop();
    });
  }
}).start();

Let us know if this helps solve your issue.

EnriqueCanals avatar Aug 18 '14 19:08 EnriqueCanals

@chinweiliao anyone knows the status on this one?

edgarsilva avatar Nov 12 '14 23:11 edgarsilva

Hi there!

I'm trying to test the installation of cylon-crazyflie, and I cannot run the example code.. I get the following:

$ node robot.js I, [2015-02-14T17:33:27.265Z] INFO -- : Initializing connections. I, [2015-02-14T17:33:27.337Z] INFO -- : Initializing devices. I, [2015-02-14T17:33:27.339Z] INFO -- : Starting connections. STATE: setup --> connected

TypeError: Object #<InEndpoint> has no method 'startStream' ....

I have no idea whats going on.

The crazyflie firmware, is the last one at the moment: https://github.com/bitcraze/crazyflie-firmware/releases/tag/2015.1

Hope you can help.

Thanks in advance.

adiego73 avatar Feb 14 '15 17:02 adiego73

@adiego73, I had got the same problem. Maybe, this problem was occurred by version unmatch of "node-usb" module. The "startStream" method was replaced by the "startPoll" method after v1.0.0.

I attempted to rewrite the "startStream" by the "startPoll" on usbstream.js which is under "cylon-crazyflie/node_modules/aerogel/lib/", and I have been able to run it.

I'm sorry for my poor English. Thanks.

sobeit avatar Feb 16 '15 17:02 sobeit

@sobeit Thank you very much! That works like a charm! :)

Now, I have another issue.. $ node robot.js I, [2015-02-16T18:29:08.187Z] INFO -- : Initializing connections. I, [2015-02-16T18:29:08.259Z] INFO -- : Initializing devices. I, [2015-02-16T18:29:08.261Z] INFO -- : Starting connections. STATE: setup --> connected starting telemetry

It freezes there. I can run the copter using the client, and with a c++ program I've made, so I think that there is no problem with the radio neither with the udev rules..

Any idea what's going on?

Thanks!

adiego73 avatar Feb 16 '15 18:02 adiego73

@adiego73 I think we must rewrite totally aerogel module adopting new implementation of node-usb, if we use current version of node-usb.

Not only startStream method, but other methods were replaced. For example outendpoint.write method which is used in telemetry flow and in other.

sobeit avatar Feb 17 '15 16:02 sobeit

@sobeit is exactly correct, IMO.

deadprogram avatar Feb 17 '15 23:02 deadprogram

Any upadtes on this one? do we need to do something else? can we close it yet?

edgarsilva avatar Mar 06 '15 19:03 edgarsilva

Without any extra coding, manually downgrading the usb library aerogel use solved the problem.

According to the release date, I tried using [email protected], and it works on Ubuntu 14.04 with node 0.12.0. But I have trouble using it on Windows 8.1. I failed to build [email protected] with [email protected], because it required an older version of v8.h, and building is good with [email protected], but failed to get the whole thing working.

inoc603 avatar Mar 19 '15 03:03 inoc603