AR-Drone | AR drone 2.0 fly above a red circle | 3D Printing library
kandi X-RAY | AR-Drone Summary
kandi X-RAY | AR-Drone Summary
Code for making a AR drone 2.0 fly above a red circle all by itself!
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of AR-Drone
AR-Drone Key Features
AR-Drone Examples and Code Snippets
Community Discussions
Trending Discussions on 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):
QUESTION
i want ask something. i want give delay to navData read on parrot AR Drone 2.0. can you give example how to add interval to my Navdata read? and what i need to do, if i want build real time graph, can someone give tutorial link ?
...ANSWER
Answered 2017-May-31 at 05:42You can't really change the rate at which navdata comes in. You can just ignore navdata if you don't want to process it. The code below only processes navdata once per second:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install AR-Drone
Install OpenCV 3 for python 2.7
Install PS-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