node-ar-drone | js client for controlling Parrot AR Drone | Continous Integration library
kandi X-RAY | node-ar-drone Summary
kandi X-RAY | node-ar-drone Summary
The AR Drone is an affordable, yet surprisingly capable quadcopter. The drone itself runs a proprietary firmware that can be controlled via WiFi using the official FreeFlight mobile app (available for iOS and Android). Unlike the firmware, the client protocol is open, and Parrot publishes an SDK (signup required to download) including a good amount of documentation and C code. Their target audience seems to be mobile developers who can use this SDK to create games and other apps for people to have more fun with their drones. However, the protocol can also be used to receive video and sensor data, enabling developers to write autonomous programs for the upcoming robot revolution.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- do the action
- UDP constructor .
- Controls a UdpControl control .
- Stream encoder .
- UDP data stream
- A streaming video stream
- Png stream for Png streams .
- Create a new command .
- Splitter constructor .
- Parses a ReadStream .
node-ar-drone Key Features
node-ar-drone Examples and Code Snippets
Community Discussions
Trending Discussions on node-ar-drone
QUESTION
I am using node ar drone modules. My drone is parrot ar drone 2.0 gps edition I succeeded to get parrot ar drone gps data. I'd like to send the parrot ar drone to the manipulated gps position. But I cannot send gps data to parrot ar drone.
Is there any way to send manipulated gps data to my parrot ar drone?
...ANSWER
Answered 2017-Apr-10 at 23:24There are two ways you could do this.
First, the hard way. The protocol used by node-ar-drone
to talk to the AR.Drone doesn't have any way to directly give the drone coordinates to fly to, but you could do the calculations yourself.
- Enable the drone's magnetometer (see https://github.com/wiseman/webflight-traffic/blob/master/index.js#L19).
- Calibrate the magnetometer: Command the drone to take off, then do
client.calibrate(0)
(see https://github.com/felixge/node-ar-drone#clientcalibratedevice_num). - Get the drone's magnetic heading from
navdata.magneto.heading.fusionUnwrapped
. - Get the drone's current coordinates from
navdata.gps.latitude
andnavdata.gps.longitude
. Compute the desired heading to get from the drone's current position to the desination. There are subtleties to this, but for most applications you can follow the procedure described in http://www.movable-type.co.uk/scripts/latlong.html:
θ = atan2( sin Δλ ⋅ cos φ2 , cos φ1 ⋅ sin φ2 − sin φ1 ⋅ cos φ2 ⋅ cos Δλ ) where φ1,λ1 is the starting point, and φ2,λ2 is the end point (Δλ is the difference in longitude).
Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalise the result to a compass bearing (in the range 0° ... 360°, with −ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is (floating point) modulo.
Figure out if the drone needs to rotate clockwise or counter-clockwise to achieve the desired heading, and call
client.clockwise
orclient.counterClockwise
as appropriate.When the drone is facing the correct heading, tell it to move forward with
client.front
.
Once the drone is headed in the right direction, every time you get new navdata, you should check the current heading, recompute the desired heading, and tell the drone to turn clockwise or counter-clockwise if needed. Once you're within some threshold (5 feet? 50 feet?) of your desired destination, tell the drone to stop with client.stop
.
Besides the protocol that node-ar-drone
uses, the AR.Drone also supports the MAVLink protocol, used by many hobbyist and commercial drones. That protocol has a way to tell the drone to move directly to specific coordinates. You could use an application like QGroundControl to send the drone to a particular latitude, longitude, or you can use one of the existing MAVLink libraries to send messages to the drone to do the same thing.
DroneKit-Python, for example, is a high-level library that lets you write code like this (taken from this example):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-ar-drone
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page