Skip to content
Snippets Groups Projects
Commit a67815a2 authored by Zsedrovits Tamás's avatar Zsedrovits Tamás
Browse files

Initial battery info from init to run

parent 0b9aea8d
No related branches found
No related tags found
No related merge requests found
...@@ -156,12 +156,6 @@ class FrontEnd(): ...@@ -156,12 +156,6 @@ class FrontEnd():
self.command_thread = self.CommandThread(self.command_queue,self.tello,self.update,self.battery_queue) self.command_thread = self.CommandThread(self.command_queue,self.tello,self.update,self.battery_queue)
self.command_thread.start() self.command_thread.start()
battery_info = self.tello.get_battery()
try:
text = "Battery: {}%".format(battery_info.rstrip())
except Exception:
text = "Battery: {}%".format(battery_info)
self.battery_queue.put(text)
def on_barcode_result(self,data): def on_barcode_result(self,data):
...@@ -323,6 +317,16 @@ class FrontEnd(): ...@@ -323,6 +317,16 @@ class FrontEnd():
self.tello.send_control_command("mon") self.tello.send_control_command("mon")
try:
battery_info = self.tello.get_battery()
try:
text = "Battery: {}%".format(battery_info.rstrip())
except Exception:
text = "Battery: {}%".format(battery_info)
self.battery_queue.put(text)
except Exception:
pass
frame_read = self.tello.get_frame_read() frame_read = self.tello.get_frame_read()
should_stop = False should_stop = False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment