Skip to content

[Issue-126] fix several issues with animate #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

jcao-bdai
Copy link
Collaborator

@jcao-bdai jcao-bdai commented Jul 19, 2024

Fix several issues related to #126

  • expose "ax" and "dims" arguments to animate(...), to be consistent with other API's;
  • update animate implementation to be consistent with trajectory frame's data type, in particular, SE3Array / SO3Array types instead of SE3 / SO3, in line with animate.run(...)'s implementation.

Example use-cases:

...
ax = fig.add_subplot(111, projection='3d')
T1.plot(ax=ax, dims=[-5, 10])
T1.animate(start=T2, ax=ax)  # would use the existing ax which is [-5, 10]
# T1.animate(start=T2, ax=ax, dims=[-10, 10])  # would use the existing ax and override its lims to [-10, 10]
plt.show()

@jcao-bdai jcao-bdai force-pushed the issue-126/fix-animate-behavior branch 2 times, most recently from 6dc40ae to 21f9b56 Compare July 19, 2024 20:36
@jcao-bdai jcao-bdai force-pushed the issue-126/fix-animate-behavior branch from 2e32897 to 3262923 Compare July 22, 2024 16:47
@jcao-bdai jcao-bdai force-pushed the issue-126/fix-animate-behavior branch from 3262923 to cc7398f Compare July 23, 2024 19:13
Copy link
Contributor

@bhung-bdai bhung-bdai left a comment

Choose a reason for hiding this comment

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

Seems like a reasonable change to me, but I'm not a primary user of the Spatialmath animation tool. I would feel more comfortable if there was infra to unit test, but I'm also not Spatialmath comes with that in the first place.

Copy link
Collaborator

@myeatman-bdai myeatman-bdai left a comment

Choose a reason for hiding this comment

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

Approved, minor comment.

@@ -104,6 +104,12 @@ def __init__(
# ax.set_zlim(dims[4:6])
# # ax.set_aspect('equal')
ax = smb.plotvol3(ax=ax, dim=dim)
if dim is not None:
if len(dim) == 2:
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we have a runtime error that check's for length 2 or 6?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks! added this check in 27fd4aa

@jcao-bdai jcao-bdai merged commit d6134bf into master Jul 29, 2024
19 checks passed
@jcao-bdai jcao-bdai deleted the issue-126/fix-animate-behavior branch July 29, 2024 18:31
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.

3 participants