def plot_motion(motion_mat):
time = motion_mat[:,0]
plt.figure(figsize=(15,5))
plt.subplot(1,2,1)
plt.plot(time,motion_mat[:,1]* 1000,label='x')
plt.plot(time,motion_mat[:,2]* 1000,label='y')
plt.plot(time,motion_mat[:,3]* 1000,label='z')
plt.xlabel('Time / s')
plt.ylabel('Translation / mm')
plt.legend()
plt.subplot(1,2,2)
plt.plot(time,np.degrees(motion_mat[:,4]),label='x')
plt.plot(time,np.degrees(motion_mat[:,5]),label='y')
plt.plot(time,np.degrees(motion_mat[:,6]),label='z')
plt.ylabel('Rotations / degrees')
plt.xlabel('Time / s')
plt.legend()
plt.show()
评论列表
文章目录