3

I am working on a project about autonomous flight, and I am using an ARDrone 2.0. I wonder which API is better to send command to the drone. I have seen that I am able to use NodeJS or the ROS platform, but I would like that someone with experience can help me to make a wise decision.

The most important thing for me is stability about reading data from sensors and receiving data from a laptop. I do not have trouble if I have to learn a programming language or a library.

BMitch
  • 231,797
  • 42
  • 475
  • 450
lmiguelvargasf
  • 63,191
  • 45
  • 217
  • 228

2 Answers2

3

ROS

I do not know NodeJS, but I am using ROS for some years now, so I can give you some information about it.

ROS is modularized and has a nice publisher/subscriber system to exchange messages between the individual modules (called nodes in ROS jargon) using callback functions.

Typically you have a separate node for each task and for each sensor. A "task node" that needs some data, subscribes to a specific topic and registers a callback function. A "sensor node" fetches data from the sensor, wraps the data in a message and publishes this message to a topic. The callback functions of all nodes, that have subscribed to this topic are automatically called, every time a new message is published. This way it is easy to exchange data between individual nodes and you can easily exchange parts of your program, e.g. if you want to use an other sensor or if the task changed.

It is further very easy to subscribe to nodes that are running on a different machine in the network, so you can send data from your laptop to the drone without additional effort (given they are connected to the same network).

ROS supports both C++ and Python. There are also bindings for Java, JavaScript and LISP, but I do not know how complete and stable they are (never used on of them).

In addition to the core framework, ROS ships with many useful modules and a nice visualization tool and has a comprehensive beginner tutorial.

luator
  • 4,769
  • 3
  • 30
  • 51
  • ROS seems a really good option, but I wonder how much time I need to learn the basics, and the stuff I need to finish this project. You know the problem is that I have to complete this project and a report about it by the second week of May, and I have a part time work. In addition, I have to develop an Android app to draw the trajectory the drone is going to follow, so now everything is a matter of time. – lmiguelvargasf Apr 08 '15 at 13:39
  • @lmiguelvargasf: hm, I think it needs some time to get familiar with the structure of ROS (you have to setup a workspace, create and build a new package for your stuff, etc). It uses CMake for its build system, so it's probably easier if you are already familiar with CMake. – luator Apr 08 '15 at 14:40
  • 1
    You could maybe try to start with the tutorials and see, if you make progress fast enough. I would say the first 13 sections of the tutorial should be sufficient (and you can probably skip some to get there faster). – luator Apr 08 '15 at 14:44
  • Hi @luator ...I have been using ROS from 2 months.. Still I am not getting the grasp of this. http://stackoverflow.com/questions/43060697/drones-motion-is-unstable-with-ros-topics can you share your drone control code in ROS? It will be helpful for me – Kathiravan Natarajan Mar 29 '17 at 02:16
  • @Kathir I'm sorry, but I never worked with drones, so I have nothing to share there (I use ROS mostly for wheeled robots, moving on the ground). – luator Mar 29 '17 at 08:23
2

Given the short timeframe for your project, I would recommend node-ar-drone, using Javascript to control the drone:

  1. It's very easy--You don't need to learn a robotics framework, just a relatively simple API.
  2. It has users: There are at least 3 or 4 people actively posting and responding to issues on the github repository.
  3. There are lots of projects showing how to use the library, ranging from simple to complex. For example, ar-drone-rest, webflight, ar-drone-autonomy.
John Wiseman
  • 3,081
  • 1
  • 22
  • 31