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

How to record user flight action and then replay?

xtr33me

Member
Joined
Jul 16, 2019
Messages
10
Reaction score
3
As stated in the title, I am wishing to fly a path, and then have the tello fly the same path I flew. I have a python script where I am able to fly the Tello and while flying I record the keys pressed on the keyboard and the store the difference in time between the key down and key up in a json object. Once I land, I write this json object out.

I am now at the point where I am wanting to replay the log. So I load the json into a dictionary and was just going to pop off each element and continue to push the event onto the pygame event queue until the specified amount of time has passed. I would then continue to do the same for each event in the queue until completion.

For those of you with more experience, is this the "recommended" way of doing this? Is there a better way? A sample of my last recorded flight session in JSON is this:
{"tab": 142, "w": 395, "d": 738, "a": 1568, "s": 1608, "backspace": 81}

This is the line where I'm calculating the diff in time and storing it.
event_list.update({keyname : int((datetime.datetime.now() - start_time).total_seconds() * 1000)})
Any advice would be greatly appreciated!

Thanks!
 
I have not yet done any experiments with the Tello and python. But I think, that you will more have a problem with timing. I think, from what I have seen in dfifferent videos, the Tello need some time to think between the commands. So I would at least at 1 second to each recorded time just to be safe.

Oh and you should put in a emergency off key to cut power - if you have not done yet.

But for more testing, do you want to share the whole code? Maybe put it into a GIST or on Github.
 
  • Like
Reactions: xtr33me
Time based recording and replay of commands is doomed to fail.
Record the positions instead and send tello along these coordinates
 
  • Like
Reactions: xtr33me
Time based recording and replay of commands is doomed to fail.
Record the positions instead and send tello along these coordinates
Thanks again volate!lo! I picked up your app last week to see what is possible. However I must admit I was confused as to how you were doing some of the actions so well. Clearly I have still much to learn in this space, and for sure I did not expect that there was a way to track distance, being that I have nothing relative to go off of (GPS, etc.). So I am off to scour the docs and forum for this new found knowledge, but just wanted to say thanks again for the assist! As both you and cbyte stated, the flooding of recorded messages to the drone has been a bit horrendous even with a delay. Unfortunately I need to fly a path that is recorded, without the use of markers. So this info regarding somehow tracking distance is big and I am quite intrigued :) Thanks mate!
 
Tello constantly reports its position based on the vps so it's easy to send tello along a course but accuracy may not be sufficient for an indoor course

Look for a thread 'tello what's possible' where krag and a few others explored the data streams from tello a year or so ago.
Also check out krag's tellolib which has its problems but is a good starting point.
 
  • Like
Reactions: xtr33me

New Posts

Members online

No members online now.

Forum statistics

Threads
5,690
Messages
39,934
Members
17,023
Latest member
Repiv

New Posts