-
Notifications
You must be signed in to change notification settings - Fork 84
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
Running tranimate with sequences of angles... #4
Comments
Not sure it's possible. I think you need to render a set of frames and play them back. For many use cases that's probably not a big disadvantage. Alternatively, programmatically change the backend and have the animation figure "pop out" of the notebook. |
We found a way:
The question is now: what is a good way to pack a set of matrix rotations and pass them to tranimate in python the way it was done in matlab... Especially for interpolation of rotations... I can get starting and ending poses, convert them to tr's, and then pass them to tranimate. But this is not exactly the same as passing the set of matrices into tranimate directly from all of the interpolation. The use of |
TkAgg is great but little known, I hope it is supported long into the future.
You want to do something like the example on p48 of the book? That’s not yet implemented, not hard, but I was thinking it wasn’t really useful to many people. Tell me what you’d like to be able to write.
Peter
…Sent from my iPad
On 2 Feb 2021, at 12:41 am, Dr. Juan Rojas ***@***.***> wrote:
We found a way:
import matplotlib; matplotlib.use("TkAgg") #THIS IS THE MAGIC
import matplotlib.pyplot as plt
# TAke the first and last configurations
qr1 = out.q[0]
qrf = out.q[-1]
# Get homogenous transform representations
R1 = rpy2tr(qr1);
Rf = rpy2tr(qrf);
# Pass them to tranmiate via the @ operator
***@***.***, frame='A', arrow=False, nframes=200);
The question is now: what is a good way to pack a set of matrix rotations and pass them to tranimate in python the way it was done in matlab... Especially for interpolation of rotations... I can get starting and ending poses, convert them to tr's, and then pass them to tranimate. But this is not exactly the same as passing the set of matrices into tranimate directly from all of the interpolation.
Any thoughts?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I see. Could possibly iterate over a loop doing something like this:
I guess animating from a the first to the last frame with tranimate via the @ operator amounts to doing this no? |
@rojas70 I looked into the function definition. I believe currently the A@B would be evaulated first before passing the result (a single SE3/SO3 object) to the tranimate function.
|
This is the code I use to animate the sequence of transformations with the cube (I did this in HW01) Kenson
|
Thank you @mfkenson! @petercorke, compariang outputs of carateian interpolation ctraj vs those of joint angle interpolation jtraj is an interesting test case scenario. The former yields straigtline motions that maintain an orientation while the latter follow an orbital path.... Additionally, many aspects of the previous version of the course was based on easily displaying jtraj's and ctraj's... it is very nice to see the evolution of the transformed coordinate frame. I think it would be good to include it in the toolbox here. |
@rojas70 let me try to work on the code. hopefully will make a pull request after lunar new year. See you in next lecture! |
@petercorke @rojas70 this PR would make trplot and tranmiate accepts list of T (SE3.A 4x4 ndarray) cheers! |
Thanks. Maybe a bit before that I pushed a change to trplot() that takes an iterable. Unlike tranimate, it leaves all the frames showing. |
yes I could see your changes in base.trplot (transforms3d.py). Thats why I decided to make the change accordingly to animate.trplot (animate.py) where tranimiate depends on it. I think I should implement the same change in class Animate2 so that tranimate2 could take advantage as well. I will make another new PR for both changes soon. |
just submitted a new PR. Hopefully this could help the students migrating from the matlab toolbox. |
I've just pushed some changes to GH that allow you to pass a generator
The animate framework could be extended to points. At the moment the only entities it supports are lines, arrows and text but the framework is quite general. Also need to generalise it allow multiple entities to be individually moved around. |
Nice. BTW I've just seen your latest commit and really like the try_except way. Maybe I could make an example demonstrating the use of tranmiate<-generator. Such as visualizing the pose of realsense t265 in real world. |
Thanks. I’ll make some more commits on the weekend. Finally got it so that animation works reliably in notebook and REPL.
I’m also going to write up how tranimate() works, the underlying Animate framework should allow for multiple independently moving entities, time to open that up.
… On 25 Feb 2021, at 8:50 pm, Kenson Leung W.K ***@***.***> wrote:
Nice. BTW I've just seen your latest commit and really like the try_except way.
Maybe I could make an example demonstrating the use of tranmiate<-generator. Such as visualizing the EE pose of my "Work in progress" mini desktop robot arm.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#4 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AC2BIUVXJROICDT4S2XA3YDTAYTRHANCNFSM4WRPHFDQ>.
|
I am having a hard time showcasing the animation of tranimate in python-notebooks. What is the recipe to get them to visualize here?
The text was updated successfully, but these errors were encountered: