-
A map for the course where obstacles and golf balls detected will be plotted, as well as the trace of the robot.
-
Two interactive buttons (Clear and Stop), to clear the path of the robot and stop the GUI.
-
Two interactive text boxes where parameters can be set and send to the robot (Kp and Kd in the picture below). Additional parameters can be added.
-
A text box to display the locations of the golf balls detected.
The interface uses the socket library to communicate with the raspberry Pi on the robot through TCP protocal.
And matplotlib libray to visualize data.
The buttons and textbox are implemented using matplotlib.widgets. For detailed information on the matplotlib widgets, please visit https://matplotlib.org/stable/api/widgets_api.html.
The data recieved from the raspberry is a string formatted from 8 float numbers:
-
(Float) Robot x position (course coordinates)
-
(Float) Robot y position (course coordinates)
-
(Float) Robot heading angle theta in degrees (course coordinates)
-
(Float) Golf ball x position (course coordinates)
-
(Float) Golf ball y position (course coordinates)
-
(Int) Golf ball color (0 - Orange, 1 - Purple, and -1 if not detected)
-
(Float) Obstacle x position (Astar coordinates) (0 if not detected)
-
(Float) Obstacle y position (Astar coordinates) (0 if not detected)