Skip to content

Instantly share code, notes, and snippets.

@felixge
Created April 17, 2013 14:56
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felixge/5404974 to your computer and use it in GitHub Desktop.
Save felixge/5404974 to your computer and use it in GitHub Desktop.
# setup fd 3 as udp connection to drone
exec 3<>/dev/udp/192.168.1.1/5556
# takeoff
echo -e "AT*REF=1,512\r" >&3
# landing
echo -e "AT*REF=2,0\r" >&3
...
# profit?
@jed
Copy link

jed commented Apr 17, 2013

it's a Shellicopter™!

@felixge
Copy link
Author

felixge commented Apr 17, 2013

@jed : D

@thefoxis
Copy link

that's the cutest. nerdiest. name. ever.

@missinglink
Copy link

roflcopter

@daraosn
Copy link

daraosn commented Apr 18, 2013

@felixge so cool!! :D

I continued a bit, haven't tested this on the drone D:

#!/bin/bash
seq=1
exec 3<>/dev/udp/192.168.1.1/5556
echo -e "AT*REF=$seq,512\r" >&3

while [ true ]
do
sleep 0.033;
seq=$((seq+1))
echo -e "AT*REF=$seq,512\r" >&3
seq=$((seq+1))
# TODO: map axes into float signed int32s
echo -e "AT*PCMD=$seq,0,0,0,0,0\r" >&3
# TODO: code script break
done;

seq=$((seq+1))
echo -e "AT*REF=$seq,0\r" >&3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment