External Development: More Progress!
Uploading and Loding Picture ...(0/1)
o(^-^)o
BGA
lvl.4
United States
Offline

I guess a video is better than any frame capture, right?




2019-12-28
Use props
BGA
lvl.4
United States
Offline

This is what can be seen here:

- Running on Linux, which is not supported in any way by DJI right now.
- Full pairing process implemented, from QR Code generation to pairing handshake.
- Video streaming from the S1 (currently 1280x720@30Hz)!

Note that Linux support required some trickery as I am using the unitybridge.dll form the Robomaster app as a shortcut. Th good thing is that, it works! And most of the code is native to Linux.
2019-12-28
Use props
DJI Gamora
Administrator

Offline

Hi, thanks for sharing this video that you had provided. Thank you for your continued support!
2019-12-28
Use props
rhoude57 - YUL
lvl.4
Canada
Offline

BGA Posted at 12-28 09:27
This is what can be seen here:

- Running on Linux, which is not supported in any way by DJI right now.

Nice!

Next... to connect a gamepad controller to the Linux app and map gamepad channels to basic RoboMaster S1 chassis and turret actions.
2019-12-28
Use props
BGA
lvl.4
United States
Offline

rhoude57 - YUL Posted at 12-28 21:17
Nice!

Next... to connect a gamepad controller to the Linux app and map gamepad channels to basic RoboMaster S1 chassis and turret actions.

Actually, before that I need to understand how to control the Gimbal and Chassis. After that connecting to any Gamepad will be trivial as long as it is supported in the OS being used.
2019-12-29
Use props
wqiu
lvl.2

China
Offline

Nice Job. I try to run your code today. something wrong happened. seems about wine env issue.
I install the wine on ubuntu machine, but seems the code can not find wine or  winewrapper.exe. How to setup the running environment.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x4eb28d]

goroutine 1 [running]:
git.bug-br.org.br/bga/robomasters1/app/internal/dji/unity/bridge/internal/wrapper/winebridge.(*WineBridge).Start(0x0, 0xf, 0xc0000123b0)
        /root/robomasters1/app/internal/dji/unity/bridge/internal/wrapper/winebridge/winebridge_linux.go:43 +0x4d
git.bug-br.org.br/bga/robomasters1/app/internal/dji/unity/bridge/internal/wrapper.Instance.func1()
        /root/robomasters1/app/internal/dji/unity/bridge/internal/wrapper/wrapper_linux_amd64.go:36 +0x109
sync.(*Once).doSlow(0x762e40, 0x5f1130)
        /snap/go/4901/src/sync/once.go:66 +0xe3
sync.(*Once).Do(...)
        /snap/go/4901/src/sync/once.go:57
git.bug-br.org.br/bga/robomasters1/app/internal/dji/unity/bridge/internal/wrapper.Instance(0x5c4080, 0xc00000e080)
        /root/robomasters1/app/internal/dji/unity/bridge/internal/wrapper/wrapper_linux_amd64.go:22 +0x65
git.bug-br.org.br/bga/robomasters1/app/internal/dji/unity/bridge.init.0()
        /root/robomasters1/app/internal/dji/unity/bridge/unitybridge.go:37 +0x62
exit status 2

Again, thank you for your great job.
2019-12-29
Use props
BGA
lvl.4
United States
Offline

wqiu Posted at 12-29 16:52
Nice Job. I try to run your code today. something wrong happened. seems about wine env issue.
I install the wine on ubuntu machine, but seems the code can not find wine or  winewrapper.exe. How to setup the running environment.

I am not sure how you got that segmentation fault but I can only assume you did something wrong (specially considering that I did not provide any instructions on getting everything to work and, unfortunately. it is non trivial.

1 - Install the Go compiler tools. Any recent Go version should do but it is always recommended to install the latest version: https://golang.org/dl/
2 - Install the MINGW cross-compiler. In Ubuntu it should be "sudo apt install mingw-w64".
3 - install Wine. In Ubuntu it should be "sudo apt install wine".
4 - Run wine once just to create its settings directory and see if it is working.
5 - Open a terminal and change to the robomasters1/app/example directory.
6 - Copy unitybridge.dll to this directory. It is available at robomasters1/app.internal/dji/unity/bridge/internal/wrapper/unitybridge.dll.
7 - Compile winewrapper:

CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -o winewrapper.exe ../internal/dji/unity/bridge/internal/wrapper/winewrapper/winewrapper_windows_amd64.go

This should generate a winewrapper.exe executable in the current directory.

8 - Compile ad run the sample app:

go run main.go -ssid=YourWifiNetworkName -password=YourWifiNetworkPassword

This should open a QRCode image that you can scan with your S1 as if you were using the Robomaster app.

After this the Robomaster should connect and start streaming video. The code in the repository will simply save the first frame it gets as image.png in the current directory. The version with fulll streaming currently requires GoCV which is a pain to install so I did not make it available yet. I will clean up the video API and add a separate app that uses GoCV for streaming.
2019-12-30
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules