Using GCA and GCF causes weird stuff to happen when buttons are added.
This commit is contained in:
@@ -29,20 +29,21 @@ class RobotDisplay:
|
||||
self.arena = message
|
||||
|
||||
def draw(self):
|
||||
plt.gca().clear()
|
||||
self.ax.clear()
|
||||
if self.arena:
|
||||
for line in self.arena["arena"]:
|
||||
plt.gca().plot(
|
||||
self.ax.plot(
|
||||
[line[0][0], line[1][0]], [line[0][1], line[1][1]], color="black"
|
||||
)
|
||||
for line in self.arena["target_zone"]:
|
||||
plt.gca().plot(
|
||||
self.ax.plot(
|
||||
[line[0][0], line[1][0]], [line[0][1], line[1][1]], color="red"
|
||||
)
|
||||
|
||||
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}")
|
||||
|
||||
Reference in New Issue
Block a user