PythonRobotics icon indicating copy to clipboard operation
PythonRobotics copied to clipboard

Fixing ArmNavigation/rrt_star_seven_joint_arm_control/rrt_star_seven_joint_arm_control.py

Open timmarkhuff opened this issue 1 month ago • 0 comments

When I run ArmNavigation/rrt_star_seven_joint_arm_control/rrt_star_seven_joint_arm_control.py, I get an error:

  File "/Users/tim/PythonRobotics/ArmNavigation/rrt_star_seven_joint_arm_control/rrt_star_seven_joint_arm_control.py", line 405, in <module>
    main()
  File "/Users/tim/PythonRobotics/ArmNavigation/rrt_star_seven_joint_arm_control/rrt_star_seven_joint_arm_control.py", line 384, in main
    ax = rrt_star.draw_graph()
         ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tim/PythonRobotics/ArmNavigation/rrt_star_seven_joint_arm_control/rrt_star_seven_joint_arm_control.py", line 268, in draw_graph
    self.ax.axis([-1, 1, -1, 1])
  File "/Users/tim/PythonRobotics/my_env/lib/python3.11/site-packages/matplotlib/axes/_base.py", line 2114, in axis
    raise TypeError(
TypeError: The first argument to axis() must be an iterable of the form [xmin, xmax, ymin, ymax, zmin, zmax]

Reference issue

https://github.com/AtsushiSakai/PythonRobotics/issues/1021

What does this implement/fix?

I changed self.ax.axis([-1, 1, -1, 1]) to self.ax.axis([-1, 1, -1, 1, -1, ]) as the error message suggests.

Additionally, the animation plays way to fast in my opinion, so I increased the pause time.

Finally, I added a loop so the user can rewatch the animation

CheckList

  • [ ] Did you add an unittest for your new example or defect fix?
  • [ ] Did you add documents for your new example?
  • [x] All CIs are green? (You can check it after submitting)

timmarkhuff avatar May 24 '24 21:05 timmarkhuff