Hello Tello Pilot!
Join our DJI Tello community & remove this banner.
Sign up

Unofficial, very early desktop app for flights

I am trying this control program.

I saved the source file to a folder. There I run:

go run ./tello_control.go

I get an error:

.# command-line-arguments /tello_control.go:49:52: flightData.BatteryPercentage undefined (type *tello.FlightData has no field or method BatteryPercentage, but does have tello.batteryPercentage)

I tried a couple of string modifications to get around this but failed. Not much of a go programmer I'm afraid.

Any suggestions?

The tello driver files from the main gobot branch don't have exported fields for flight data, meaning things like battery percentage cannot be viewed from outside files. You will have to swap over to the dev branch by executing the following terminal commands:
Code:
cd $GOPATH/src/gobot.io/x/gobot
git checkout dev
git fetch

To change to ps3 instead of ps4, use "dualshock3" instead of "dualshock4" where the joystick driver is declared:
Code:
var stick = joystick.NewDriver(joyAdaptor, "dualshock3")

Instead of the strconv line for printing battery percentage, use this:
Code:
fmt.Println("battery:", flightData.BatteryPercentage)
 
Last edited:
  • Like
Reactions: jjs357
In order to improve controller compatibility I think it would be very nice to use the Game Controller DB that is available here:
gabomdq/SDL_GameControllerDB
To have some semblance of consistency across platforms and controllers.

I would say Gobot has a better joystick driver (which wraps SDL) with mappings for 3 popular controllers but we can definitely do better if we manage to base the gamepad controller code on that database.

I'm also somewhat disappointed about the Android application that Ryze has been developing. I can no longer take pictures or video - nothing happens after a short animation and no picture/video is saved. It also crashes on tablets just because they have a layout file for sw600dp devices that is missing a view with a specific ID.
 
I have pushed an SDL version of the application to the "sdl" branch. It uses the previously mentioned game controller mappings so a whole lot other controllers are now supported that have analog controls.

I also definitely want to include keyboard controls + other stats that was originally implemented by @cbwang2016 for ebiten when time permits but pull requests are also very much welcome.

The only downside I see is that the SDL dynamic library also needs to be included but this app already makes use of ffmpeg's libavcodec/libavformat/etc so it shouldn't be that much of a hassle.
 
  • Like
Reactions: cbwang2016
Hi,

I'd like to share with you the desktop application I have been working on:
socketbind/drone-control

The reason I have been doing it is that my old Nexus 5 has connection issues with the drone at the higher distances and altitudes and also as an excuse for practicing Go.

So far I got these things working in a very early, alpha quality:
  1. Displays drone camera in a window (uses libavcodec)
  2. Allows control with a Dualshock 4 gamepad (with hard coded button mappings for now)
  3. Dumps video frames as H.264 NALs under the recordings/ folder. You can convert these to actual video files using ffmpeg, but writing in a proper container format should not be so hard to implement.
It works quite decently using my laptop but I urge extreme caution for anybody who would like to try it as the button mappings for your gamepad could be horribly off and cause your drone to crash. It might also be a little problematic to compile the native parts on some platforms, esp. Windows. I suggest you to try Linux or Mac OS but I might be able to look into Windows compatibility sometime soon.

Pull requests are also very much welcome. The code in the repository is the result of a weekend hacking session so the quality might not live up to the highest of standards. I intended to expand upon when time allows and would love to see some proper status indicators (battery, wifi, speed, altitude).


I do not know if this would be much easier?
The code is open source and these are programmed with Scratch
 
  • Like
Reactions: gl3nborj
I do not know if this would be much easier?
The code is open source and these are programmed with Scratch

There is a kid on the video shows you how and then flies it with his laptop. I guess there is a lot of commands pre built in and everything is all ready compiled for lynx. Windows I dont know.
 

New Posts

Members online

Forum statistics

Threads
5,700
Messages
39,967
Members
17,060
Latest member
Clubfooted

New Posts