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:
This is the line where I'm calculating the diff in time and storing it.
Any advice would be greatly appreciated!
Thanks!
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!