@@ -23,6 +23,7 @@ def press(event):
2323 print ('Quitting upon request.' )
2424 sys .exit (0 )
2525
26+
2627def main ():
2728 # Arm geometry in the working space
2829 link_length = [0.5 , 1.5 ]
@@ -53,9 +54,11 @@ def animate(grid, arm, route):
5354 arm .update_joints ([theta1 , theta2 ])
5455 plt .subplot (1 , 2 , 2 )
5556 arm .plot (plt , obstacles = obstacles )
57+ plt .xlim (- 2.0 , 2.0 )
58+ plt .ylim (- 3.0 , 3.0 )
5659 plt .show ()
5760 # Uncomment here to save the sequence of frames
58- #plt.savefig('frame{:04d}.png'.format(i))
61+ # plt.savefig('frame{:04d}.png'.format(i))
5962 plt .pause (0.1 )
6063
6164
@@ -264,13 +267,13 @@ def plot(self, myplt, obstacles=[]):
264267 for i in range (self .n_links + 1 ):
265268 if i is not self .n_links :
266269 myplt .plot ([self .points [i ][0 ], self .points [i + 1 ][0 ]],
267- [self .points [i ][1 ], self .points [i + 1 ][1 ]], 'r-' )
270+ [self .points [i ][1 ], self .points [i + 1 ][1 ]], 'r-' )
268271 myplt .plot (self .points [i ][0 ], self .points [i ][1 ], 'k.' )
269272
270273 myplt .xlim ([- self .lim , self .lim ])
271274 myplt .ylim ([- self .lim , self .lim ])
272275 myplt .draw ()
273- #myplt.pause(1e-5)
276+ # myplt.pause(1e-5)
274277
275278
276279if __name__ == '__main__' :
0 commit comments