demo_pendulum.py 文件源码

python
阅读 82 收藏 0 点赞 0 评论 0

项目:lqRRT 作者: jnez71 项目源码 文件源码
def update(arg, ii=[0]):

    i = ii[0]  # don't ask...

    if np.isclose(t_arr[i], np.around(t_arr[i], 1)):
        fig3.suptitle('Evolution (Time: {})'.format(t_arr[i]), fontsize=24)

    link1[0].set_data([0, elb_history[i, 0]], [0, elb_history[i, 1]])
    link2[0].set_data([elb_history[i, 0], x_history[i, 0]], [elb_history[i, 1], x_history[i, 1]])
    end.set_offsets((x_history[i, 0], x_history[i, 1]))
    elb.set_offsets((elb_history[i, 0], elb_history[i, 1]))

    ii[0] += int(1 / (dt * framerate))
    if ii[0] >= len(t_arr):
        print("Resetting animation!")
        ii[0] = 0

    return [link1, link2, end, elb]

# Run animation
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号