-
Notifications
You must be signed in to change notification settings - Fork 43
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
Docstrings for RotXYZ and similar could cause confusion with keyword arguments #294
Comments
Not a maintainer (or even contributor) but I agree with your point. What do you think about the tables I created in this comment? That are obviously too much for a docstring, which is the issue here, but the docstrings could always refer to the readme as a reference for the "theory" required to understand the package. |
I like your table 😄 and thanks for the link to the other discussion. For me, everything became clear when I saw the mathematical expressions in the docs, so maybe just an example and a URL is enough for the docstrings. Adding intrinsic vs. extrinsic rotations to the mix adds more complexity, but good to see this is being discussed in the other issue. |
I'd like to add another observation I believe is quite important. It's great that "yaw" "pitch" and "roll" keywords are offered. But my understanding is that they are always available as simple aliases to the z, y and x parameters. I don´t think this should be offered as such. These angles "yaw", "pitch" and "roll" have a very specific meaning. When you rotate an object, and you look at the angle of the projection of the object's rotated x-axis onto the x-y plane of your reference frame, that vector's angle is the yaw. When you look at the angle between the x-axis and the x-y plane, that is the pitch. The roll is the rotation around the x axis that would bring the y-axis parallel to the x-y plane. (There might be other conventions). It is not the case that these angles map generally to the parameters of every
This shows only The fact the keywords are offered in all cases is misleading, in my opinion. It should only be available for the In other words "roll", "pitch" and "yaw" are not really just aliases to the parameters in general, they are properties of the rotation, and they only directly map to parameters for the specific case of Maybe things are more complicated if you consider other conventions instead of x to the front, but I don't it's really helping not to point out what you probably want is to be using |
Taking
RotXYZ(roll=r, pitch=p, yaw=y)
as an example, the docstring saysI began somewhat uninitiated on Euler angles, so it took me quite some time to realize that
XYZ order
refers the the order of matrix multiplication (RxRyRz), rather than the sequence of actually carrying out the rotations. I thought it meant first rotate around the X axis byr
, then around Y byp
, then around Z byy
.The first sentence in the same doscstring is super clear, indicating the sequence of rotations and which argument is used for each, so maybe this pattern could be used for the keyword arguments case too. Also perhaps it could be made clear that the keyword arguments essentially relate to argument order, e.g.
RotZXY(a, b, c) == RotZXY(roll=b, pitch=c, yaw=a)
. Or maybe just useX
,Y
,Z
as keyword arguments?Thanks for your work on the package!
The text was updated successfully, but these errors were encountered: