dfki-ric / pytransform3d

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

Provide advice on transformation streams over time #251

Closed kopytjuk closed 1 year ago

kopytjuk commented 1 year ago

Some advice to the user, how to tackle dynamic transformations.

AlexanderFabisch commented 1 year ago

Hi @kopytjuk ,

thanks for your contribution. I have two suggestions:

kopytjuk commented 1 year ago

Hi @kopytjuk ,

thanks for your contribution. I have two suggestions:

  • I am not completely sure if that is the best place to explain this. Maybe it is better to add a new page and refer to it in the docstring.
  • There are alternative ways to interpolate poses (position + orientation). Here is an example that compares several approaches. Dual quaternion ScLERP is my recommendation.

HI @AlexanderFabisch , would Camera distortion parameter be a good place? There I could refer ScLERP and the corresponding example-

AlexanderFabisch commented 1 year ago

HI @AlexanderFabisch , would Camera distortion parameter be a good place? There I could refer ScLERP and the corresponding example-

I assume you use some kind of autocompletion. There are no camera distortion parameters. :smile:

I'd rather make a new page about interpolations.

kopytjuk commented 1 year ago

Sorry, I was referring to https://dfki-ric.github.io/pytransform3d/transform_manager.html (copy&paste mistake) - there would be a good place to mention how to deal with dynamic actors in time :)

AlexanderFabisch commented 1 year ago

Yes, I got that. There are several functions and examples that you could refer to.

Examples:

Functions

Also generally if you want to interpolate locally, averaging compact axis-angle / exponential coordinates or quaternion / dual quaternions + renormalization is always a good enough option.

Explaining all these ideas deserves a new page in my opinion. It doesn't make sense to include that as a subsection of another page.

AlexanderFabisch commented 1 year ago

Looks good!

Here are some suggestions:

kopytjuk commented 1 year ago

Hey @AlexanderFabisch,

I apologize for the many PEP8 violations - for now I fixed all PEP8 related comments by running black.

I think in the next PR I can set-up github actions on branches, so you do not have to comment on PEP8 on that in the future :)

To the other points:

image

AlexanderFabisch commented 1 year ago

Thanks, great works so far!

Regarding the length of the script - I completely agree - how would you personally approach that? Would moving some parts (e.g. interpolation function) into some module make sense?

I wouldn't add any new features to the library yet. I'd recommend to print only selected lines. There should be an option to do that.

kopytjuk commented 1 year ago

Now I think I have a better version and only section from the script in the docs ...

Still I am personally not satisfied with the example-plot, since it is hard to visualize both the time and path at the same time ...

image

kopytjuk commented 1 year ago

Also thinking about the mathematical notation in the SVG plot - I have to revert A and B, too, right? Since the order of letters in code and mathem. notation is always reverted as you suggest in https://dfki-ric.github.io/pytransform3d/transformation_modeling.html

Would it not be a good solution to use the notation from John Craigs Introduction to Robotics: Mechanics and Control (also used in ROS-tf: http://wiki.ros.org/tf/Overview/Transformations)

AlexanderFabisch commented 1 year ago

Would it not be a good solution to use the notation from John Craigs Introduction to Robotics: Mechanics and Control (also used in ROS-tf: http://wiki.ros.org/tf/Overview/Transformations)

There are several conventions. I know at least

You read all of them from right to left. In the end, I don't think one is better than another, we just have to select one. I like Furgale's convention because all frame names are right of the transformation symbol. Otherwise it might be a bit confusing sometimes.

AlexanderFabisch commented 1 year ago

Still I am personally not satisfied with the example-plot, since it is hard to visualize both the time and path at the same time ...

You could make multiple subplots with time on the x-axis and one dimension on the y-axis.

kopytjuk commented 1 year ago

You could make multiple subplots with time on the x-axis and one dimension on the y-axis.

I just tried that, it would need an additional for loop with collecting the interpolated points/transformation per timestep in an array ... I will again make the script larger and harder to understand ...

I think we made the point that appropriate interpolation in time is needed to use the very helpful TransformManager ... What do you think?

kopytjuk commented 1 year ago

Ready to merge from my side. Should I do it?

Fine from my side, too :) Let's go for it

AlexanderFabisch commented 1 year ago

Done. Thanks for your contribution!