def ani_update(arg, ii=[0]):
i = ii[0] # don't ask...
if np.isclose(t_arr[i], np.around(t_arr[i], 1)):
fig2.suptitle('Evolution (Time: {})'.format(t_arr[i]), fontsize=24)
graphic_robot_1.center = ((x_history[i, 0]+td*np.cos(x_history[i, 2]), x_history[i, 1]+td*np.sin(x_history[i, 2])))
graphic_robot_2.center = ((x_history[i, 0], x_history[i, 1]))
graphic_robot_3.center = ((x_history[i, 0]-td*np.cos(x_history[i, 2]), x_history[i, 1]-td*np.sin(x_history[i, 2])))
ii[0] += int(1 / (dt * framerate))
if ii[0] >= len(t_arr):
print("Resetting animation!")
ii[0] = 0
return None
# Run animation
评论列表
文章目录