Refinements - ensure gca/gcf are gone.
This commit is contained in:
@@ -12,6 +12,7 @@ class RobotDisplay:
|
||||
self.line = ""
|
||||
self.arena = {}
|
||||
self.display_closed = False
|
||||
self.fig, self.ax = plt.subplots()
|
||||
self.pose_coords = []
|
||||
self.pose_uv = []
|
||||
|
||||
@@ -55,12 +56,11 @@ class RobotDisplay:
|
||||
async def main(self):
|
||||
plt.ion()
|
||||
await self.ble_connection.connect()
|
||||
self.fig, self.ax = plt.subplots()
|
||||
try:
|
||||
request = json.dumps({"command": "arena"}).encode()
|
||||
print(f"Sending request for arena: {request}")
|
||||
await self.ble_connection.send_uart_data(request)
|
||||
plt.gcf().canvas.mpl_connect("close_event", self.handle_close)
|
||||
self.fig.canvas.mpl_connect("close_event", self.handle_close)
|
||||
|
||||
while not self.display_closed:
|
||||
self.draw()
|
||||
|
||||
Reference in New Issue
Block a user