Coder Social home page Coder Social logo

eschnou / ardrone-autonomy Goto Github PK

View Code? Open in Web Editor NEW
152.0 152.0 54.0 351 KB

Provides key building blocks to create autonomous flight applications with the #nodecopter (AR.Drone).

Home Page: http://eschnou.github.com/ardrone-autonomy

License: MIT License

JavaScript 100.00%

ardrone-autonomy's People

Contributors

eschnou avatar premasagar 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

ardrone-autonomy's Issues

Validate EKF inputs

Not sure how this can happen, but it seems the ekf can be called with malformed data. Anyway, it would be good practice to check data input.


/home/ganeshk/node-ar-drone/node_modules/ardrone-autonomy-master/lib/EKF.js:37
    var pitch = data.demo.rotation.pitch.toRad()
                         ^
TypeError: Cannot read property 'rotation' of undefined
    at EKF.predict (/home/ganeshk/node-ar-drone/node_modules/ardrone-autonomy-master/lib/EKF.js:37:26)
    at Controller._processNavdata (/home/ganeshk/node-ar-drone/node_modules/ardrone-autonomy-master/lib/Controller.js:248:15)
    at Client.<anonymous> (/home/ganeshk/node-ar-drone/node_modules/ardrone-autonomy-master/lib/Controller.js:60:18)
    at Client.EventEmitter.emit (events.js:95:17)
    at Client._handleNavdata (/home/ganeshk/node-ar-drone/node_modules/ar-drone/lib/Client.js:114:8)
    at UdpNavdataStream.EventEmitter.emit (events.js:95:17)
    at UdpNavdataStream._handleMessage (/home/ganeshk/node-ar-drone/node_modules/ar-drone/lib/navdata/UdpNavdataStream.js:71:10)
    at Socket.EventEmitter.emit (events.js:98:17)
    at UDP.onMessage (dgram.js:437:8)

Flight details

Hello, I'm relatively new with AR Drones and am using Terminal to launch flights and also correcting flight paths using the controller.js file present.

However, is there a way I can get the flight details of each flight that I have launched? Details such as altitude, yaw angle etc? Thank you!

Yaw not working properly

Hello,
First of all I'd like to say, this module is awesome. I have been playing with it for the past few days and I'm impressed. Very cool, indeed.

I however am having one issue with the mission.cw() and mission.ccw(). I tried the following:
mission.takeoff()
.forward(1)
.cw(90)
.ccw(90)
.backward(1)
.hover(1000)
.land()

With the above sequence, I was expecting the drone would move forward by 1m, which it did. Then yaw clockwise by 90deg. The Yaw counter-clockwise by 90deg. the come backwards by 1m and then hover for 1 second and then land.

The issue that I'm having is that, it goes forward, does the cw(90), but then it hangs in there. The rest of the steps are not executed. I have to use the emergency mode to get it down, or ctrl-c out of the program, use another window to run a land program.

I also tried the go() function with Yaw(90) and it hosed up after that.

Is anyone aware of issues with the rotation functions, in this module?

Just wanted to mention that, just using the forward(), backward(), left(), right() works well.

Any help is appreciated.

Thanks.

How do I make the drone move in two directions at the same time?

Say I want the drone to move to a point given by a specific vector with an x component and a y component. How would I make the drone move along the direction of the vector and not in 2 steps (eg. first 10 m forward then 5 m to the right)? How can I run two commands at the same time?

Question on predict in EKF

Hi and pardon my obvious question as I'm not that familiar with Javascript. Are you saving the state in the predict(data) function so that it can be returned by state()? Or is just sigma required? There is mention of updating the state, but it's not obvious that it's saved for the next pass by something like this._state = state.

Thanks in advance for your help.

How to install?

Hello!

How to install? - detailed description can be installed and run a simple example?

Guide to creating plugins

Hi Laurent, I'm a bit of a beginner with all this sort of stuff and was wondering if you were able to provide a basic guide to building custom plugins for use with WebFlight? I've enjoyed using the application but I'd like to experiment with plugins :)

Would you be able to provide a guide on the very basics of creating a plugin?

Improve documentation

The API is not fully documented yet, it currently only focuses on the Mission part, but would benefit from documentation of the controler, kalman filter, etc.

Document performance of state estimation

Can you include a plot of how well the drone can position itself?

For instance: given a goal-position in 3D, what is the drone's actual position as it drive towards the goal, and how well does it hover at this location.

Camera Streaming

Hi,
I was able to run the controller through the repl and it gave me good results by giving the goal. Now I'm trying to combine it with another code that I'm working on to stream the front camera to canvas, but when I'm doing it now it gives me the streaming from the bottom camera because in ardrone-autonomy enables the vision measure . As mentioned in the ardrone documentation that it is able to stream only one camera at a time. My question is how can I use the control that uses EKF in ardrone-autonomy and stream the front camera png at the same time? Is that possible?

Thanks,

hovering_range tum_simulation/after takeoff

I'm using the tum_simulator and i dont know where or how to set the hovering_range, like in the launch file.

Is there any commanads after takoff which sets the hovering_range?

Development with ardrone-autonomy

Hi is it possible in this module to write your own code to make the propellers rotate ? Let's say you want the propellers to rotate at a pitch and roll angle, how would you do that ? And is it possible to have uneven thrust in the 4 propellers , like programming the thrust on the back two propellers to be greater then the thrust on the front two propellers ? Any examples ? Thanks

GPS based navigation

Thank you for the effort of creating an autonomous library. However I want to know whether if there would be any development on integrating GPS based (Through NavData) autonomous approach

Drone Does not obey commands

So I'm testing the drone in an open space and gave it the following instruction:

go({x: -0.73, y: 2.25})

What I expected to happen, of course, is that it flew forward and to the left. In reality it flew backward and right. This is replicable and has happened a fair few times now. It's been suggested this is to do with non-integral values for movement, but that doesn't entirely seem to make sense?

Thanks in advance, and sorry for so many questions!

Translation and rotation with the go function from the Controller class?

Has anyone tried to use the go command from the controller class with a translation and a rotation?
If yes, How did it work out?

I am having problems implementing it. The drone becomes unstable and starts to spin about the Z axis sort of like a spinning top inside a hemisphere.

Note: I am using an A.R. Drone 2.0
My ground is not very well textured

help me with controller API

help
i dont understand how to use the controller API program.

i have installed the ardrone-autonomy modules

and now how i can get the repl.js to use the controller API program?

when i run the repl.js in the examples folder, it doesnt change anything

please help me

Cannot execute multiple missions?

Hello All,

I am currently a senior Electrical Engineering major undertaking my senior design project. My project includes many things, but most relevantly performing autonomous navigation processes on the AR Drone 2.0. My team and I have chosen to utilize ardrone-autonomy libraries we found on GitHub; however we are having some small issues with it. We are primarily using the Mission module. Our strategy involves utilizing an external freestanding to determine whether the drone is in the permitted flight zone or not. A Java program writes an integer value depending on the drone's condition. Theoretically, we wish to have the drone flying straight ahead so long as it is in the permitted area. Once it is outside, the drone should turn and return to the area. The basic idea is to have the drone snake through the seating area in this manner. I have attached an image to this e-mail that depicts this. The cones in the image mark the allowed flight zone.

We are having trouble implementing this in our drone software. Our initial idea was to have different missions written up, one to fly straight a meter, one to turn left and return, and another to turn right and return. Then the program would essentially run through an infinite loop, reading the aforementioned file and executing the desired mission. We first attempted this without the infinite loop file reading aspect. That is, we simply wrote two different missions and tried to execute them sequentially. Only the first mission is executed before the program terminates. We have attempted a couple of different ways of writing the program in order to fix this, but we have not succeeded and don't quite understand what is happening. I have listed two of the many ways we have attempted solving this issue. Our issues could also be a result of our lack of Javascript expertise. That being said, we were wondering if you could provide any insight or advice as to how to solve these issues or in which way to proceed? Any help would be greatly appreciated. Thank you so much for your time, and we look forward to hearing from you.

Way 1:
`var df = require('dateformat')
var autonomy = require('ardrone-autonomy')
var arDrone = require('ar-drone')
var arDroneConstants = require('ar-drone/lib/constants')
var mission1 = autonomy.createMission()
var mission2 = autonomy.createMission()
var d_one = 0.3048
;

function navdata_option_mask(c) {
return 1 << c;
}

// From the SDK.
var navdata_options = (
navdata_option_mask(arDroneConstants.options.DEMO)
| navdata_option_mask(arDroneConstants.options.VISION_DETECT)
| navdata_option_mask(arDroneConstants.options.MAGNETO)
| navdata_option_mask(arDroneConstants.options.WIFI)
);

// Land on ctrl-c
var exiting = false;
process.on('SIGINT', function() {
if (exiting) {
process.exit(0);
} else {
console.log('Got SIGINT. Landing, press Control-C again to force exit.');
exiting = true;
mission1.control().disable();
mission1.client().land(function() {
process.exit(0);
});
}
});

// Connect and configure the drone
mission1.client().config('general:navdata_demo', true);
mission1.client().config('general:navdata_options', navdata_options);
mission1.client().config('video:video_channel', 1);
mission1.client().config('detect:detect_type', 12);

// Connect and configure the drone
mission2.client().config('general:navdata_demo', true);
mission2.client().config('general:navdata_options', navdata_options);
mission2.client().config('video:video_channel', 1);
mission2.client().config('detect:detect_type', 12);

// Log mission for debugging purposes
//mission1.log("mission-" + df(new Date(), "yyyy-mm-dd_hh-MM-ss") + ".txt");

// Plan first mission
mission1.ftrim()
.takeoff()
.zero()
.hover(1000)
.altitude(1)
.go({x:d_one, y:0}) // 1 ft
.hover(2000)
.land();

// Plan second mission
mission2.takeoff()
.zero()
.hover(1000)
.altitude(1)
.cw(90) // turn clockwise 90 degrees
.hover(2000)
.land();

// Execute first mission
mission1.run(function (err, result) {
if (err) {
console.trace("Oops, something bad happened: %s", err.message);
mission1.client().stop();
mission1.client().land();
} else {
console.log("We are done!");
process.exit(0);
}
});

// Execute second mission
mission2.run(function (err, result) {
if (err) {
console.trace("Oops, something bad happened: %s", err.message);
mission2.client().stop();
mission2.client().land();
} else {
console.log("We are done!");
process.exit(0);
}
});`

Way 2:
var df = require('dateformat')
var autonomy = require('ardrone-autonomy')
var arDrone = require('ar-drone')
var arDroneConstants = require('ar-drone/lib/constants')
var mission1 = autonomy.createMission()
var mission2 = autonomy.createMission()
var d_one = 0.3048
;

function navdata_option_mask(c) {
return 1 << c;
}

// From the SDK.
var navdata_options = (
navdata_option_mask(arDroneConstants.options.DEMO)
| navdata_option_mask(arDroneConstants.options.VISION_DETECT)
| navdata_option_mask(arDroneConstants.options.MAGNETO)
| navdata_option_mask(arDroneConstants.options.WIFI)
);

// Land on ctrl-c
var exiting = false;
process.on('SIGINT', function() {
if (exiting) {
process.exit(0);
} else {
console.log('Got SIGINT. Landing, press Control-C again to force exit.');
exiting = true;
mission1.control().disable();
mission1.client().land(function() {
process.exit(0);
});
}
});

// Connect and configure the drone
mission1.client().config('general:navdata_demo', true);
mission1.client().config('general:navdata_options', navdata_options);
mission1.client().config('video:video_channel', 1);
mission1.client().config('detect:detect_type', 12);

// Connect and configure the drone
mission2.client().config('general:navdata_demo', true);
mission2.client().config('general:navdata_options', navdata_options);
mission2.client().config('video:video_channel', 1);
mission2.client().config('detect:detect_type', 12);

// Log mission for debugging purposes
//mission1.log("mission-" + df(new Date(), "yyyy-mm-dd_hh-MM-ss") + ".txt");

// Plan first mission
mission1.ftrim()
.takeoff()
.zero()
.hover(1000)
.altitude(1)
.go({x:d_one, y:0}) // 1 ft
.hover(2000)
.land();

// Plan second mission
mission2.takeoff()
.zero()
.hover(1000)
.altitude(1)
.cw(90) // turn clockwise 90 degrees
.hover(2000)
.land();

// Execute first mission
mission1.run(function (err, result) {
if (err) {
console.trace("Oops, something bad happened: %s", err.message);
mission1.client().stop();
mission1.client().land();
} else {
// Execute second mission
mission2.run(function (err, result) {
if (err) {
console.trace("Oops, something bad happened: %s", err.message);
mission2.client().stop();
mission2.client().land();
} else {
console.log("We are done!");
process.exit(0);
}
});
}
});``

EKF Yaw

Are there any plans to make EKF correction step yaw work? Thanks!

Drone Goes Crazy in Midair

Hi,

So I'm using the autonomy library to control my drone and most of the time things seem to go fine, however occasionally I will give it instructions and it will suddenly go crazy while staying in roughly the same position - it will buck around, rotate a bit and then eventually declare it did what it was told to do.

Specifically and most recently I tried the following instructions: [UP 0.32, FORWARD 0.8] which translate accordingly to the correct mission instructions.

Any advice?

Exception when trying to run the sample program

I'm a drone and JavaScript newbie trying to mess around with this API. I've installed this library using npm install ardrone-autonomy and copy/pasted the code in the Mission section of the README. When I connect to my drone and try to run said code, I get the following exception:

$node autonomy-test.js

/Users/jfranklin/node_modules/ardrone-autonomy/lib/EKF.js:37
    var pitch = data.demo.rotation.pitch.toRad()
                         ^
TypeError: Cannot read property 'rotation' of undefined
    at EKF.predict (/Users/jfranklin/node_modules/ardrone-autonomy/lib/EKF.js:37:26)
    at Controller._processNavdata (/Users/jfranklin/node_modules/ardrone-autonomy/lib/Controller.js:259:15)
    at Client.<anonymous> (/Users/jfranklin/node_modules/ardrone-autonomy/lib/Controller.js:60:18)
    at Client.EventEmitter.emit (events.js:95:17)
    at Client._handleNavdata (/Users/jfranklin/node_modules/ar-drone/lib/Client.js:120:8)
    at UdpNavdataStream.EventEmitter.emit (events.js:95:17)
    at UdpNavdataStream._handleMessage (/Users/jfranklin/node_modules/ar-drone/lib/navdata/UdpNavdataStream.js:73:10)
    at Socket.EventEmitter.emit (events.js:98:17)
    at UDP.onMessage (dgram.js:437:8)

Am I doing something wrong? If so, what?

Is front camera used in stabilisation?

In your Readme it says that you use bottom camera for ground speed measurement. Is the front camera also used for similar stabilization/speed measurement ?

Measure and Pose coordinate of EKF

Hi, I'm new working on ardrone project. I'm using this package to make use of EKF. I have a question on EKF inputs. When I monitoring the xy of measure and pose inputs. They are 0 all the time is that how it suppose to be or I have something wrong?
What about using the front camera instead of the bottom camera as it is the same concept to get a tag. I tried that and It works by configuring the video.channel to 0.
BTW I modify the condition in controller.js line 265 to (d.visionDetect && d.visionDetect.nbDetected >= 0) instead of (d.visionDetect && d.visionDetect.nbDetected > 0) to get it enter the loop.
Please if anyone working on this package I need your help,

Thanks,

Indoor, sub-meter movement/sensing

(I couldn't find a better place for this type of discussion. If you can point me in that direction we can close this and I can post it there...)

I just got my first AR Drone the other day and was playing around with a few different libraries to control it. I like the idea of using distance rather than amounts of thrust to control it so it brought me to this library. Looks great!

I was testing indoors at first since there is some concern about it going crazy due to the fact that it is an early project. When I tried to move it around with .1 or .25 m directions it would almost immediately veer quickly in one direction and crash against a wall. I'll try some more, but for the few runs I did it was pretty consistant.

A few questions:

  • Are sub-meter changes in location supported? Are there reasons why this wouldn't work?
  • Has anyone tried using this indoors yet? I would assume the camera could still pick out features to be able to use as a reference point.
  • Does the library know when it is on path vs. correcting back onto path?
  • What is the best process to start troubleshooting/debugging this?
  • If I add a distance sensor (like the one on the bottom) that scans the horizon via something like Arduino or Spark would that help? Are there recommendations on how to integrate this into the library?

Anyways, a bunch of questions, but just trying to figure out what my next steps are to figure out what is going on, whether this is the right library for me and if I can help improve it.

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.