dfki-ric / pytransform3d

3D transformations for Python.
https://dfki-ric.github.io/pytransform3d/
Other
615 stars 63 forks source link

Request: Interpolation method with linear displacement and SLERP rotation #273

Closed scottshambaugh closed 9 months ago

scottshambaugh commented 11 months ago

I am just learning the library so apologies if there's an easy way to do this already. Looking at the gallery example of interpolation methods between two poses, I am looking for (and do not see) a trajectory that takes a straight line path. I am looking for an interpolation method that linearly interpolates the displacement, such that it follows the path of the black arrow in the image. And then the rotation along that trajectory would just be calculated with SLERP.

image

Thank you for the library btw, I think that I'm going to find this immensely useful! I've picked up maintenance of the 3D plotting module of matplotlib so please don't hesitate to ping me on issues over there if there is something you're looking for.

AlexanderFabisch commented 11 months ago

I am looking for (and do not see) a trajectory that takes a straight line path. I am looking for an interpolation method that linearly interpolates the displacement, such that it follows the path of the black arrow in the image. And then the rotation along that trajectory would just be calculated with SLERP.

Yes, that would be a useful feature. It's not directly available yet. Not sure for which representation I should make it available though. ScLERP is the natural interpolation for exp. coordinates and dual quaternions, but LERP + SLERP seems more appropriate for position + quaternion. What do you think?

I've picked up maintenance of the 3D plotting module of matplotlib so please don't hesitate to ping me on issues over there if there is something you're looking for.

Thanks, that's good to know! :) Also feel free to let me know if there is something that can be improved in the usage of matplotlib for 3D plotting in pytransform3d.

scottshambaugh commented 11 months ago

I do think it makes most sense for the position + quaternion representation, yes. I don't know of a catchy name for it though :)

AlexanderFabisch commented 11 months ago

This has been merged to the develop branch through #274 and will be part of the next release.

AlexanderFabisch commented 9 months ago

Released with 3.5.0 today