How to use the TK Inter package for Ros Tools
Brendon Lu
Make sure you have the following packages imported: ==tkinter==, ==rospy==. The tkinter module is a basic and simple, yet effective way of implementing a usable GUI.
Immediately after importing the necessary packages, initialize a rospy node and publishers/subscribers, which can be used to communicate and pass userinput data to other nodes through respective topics.
To create a basic gui, first run [root name] = tk.Tk()
in order to create a root window. In order to add elements to your gui/window, create a canvas and grid using
Some other basic functions to get you started include: tk.Label([root name] ... )
for showing text or variables, and tk.PhotoImage(file = [img PATH])
. Note that to add an image, first you need to pass it into tk using PhotoImage, then run Label in order to show it. Overall, tkinter is an industry staple for creating simple GUIs in Python, being fast, easy to implement, versatile, and flexible, all with an intuitive syntax. For more information, check out the links below.