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

Unofficial Standalone Golang Tello Package Released

SMerrony

Well-known member
Joined
May 1, 2018
Messages
65
Reaction score
60
Location
France
Hi Everyone,

I just released a standalone Go (Golang) package for the Tello at GitHub.com/SMerrony/tello

It couldn't have been built without information gleaned from this forum - so thanks guys!

There's also an enhanced version of my tello-desktop telloterm application which uses the package - it's linked to in the README.

Hope someone else has some fun with this :)

Steve
 
Last edited:

Rotor

New member
Joined
May 30, 2018
Messages
1
Reaction score
1
Hi Steve,

I immediately tried your Golang library. At the time the video feed to Opencv is running like a glove (y)(y)
Many thanks for your dedicated work on this!

My next goal is to implement some kind of motion tracking for autonomous flights.

So far i have not found any missing functions.

Best Regards,
Robin
 
  • Like
Reactions: SMerrony

vtvt

Member
Joined
Jun 11, 2018
Messages
23
Reaction score
46
Is there any chance to see this package in Python?
 

SMerrony

Well-known member
Joined
May 1, 2018
Messages
65
Reaction score
60
Location
France
Second public release - more functions

I just released v0.2.0

This release adds some new functions to the API: GetMaxHeight(), GetSSID(), GetVersion(), GetVideoBitrate(), GetLowBatteryThreshold() and SetLowBatteryThreshold(), SetVideoNormal() and SetVideoWide().

Documentation has been updated and a new ImplementationChart.md gives an overview of the Tello commands we currently understand and how this package handles them. It is intended to complement, not replace, the godoc documentation of the package.

A field in FlightData - BatteryLower has had its name changed to the more accurate BatteryCritical. Some new fields have also been added to this struct to support the new functions above.
 

FlandersNed

Active member
Joined
May 30, 2018
Messages
27
Reaction score
4
Hello,

When I try to compile the tello desktop using this package, I get this very long series of error messages:

Code:
 github.com/veandco/go-sdl2/sdl
In file included from _cgo_export.c:3:0:
../../../../veandco/go-sdl2/sdl/events.go:38:9: note: #pragma message: SDL_DROPTEXT is not supported before SDL 2.0.5
#pragma message("SDL_DROPTEXT is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/events.go:41:9: note: #pragma message: SDL_DROPBEGIN is not supported before SDL 2.0.5
#pragma message("SDL_DROPBEGIN is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/events.go:44:9: note: #pragma message: SDL_DROPCOMPLETE is not supported before SDL 2.0.5
#pragma message("SDL_DROPCOMPLETE is not supported before SDL 2.0.5")
         ^
# github.com/veandco/go-sdl2/sdl
../../../../veandco/go-sdl2/sdl/audio.go:22:9: note: #pragma message: SDL_DequeueAudio is not supported before SDL 2.0.5
#pragma message("SDL_DequeueAudio is not supported before SDL 2.0.5")
         ^
# github.com/veandco/go-sdl2/sdl
../../../../veandco/go-sdl2/sdl/events.go:38:9: note: #pragma message: SDL_DROPTEXT is not supported before SDL 2.0.5
#pragma message("SDL_DROPTEXT is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/events.go:41:9: note: #pragma message: SDL_DROPBEGIN is not supported before SDL 2.0.5
#pragma message("SDL_DROPBEGIN is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/events.go:44:9: note: #pragma message: SDL_DROPCOMPLETE is not supported before SDL 2.0.5
#pragma message("SDL_DROPCOMPLETE is not supported before SDL 2.0.5")
         ^
...Many similar messages later...
         ^
../../../../veandco/go-sdl2/sdl/video.go:77:9: note: #pragma message: SDL_WINDOW_POPUP_MENU is not supported before SDL 2.0.5
#pragma message("SDL_WINDOW_POPUP_MENU is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/video.go:80:9: note: #pragma message: SDL_WINDOWEVENT_TAKE_FOCUS is not supported before SDL 2.0.5
#pragma message("SDL_WINDOWEVENT_TAKE_FOCUS is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/video.go:83:9: note: #pragma message: SDL_WINDOWEVENT_HIT_TEST is not supported before SDL 2.0.5
#pragma message("SDL_WINDOWEVENT_HIT_TEST is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/video.go:88:9: note: #pragma message: SDL_WINDOW_VULKAN is not supported before SDL 2.0.6
#pragma message("SDL_WINDOW_VULKAN is not supported before SDL 2.0.6")
         ^
../../../../veandco/go-sdl2/sdl/video.go:91:9: note: #pragma message: SDL_GL_CONTEXT_RESET_NOTIFICATION is not supported before SDL 2.0.6
#pragma message("SDL_GL_CONTEXT_RESET_NOTIFICATION is not supported before SDL 2.0.6")
         ^
../../../../veandco/go-sdl2/sdl/video.go:94:9: note: #pragma message: SDL_GL_CONTEXT_NO_ERROR is not supported before SDL 2.0.6
#pragma message("SDL_GL_CONTEXT_NO_ERROR is not supported before SDL 2.0.6")
         ^
# github.com/veandco/go-sdl2/sdl
In file included from events.c:1:0:
../../../../veandco/go-sdl2/sdl/events.go:38:9: note: #pragma message: SDL_DROPTEXT is not supported before SDL 2.0.5
#pragma message("SDL_DROPTEXT is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/events.go:41:9: note: #pragma message: SDL_DROPBEGIN is not supported before SDL 2.0.5
#pragma message("SDL_DROPBEGIN is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/events.go:44:9: note: #pragma message: SDL_DROPCOMPLETE is not supported before SDL 2.0.5
#pragma message("SDL_DROPCOMPLETE is not supported before SDL 2.0.5")
         ^
# github.com/veandco/go-sdl2/sdl
In file included from hints.c:1:0:
../../../../veandco/go-sdl2/sdl/events.go:38:9: note: #pragma message: SDL_DROPTEXT is not supported before SDL 2.0.5
#pragma message("SDL_DROPTEXT is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/events.go:41:9: note: #pragma message: SDL_DROPBEGIN is not supported before SDL 2.0.5
#pragma message("SDL_DROPBEGIN is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/events.go:44:9: note: #pragma message: SDL_DROPCOMPLETE is not supported before SDL 2.0.5
#pragma message("SDL_DROPCOMPLETE is not supported before SDL 2.0.5")
         ^
# github.com/veandco/go-sdl2/sdl
In file included from log.c:1:0:
../../../../veandco/go-sdl2/sdl/events.go:38:9: note: #pragma message: SDL_DROPTEXT is not supported before SDL 2.0.5
#pragma message("SDL_DROPTEXT is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/events.go:41:9: note: #pragma message: SDL_DROPBEGIN is not supported before SDL 2.0.5
#pragma message("SDL_DROPBEGIN is not supported before SDL 2.0.5")
         ^
../../../../veandco/go-sdl2/sdl/events.go:44:9: note: #pragma message: SDL_DROPCOMPLETE is not supported before SDL 2.0.5
#pragma message("SDL_DROPCOMPLETE is not supported before SDL 2.0.5")
         ^
# github.com/veandco/go-sdl2/ttf
In file included from ../../../github.com/veandco/go-sdl2/ttf/sdl_ttf.go:5:0:
./sdl_ttf_wrapper.h:5:22: fatal error: SDL_ttf.h: No such file or directory
compilation terminated.
How do I go about fixing this? I'm assuming I have to update SDL, but I'm not sure how to go about doing this...
I'm using Kubuntu 16.04.

EDIT: Compiling SDL from source did not fix this.

EDIT2: Updating to Kubuntu 18.04 fixed this. Go figure.
 
Last edited:

SMerrony

Well-known member
Joined
May 1, 2018
Messages
65
Reaction score
60
Location
France
Just released v0.8.0 which has some experimental autopilot funcs including AutoFlyToXY().
 

thaiacepilot

Member
Joined
Jul 3, 2018
Messages
7
Reaction score
0
Have problem
Code:
C:\Users\thaia\go\src\tello-master>go test autopilot_test.go
# command-line-arguments
.\autopilot_test.go:31:15: undefined: Tello
.\autopilot_test.go:61:15: undefined: Tello
.\autopilot_test.go:92:15: undefined: Tello
.\autopilot_test.go:129:15: undefined: Tello
.\autopilot_test.go:161:12: undefined: calcXYdeltas
.\autopilot_test.go:164:11: undefined: calcXYdeltas
.\autopilot_test.go:167:11: undefined: calcXYdeltas
.\autopilot_test.go:170:11: undefined: calcXYdeltas
.\autopilot_test.go:173:11: undefined: calcXYdeltas
.\autopilot_test.go:176:11: undefined: calcXYdeltas
.\autopilot_test.go:176:11: too many errors
FAIL    command-line-arguments [build failed]
and
Code:
C:\Users\thaia\go\src\tello-master>go build autopilot.go
# command-line-arguments
.\autopilot.go:48:14: undefined: Tello
how to run this?
 

SMerrony

Well-known member
Joined
May 1, 2018
Messages
65
Reaction score
60
Location
France
@thaiacepilot - You need to understand how Go packages work and what role they perform in applications. You will find good explanations on the golang.org website.
 

thaiacepilot

Member
Joined
Jul 3, 2018
Messages
7
Reaction score
0
@thaiacepilot - You need to understand how Go packages work and what role they perform in applications. You will find good explanations on the golang.org website.
Thank Now I know how to build it but in AutotoXY mode it have problem drone always error (fly in wrong direction eg. to (0,2) then (0,0) my drone didn't fly back but it always fly to right..)
 

SMerrony

Well-known member
Joined
May 1, 2018
Messages
65
Reaction score
60
Location
France
Thank Now I know how to build it but in AutotoXY mode it have problem drone always error (fly in wrong direction eg. to (0,2) then (0,0) my drone didn't fly back but it always fly to right..)
Glad you got it running. Please report issues to SMerrony/tello and include sample code if possible.
 

mynameiscfed

New member
Joined
Jul 11, 2018
Messages
1
Reaction score
1
Wanted to say that the telloterm app is awesome. I modified it to write the video to a named pipe and then fed it to a streaming server to broadcast it. So cool. Really nice library.
 
  • Like
Reactions: SMerrony

FlandersNed

Active member
Joined
May 30, 2018
Messages
27
Reaction score
4
After cannibalizing some code from VideoTest and TelloTerm (that being the saveVideo() function), I managed to get the drone to be able to save video as well as preview it while under autopilot. Unfortunately, it seems that there's only enough bitrate, or perhaps processing power, to do only one at a time - doing both at the same time leads to very broken images (which is still saved and displayed in almost real time.)

@SMerrony Do you happen to know of a way to save and record at the same time using mplayer, using the format you've used to create a StdInPipe and send it to mplayer?
 

SMerrony

Well-known member
Joined
May 1, 2018
Messages
65
Reaction score
60
Location
France
@FlandersNed I don't think the bitrate matters. In your app simply change the loop that sends the data to mplayer to write it out to disk at the same time. It is in raw H.264 format - so you may need to post-process it a little.
 

FlandersNed

Active member
Joined
May 30, 2018
Messages
27
Reaction score
4
@FlandersNed I don't think the bitrate matters. In your app simply change the loop that sends the data to mplayer to write it out to disk at the same time. It is in raw H.264 format - so you may need to post-process it a little.
A bit late, but just to inform others, I set mplayer to dump the .h264 stream as a .mp4. I then separately started another mplayer instance that played the video file in parallel.

It has inherit lag because of the gap between saving the video and viewing it, but it works.
 

New Threads

Members online

Forum statistics

Threads
3,341
Messages
25,961
Members
8,621
Latest member
bradcrusts