mirror of
https://github.com/AtsushiSakai/PythonRobotics.git
synced 2026-04-22 03:00:22 -04:00
finish notebook
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user