Git Product home page Git Product logo

wifi_china_drone_controller's Introduction

README

This is a sample application to control Cheerson CX10-WD drone from desktop using keyboard or a XInput Device (i.e. XBoxController)

Download from Here the Latest version

Stream/Record Video

In order to stream or record video you need to download FFPLAY and FFMPEG for your platform and put the two binaries (ffmpeg and ffplay) contained in the archive in the same folder of the drone_protocol.jar. i.e.

C:\users\sample\Desktop\cx10\ will contain

  • drone_protocol.jar
  • ffmpeg.exe
  • ffplay.exe

or on MacOSX/Linux /users/sample/Desktop/cx10/ will contain

  • drone_protocol.jar
  • ffmpeg
  • ffplay

Keyboard Controls

  • Up arrow = Take Off
  • Down arrow = Land
  • W, A, S, D = Left stick
  • I, J, K, L = Right stick

wifi_china_drone_controller's People

Contributors

kno avatar orfeo-sainsburys avatar otacon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wifi_china_drone_controller's Issues

CX-10W?

Hi, would this also work on the CX-10W?

Cheers

Cannot connect to the drone

Hi,

Using host IP: "172.16.10.1", I get: No route to host.
Using host IP: "192.168.99.100", which can be pinged, I get: Connection refused.

The OS is Ubuntu 16.04 LTS. The drone model is CX-10WD-TX. Any ideas?

can't video on linux

cx-10wd. works great (with the lag) on windows.
can't get any video on linux however; it looks beliow like something is trying to be called using cmd which doesn't exist.

I can see that ffmpeg is connecting to a local port but that port isn't open - so i'm guessing it's your proxying layer that's not starting.

greatest of thanks.

java -jar drone_protocol.jar
Transport Connection >>>
49 54 64 00 00 00 52 00 00 00 05 A7 A9 0F B3 6E CD 3F A2 CA 7E C4 8C A3 60 04 AC EF 63 F7 71 57 AB 2F 53 E3 F7 68 EC D9 E1 85 47 B8 C2 2E 21 D0 1B FB 6B 3D E3 25 A2 7B 8F B3 AC EF 63 F7 71 57 AB 2F 53 E3 F7 68 EC D9 E1 85 B7 33 0F B7 C9 57 82 FC 3D 67 E7 C3 A6 67 28 DA D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A
Transport Connection <<<
49 54 64 00 00 00 53 00 00 00 98 42 97 E1 A1 78 EC 10 3E 8F 4A A6 25 F9 3B E8 D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A A0 F4 5F 10 76 59 37 55 19 11 5F 81 74 5E 50 89 40 9E 3F 1E F9 13 C1 A3 C2 F3 24 AD C6 24 D7 6A
Transport Connection >>>
49 54 64 00 00 00 52 00 00 00 21 E0 C4 77 C7 73 94 E8 5D 66 A9 8C 2C 92 2C C5 AC EF 63 F7 71 57 AB 2F 53 E3 F7 68 EC D9 E1 85 47 B8 C2 2E 21 D0 1B FB 6B 3D E3 25 A2 7B 8F B3 AC EF 63 F7 71 57 AB 2F 53 E3 F7 68 EC D9 E1 85 B7 33 0F B7 C9 57 82 FC 3D 67 E7 C3 A6 67 28 DA D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A
Transport Connection <<<
49 54 64 00 00 00 56 00 00 00 CC 11 0A 4A A3 47 ED 1A 89 11 D4 FB 96 4A DF 59 D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A 3B 30 70 85 EF 35 F4 3E AF 44 CF 6F C7 9C 5D 1E 29 59 27 7E 7A 28 1D 07 57 F9 EC 0D AF FA 0F C1
Transport Connection >>>
49 54 64 00 00 00 56 00 00 00 54 69 6D 47 A5 41 85 86 00 72 9E 0A 5B A1 90 37 AC EF 63 F7 71 57 AB 2F 53 E3 F7 68 EC D9 E1 85 47 B8 C2 2E 21 D0 1B FB 6B 3D E3 25 A2 7B 8F B3 AC EF 63 F7 71 57 AB 2F 53 E3 F7 68 EC D9 E1 85 3B 30 70 85 EF 35 F4 3E AF 44 CF 6F C7 9C 5D 1E 38 27 5B 07 F2 D7 3F C0 A7 38 DC 49 D6 0F FE 9F
Transport Connection <<<
49 54 A4 00 00 00 96 00 00 00 48 F9 BE CC 97 EC EB 03 68 EB 3E 3C B4 A9 29 22 D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A B4 7F 3C 29 2D 03 0F B8 FF 07 3F CA 17 78 65 FE 02 D5 6D 57 87 31 CE 19 71 92 93 91 CE A8 8D 8B FE 87 7A 08 61 EF AE 88 6E A7 69 B7 49 F4 3C 96 D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A C4 8C 59 90 C4 99 57 ED 3B 96 82 A5 BD 66 CE 1D AE 07 2F FA 66 67 31 D1 52 22 12 F0 F2 91 10 72
Transport Connection >>>
49 54 64 00 00 00 60 00 00 00 D6 5D 9D 9E E2 D6 0C 64 B5 9F FA 66 3E 44 7C 03 AC EF 63 F7 71 57 AB 2F 53 E3 F7 68 EC D9 E1 85 47 B8 C2 2E 21 D0 1B FB 6B 3D E3 25 A2 7B 8F B3 AC EF 63 F7 71 57 AB 2F 53 E3 F7 68 EC D9 E1 85 28 F1 7C B5 DB 6D 66 3C A2 5B E8 AB A9 70 BE 24 3D 03 6C 26 98 EF D8 B7 BB D1 E7 99 33 47 F7 0F
Transport Connection <<<
49 54 64 00 00 00 51 00 00 00 00 9A 69 22 7D BA BC D6 D3 1B 1F 51 E4 D6 62 4C D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A 70 F7 46 91 4F 45 24 A0 79 59 D3 BB F9 76 F9 1A
Transport Connection >>>
49 54 64 00 00 00 5D 00 00 00 B5 4F 38 C7 5C E4 9A CA A9 0A 73 7D 7D 84 DB DC AC EF 63 F7 71 57 AB 2F 53 E3 F7 68 EC D9 E1 85 47 B8 C2 2E 21 D0 1B FB 6B 3D E3 25 A2 7B 8F B3 AC EF 63 F7 71 57 AB 2F 53 E3 F7 68 EC D9 E1 85 EE 2E 09 A3 9B DD 05 C8 30 A2 81 C8 2A 9E DA 7F 74 EA FE 12 4E 23 9D 74 76 16 10 6C 5A 9C D8 B7
Transport Connection <<<
49 54 64 00 00 00 54 00 00 00 70 9F 2C 3A 79 CF 81 58 68 20 32 49 5E B4 F9 E7 D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A D8 B5 98 48 C7 67 0C 94 B2 9B 54 D2 37 9E 2E 7A A6 79 C2 77 56 55 0D EC C3 29 93 6B 95 2C 1F 75 EA E7 C4 12 99 C7 69 D5 C0 CE F6 52 EF 7C A1 23
Sending heartbeat...
The drone is alive.
java.io.IOException: Cannot run program "cmd": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at org.cyanotic.cx10.io.video.FFPlayProcessVideoPlayer.start(FFPlayProcessVideoPlayer.java:20)
at org.cyanotic.cx10.CX10.startVideoStream(CX10.java:90)
at org.cyanotic.cx10.ui.MainWindow.onStartVideoStreamClicked(MainWindow.java:166)
at org.cyanotic.cx10.ui.MainWindow.access$500(MainWindow.java:16)
at org.cyanotic.cx10.ui.MainWindow$1.run(MainWindow.java:63)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 6 more
java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.(Socket.java:434)
at java.net.Socket.(Socket.java:244)
at org.cyanotic.cx10.CX10.startVideoStream(CX10.java:97)
at org.cyanotic.cx10.ui.MainWindow.onStartVideoStreamClicked(MainWindow.java:166)
at org.cyanotic.cx10.ui.MainWindow.access$500(MainWindow.java:16)
at org.cyanotic.cx10.ui.MainWindow$1.run(MainWindow.java:63)
at java.lang.Thread.run(Thread.java:745)
Sending heartbeat...
The drone is alive.

What's introducing exactly 1 second of latency?

On both my hosts (windows and OSX) I get pretty nearly 1s of lag in the video stream. The control is perfect even over huge distances but no matter how close I'm getting what seems to be a buffer. I've always had problems with ffplay for real time streaming and so I'd guess that's where this is coming from.

What protocol are you converting the quad stream into locally for ffplay? Are you just piping raw bytes? My theory is that if I can use say VLC or literally any other software it will work properly.

Also, I'd like to commend you for a solid reverse engendering feat! It's very well built! I hope to be able to extend this so I can use OpenCV to achieve dynamic position hold using the camera.

Connection refused

I'm trying to use your code to connect to a CX-10DS (http://www.cheersonhobby.com/en-US/Home/ProductDetail/121 this little guy) over WiFi.
I connect to the WiFi AP of the drone with my PC and managed to find the IP address of the drone (192.168.4.1) but when I'm calling the connect method of the CX10 class I get a connection refused exception.

Have you encountered anything similar? Could you give me any pointers on how to make your code compatible with the CX-10DS?

EDIT: Turns out the CX-10DS is waaaaaay dumber. No need for TCP it only check for a UDP packet every second or so.. Anyways, I created a python script that can replicate the control signals from the android app. Feel free to check it out in my repo.

License

I'm hoping you can provide an open source license for this code. I want to start hacking with it (it's great, thanks for your efforts!), but don't want to do the wrong thing by you if doing that. If I can get things going, I will release my code also.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.