Skip to content

Conversation

timmarkhuff
Copy link
Contributor

@timmarkhuff timmarkhuff commented May 24, 2024

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

#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 too fast in my opinion, so I increased the pause time.

CheckList

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

def draw_graph(self, rnd=None):
plt.cla()
self.ax.axis([-1, 1, -1, 1])
self.ax.axis([-1, 1, -1, 1, -1, 1])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main fix

print("Cannot find path")
else:
print("found path!!")
plt.ion()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a loop so the user can rewatch the animation

[y for y in y_points],
[z for z in z_points],
"o-", color="grey", ms=4, mew=0.5)
plt.pause(0.1)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

increasing the pause time, because it seems way to fast

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increasing the pause time makes sense for me, but what is for other changes?

Copy link
Owner

@AtsushiSakai AtsushiSakai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timmarkhuff Thank you for your PR. Could you please fix the CI failures?

[y for y in y_points],
[z for z in z_points],
"o-", color="grey", ms=4, mew=0.5)
plt.pause(0.1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increasing the pause time makes sense for me, but what is for other changes?

@timmarkhuff
Copy link
Contributor Author

@timmarkhuff Thank you for your PR. Could you please fix the CI failures?

Sorry didn't realize they had failed. Should be good now. I was trying to allow the user to replay the animation. The idea is they could reposition the camera, hit a button and the animation would replay. It wasn't working quite the way I wanted, and it was causing a CI failure that I could not fix, so I just removed it.

@timmarkhuff timmarkhuff requested a review from AtsushiSakai May 25, 2024 18:22
@AtsushiSakai AtsushiSakai merged commit 9fed26e into AtsushiSakai:master May 26, 2024
@AtsushiSakai
Copy link
Owner

@timmarkhuff Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants