Ch13 current state
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user