A solar powered, piloted plane flying across america. A dashboard website
A solar powered, piloted plane flying across america. A dashboard website
This project uses Max/MSP to control and track a Parrot AR-drone quadcopter, using an intermediary server which runs the (open source) node-ar-drone in node.js. https://github.com/felixge/node-ar-drone
https://github.com/tkzic/internet-sensors
folder: ar-drone
Install node.js on your computer. Instructions here: http://nodejs.org
The following node packages are required. Install using npm. For example:
Also, install following packages for the ar-drone and video streaming:
For this experiment, we will be running everything on the same computer.
1. Connect your computer to the AR drone Wifi network. For example mine is: ardrone2_260592 – Note: after you do that, you will not be able to read this post on the internet.
2. Run both of the node programs in from terminal windows:
Since you are running Max control dashboard on the same computer as the server – you can call it without args, like this:
node drone5.js
Then from another terminal window start the video server:
node tz-dronestream-server/app-tz.js
3. In a Chrome web browser, type the following URL: (you can make multiple simultaneous connections to the video server) You should see the video from the AR-drone at in the browser.
127.0.0.1:5555
4. Load the following Max patch (control dashboard)
drone4.maxpat
5. In the Max patch, try clicking the /takeoff and /land messages in the Max patch.
To control the drone from Max, use [udpsend] [udpreceive] with ports 4000 and 4001 respectively. You can’t make multiple connections with OSC – also it would probably not be so cool while flying. but you can specify a target ip for telemetry when running the OSC server.
We will eventually publish a complete list of commands, but they are using the API from the ar-drone docs readme file – converted into OSC style. For example:
More notes on video…
You can capture the video stream into Max, by either capturing the chrome window using jitter, or by using syphon – but for demo purposes I have just run Chrome window side by side with Max control patch.
See this post for setting up Syphon in Max: https://reactivemusic.net/?p=8662
You may find it more practical to run the node.js server on a separate computer. If you do that you will need to
When testing this I set up a dual IP address on my Macbook with a static ip: 192.168.1.140 – so this would always be the server. I ended up getting rid of it because it caused problems with other software.
Here is a link to how to set up a dual IP address: https://reactivemusic.net/?p=6628
Here is the command you would use to specify a separate IP address when launching the server:
For example if your Max control program is on 192.168.1.104 and you want to run in outdoor mode – use this command:
node drone5.js 192.168.1.104 TRUE
These students are just about to send the quadcopter into the air using control panels developed in Max. Ali’s control panel uses speech via the Google API. Her computer is connected to the Internet via wiFi and also connected to Chase’s computer via a Midi/USB link. Her voice commands get translated into Midi. Chase’s control panel reads the commands. Chase’s computer is on the same WiFi network as the quadcopter. Chase’s control panel sends commands to my computer which is running Max and the at-drone software in node.js. Occasionally this all works. But there is nobody to hold a camera.
We’re now running two node servers, one for Max and one for web video streaming – which can be accessed by other computers connected to the same LAN as the AR-drone.
We did have a mishap where Chase’s control panel sent an “/up” command to the quadcopter. Then his Macbook batter died as the quadcopter was rising into the sky. I managed to rewrite the server program, giving it a /land command – then restarted it. It was able to re-establish communication with the quadcopter and make it land.
Unfortunately we did not get video of this experiment but here are a few seconds of video showing the quadcopter taking off and landing under control of Max – while indoors.
With Sadam externals.
By Ádám Siska
Streaming & Networking
Name | Description |
---|---|
[sadam.stream] |
Read and write binary streams. |
[sadam.tcpClient] |
Bidirectional TCP client. |
[sadam.tcpReceiver] |
Receive data from the network using the TCP protocol. |
[sadam.tcpSender] |
Send data through the network using the TCP protocol. |
[sadam.udpReceiver] |
Receive data from the network using the UDP protocol. |
[sadam.udpSender] |
Send data through the network using the UDP protocol. |
Look at 2nd comment
I was using this method to have a fixed IP address for operating the AR drone from node.js, while still being able to connect using DHCP.
At macinstruct.com
http://www.macinstruct.com/node/550
How to send ftrim in node ar-drone – to level out after a crash
No, you send at*ctrl with params 5,0, which resets the flag controlCommandAck in the navdata to 0.
Then when you send the next at*config, this flag switches back to 1. You then send another at*ctrl 5,0 to reset.
Described here: https://projects.ardrone.org/boards/1/topics/show/2364
How did I miss this?
By Jay Silver
http://www.ted.com/talks/jay_silver_hack_a_banana_make_a_keyboard.html
Makey Makey: http://www.makeymakey.com/
With Node.js
By Hacking Drones
update 6/2014. This project is now part of the Internet sensors projects: https://reactivemusic.net/?p=5859
original post
Have now got Max controlling AR-drone and receiving telemetry for altitude, battery, throttle, etc.,
To access video, run chrome browser set to localhost:3000
Finally got this working – the big issue was WebGL – I was running in safari. It needs to run in chrome. So I got the express version of the dronestream example working.
ended up needing a bunch of npm installs, but not sure which ones now cuz I wasted so much time dealing with webgl
A tutorial for exporting gen~ code into an AU plugin.
http://designingsound.org/2013/04/a-tremolo-au-plugin-with-max/