Graphical User Interface
The library is built-in with out-of-the box GUI to easen the use of the proposed computer vision control, and gives the user real-time, full access over their drone. The GUI is built with Tkinter, for its ease-of-use and fast response and render. Moreover, it is a cross-platform library allowing smoother integrations with platforms other than Ubuntu.
Getting Started
To get started, just run the following command on your terminal:
$ dronevis-gui
This will open the following window, where you can right-click on any button to view its functionality.
Structure
The GUI is shipped as a class DroneVisGui.
- class dronevis.ui.drone_gui.DroneVisGui(drone=None)
Implementation for the library GUI using Tkinter
- __init__(drone=None)
Contruct a GUI window
- Parameters:
drone (Union[Drone, DemoDrone, None], optional) – drone instance for connection. If the you don’t provide an instance a demo will be run. Defaults to None.
Handle incomming navdata and convert them to suitable format
- on_plot()
Handles heights points and graph them
- init_frames()
Initialize main frames for the GUI
- on_crowd()
Start crowd control
- off_crowd()
Stop crowd control
- on_gesture()
Open gesture control
- off_gesture()
Close gesture control
- on_drone_connect(_)
Event handler for drone connection
Callback handler to retrieve navdata from drone instance
- Parameters:
navdata (dict) – navigation data dictionary
- on_stream()
Event handler for pressing on stream button
- on_change_stream_model()
Handler for changing the inference model
- update_frame(output_image, frame)
Update camera feed output_image
- Parameters:
output_image (np.ndarray) – output_image data
frame (np.ndarray) – frame data
- on_close_window()
Event handler for closing the GUI window
It stop the drone connection and destroyes and GUI window
Some parts are shipped as their own custom modules such as buttons and progress bars, which are then integrated later to build the GUI.
Run GUI from Code
If you are not a terminal fan, you can your python script to the GUI:
from dronevis.ui.drone_gui import DroneVisGui
gui = DroneVisGui() # create GUI instance
gui.window.mainloop() # start GUI main loop