Ch13 current state

This commit is contained in:
Danny Staple
2022-12-17 20:27:39 +00:00
parent 45ba981386
commit d896e2a80a
3 changed files with 137 additions and 25 deletions
@@ -15,6 +15,7 @@ class RobotDisplay:
self.display_closed = False
self.fig, self.ax = plt.subplots()
self.poses = np.zeros([200, 3], dtype=np.int16)
self.motion = np.zeros([200, 3], dtype=float)
def handle_close(self, _):
self.display_closed = True
@@ -39,6 +40,9 @@ class RobotDisplay:
print("Incoming poses shape", incoming_poses.shape)
print("Existing poses shape", self.poses.shape)
self.poses[message["offset"]: message["offset"] + incoming_poses.shape[0]] = incoming_poses
if "motion" in message:
np.roll(self.motion, 1, axis=0)
self.motion[0] = [message["motion"]["rot1"], message["motion"]["trans"], message["motion"]["rot2"]]
def draw(self):
self.ax.clear()