finish notebook

This commit is contained in:
Atsushi Sakai
2018-11-19 21:18:11 +09:00
parent 4e7fbc3388
commit ac90c1467c
3 changed files with 117 additions and 27 deletions

View File

@@ -10,6 +10,11 @@ import math
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append("../../")
from matplotrecorder import matplotrecorder
show_animation = True
@@ -202,6 +207,7 @@ def main():
plt.axis("equal")
plt.grid(True)
plt.pause(0.0001)
matplotrecorder.save_frame()
# check goal
if math.sqrt((x[0] - goal[0])**2 + (x[1] - goal[1])**2) <= config.robot_radius:
@@ -213,6 +219,10 @@ def main():
plt.plot(traj[:, 0], traj[:, 1], "-r")
plt.pause(0.0001)
for i in range(10):
matplotrecorder.save_frame()
matplotrecorder.save_movie("animation.gif", 0.1)
plt.show()