A quick snippet that lets you fly your Parrot arDrone 2.0 using a Dualshock 4 controller. It also can work with other controllers, but you will have to refer to cylon-joystick docs for those manipulations.
I hate the way Parrot made their phone app, and I got inspired by Watch Dogs 2. And I was bored and totally had nothing to do.
It's all good, I gotchu.
- Clone this repo
- Plug your DS4 into your computer
- Run
node drone.js
- ???????
- PROFIT
- Clone this repo. Or just get
drone.js
- Plug your DS4 into your computer
npm install ar-drone
andnpm install cylon-joystick
- Run
node drone.js
- Try not to crash into your granny's precious oil lamp
You can do it using a USB cable or through Bluetooth, ea-sy!
Just plug it in, it's going to show up at devices list if you run cylon-joystick-explorer
. If you have a pimped out custom controller, don't forget to get the description
from there too.
If the controller still refuses to work, go to the drone.js
and do this:
devices: {
controller: { driver: 'dualshock-4', description: '%THAT NAME FROM THE DESCRIPTION%' }
}
On your controller hold(!) the Playstation button and Share button at the same time. Hold these buttons until the light bar starts rapidly flashing. Then go into your bluetooth menu and add it like any other device. Then just do the same thing as with the USB.
Hold the Playstation button and Share button for a few seconds to exit the Bluetooth mode, if you want to get back to playing your PS4.
The controls are pretty easy, you can figure them out yourself. Don't crash tho...
Just kidding, it's pretty simple.
Left stick - fly front/back or left/right
Right stick - fly up/down or turn left/right
X - take a picture
Takeoff and yet to be implemented, so you'll have to throw it up yourself (sic!) or use drone.takeoff()
and drone.land()
in console
Hit me up or open an issue. If you're brave and confident enough, do a pull request.
Software supplied as is, I am not responsible for you crashing your drone. Your mom will buy you a new one for Christmas anyway.