|
| 1 | +import matplotlib.pyplot as plt |
| 2 | +import numpy as np |
| 3 | + |
| 4 | +def plot_td_dot_and_t_dot(np_stored_td_dot: np.array, np_stored_t_dot: np.array, np_stored_time: np.array): |
| 5 | + """ |
| 6 | + plot_td_dot_and_t_dot Example function to plot the task-space velocity |
| 7 | + and desired task-space velocity for the open-loop velocity controller |
| 8 | + """ |
| 9 | + |
| 10 | + # x-axis |
| 11 | + ax1 = plt.subplot(1,3,1) |
| 12 | + plt.plot(np_stored_time,np_stored_td_dot[:,0]) |
| 13 | + plt.plot(np_stored_time,np_stored_t_dot[:,0]) |
| 14 | + plt.title('x-axis velocity') |
| 15 | + plt.ylabel('Velocity [m/s]') |
| 16 | + plt.ylim([-5, 5]) |
| 17 | + plt.xlabel('Time [s]') |
| 18 | + ax1.legend(['desired','actual','Location','southeast']) |
| 19 | + |
| 20 | + # y-axis |
| 21 | + ax2 = plt.subplot(1,3,2) |
| 22 | + plt.plot(np_stored_time,np_stored_td_dot[:,1]) |
| 23 | + plt.plot(np_stored_time,np_stored_t_dot[:,1]) |
| 24 | + plt.title('y-axis velocity') |
| 25 | + plt.ylabel('Velocity [m/s]') |
| 26 | + plt.ylim([-5, 5]) |
| 27 | + plt.xlabel('Time [s]') |
| 28 | + ax2.legend(['desired','actual','Location','southeast']) |
| 29 | + |
| 30 | + # z-axis |
| 31 | + ax3 = plt.subplot(1,3,3) |
| 32 | + plt.plot(np_stored_time,np_stored_td_dot[:,2]) |
| 33 | + plt.plot(np_stored_time,np_stored_t_dot[:,2]) |
| 34 | + plt.title('z-axis velocity') |
| 35 | + plt.ylabel('Velocity [m/s]') |
| 36 | + plt.ylim([-5, 5]) |
| 37 | + plt.xlabel('Time [s]') |
| 38 | + ax3.legend(['desired','actual','Location','southeast']) |
| 39 | + |
| 40 | + |
0 commit comments