-
Notifications
You must be signed in to change notification settings - Fork 15
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
Update document to better reflect proposed and accepted implementations #56
Conversation
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general.
I'll just point out that everything that's added to the SDF spec must be implemented by all parsers, not only libSDFormat
. It's important to take this into consideration, because the more complex the spec is, the more fragmented the SDF support is in the ecosystem. For example, the SDF parser that we have in JavaScript will probably not support this proposal for a long time.
This proposal intends to resolve on point (1) by adding `//pose/rotation/@type` | ||
where degrees can be specified, and *could* address point (2) by structuring | ||
This proposal intends to resolve on point (1) by adding `//pose/@degrees` | ||
where degrees can be selected, and *could* address point (2) by structuring | ||
the element differently (see below). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the intro have some sentences about quaternions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think it should. I was hoping that folks who would like to see quaternions supported provide the motivations for doing so. The original proposal did not have a solid motivation for quaternions, so we decided to drop them, but we've had discussions to bring them back. It would be great if we can list out the motivations here, so we can justify the added complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some documented support in the following issues for adding quaternion support to URDF in the following issues:
- urdf xml should support quaternions ros/urdfdom#13
- Add quaternion in URDF attributes ros/urdfdom#123
- Add Vector4 and initQuaternions to be able to parse quaternions from URDF files ros/urdfdom_headers#51
In terms of justification, though I find Quaternions less visually inspectable, they are more straightforward to interpret than Euler angles (24 total flavors). This simplifies the portability of quaternions to other pieces of software and algorithms.
If using a camera calibration algorithm that yields Quaternion coefficients (such as doi:10.1109/TIP.2011.2164421), it is most straightforward to directly specify those coefficients in the model file, rather than requiring a user to convert them to roll-pitch-yaw angles, with the risk of calculation errors and precision loss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall I suggest text in this PR or open a new pull request with justification for quaternions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way works, but please feel free to make direct changes to this PR.
specify_pose/proposal.md
Outdated
angle. This is provided for legacy purposes and ease of conversion. | ||
* It is not suggested to use this for a text-storage format. | ||
* Same precision as suggested below for quaternions: Use 17 digits of | ||
precision, and consider separating each value on a new line. | ||
* `q_wxyz` - Quaternion as a 4-tuple, represented as `(w, x, y, z)`, where `w` | ||
* `@rotation_format="q_wxyz"` - Quaternion as a 4-tuple, represented as `(w, x, y, z)`, where `w` | ||
is the real component. This should generally be used when the rotation should be | ||
machine-generated (e.g. calibration artifacts). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Should" sounds a bit too opinionated. Some other use cases for quaternions that I can think of are precision and integration with specific tools. I'd recommend rephrasing to be less specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to "This is the recommended format for machine-generated files (e.g. calibration artifacts)." How does that sound?
specify_pose/proposal.md
Outdated
* This should be used when the rotation should generally be human-readable. | ||
* `rpy_radians` - Same as `rpy_degrees`, but with radians as the units for each | ||
* `@rotation_format="rpy"`, `@degrees="false"` - Same as above, but with radians as the units for each | ||
angle. This is provided for legacy purposes and ease of conversion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saying that this is provided for legacy purposes suggests that this may be deprecated in the future. Is that the case? Aren't there valid use cases for radian RPY?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I would say that it is the default for legacy purposes, not that it is provided for legacy purposes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to "This is the default for legacy purposes" in a258425
specify_pose/proposal.md
Outdated
* This should be used when the rotation should generally be human-readable. | ||
* `rpy_radians` - Same as `rpy_degrees`, but with radians as the units for each | ||
* `@rotation_format="rpy"`, `@degrees="false"` - Same as above, but with radians as the units for each | ||
angle. This is provided for legacy purposes and ease of conversion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I would say that it is the default for legacy purposes, not that it is provided for legacy purposes
specify_pose/proposal.md
Outdated
<pose rotation_type="rpy_radians">{xyz} {rpy_radians}</pose> | ||
<pose rotation_type="rpy_degrees">{xyz} {rpy_degrees}</pose> | ||
<pose rotation_format="rpy_radians">{xyz} {rpy_radians}</pose> | ||
<pose rotation_format="rpy_degrees">{xyz} {rpy_degrees}</pose> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are using //pose/@degrees
, then I would change the @rotation_format
values to euler_rpy
or q_wxyz
/ quat_wxyz
/ quaternion_wxyz
this way the portion before the _
describes the rotation format (quaternion or Euler angles) and the part after the _
describes the component order
I would still only support one form of Euler angles, but ensure that the rotation order is clearly documented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
euler_rpy
and quat_wxyz
sound good to me.
I would still only support one form of Euler angles, but ensure that the rotation order is clearly documented
Agreed. Looking at that link reminded me a recent change to the pose spec (fix in gazebosim/sdformat#698). I don't think we can completely get rid of confusion about Euler angles, but we should do our best to clearly document SDFormat's convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to euler_rpy
and quat_wxyz
in a258425.
specify_pose/proposal.md
Outdated
* This should be used when the rotation should generally be human-readable. | ||
* `rpy_radians` - Same as `rpy_degrees`, but with radians as the units for each | ||
* `@rotation_format="rpy"`, `@degrees="false"` - Same as above, but with radians as the units for each |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the candidate values for @rotation_format
given here don't match the values above in Syntax B.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a258425.
@@ -321,19 +288,17 @@ in code, the order of operations, etc.). | |||
|
|||
#### 1.2 Conversion to SDFormat 1.9 | |||
|
|||
When SDFormat files are converted from SDFormat <=1.8 to 1.9, the `//pose` tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this section because I think this was a remnant of when this document proposed to deprecate RPY with radians. IMO, we should leave poses in older files intact. This will keep converted from getting verbose. Also, we currently print out only attributes with non-default values. We can have a special case for //pose
so that //pose/rotation_format="euler_rpy"
and //pose/@degrees=false
get printed even though they are the default values, but the added complexity doesn't seem justified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes! Looks good in general, on a separate note, I found a typo we missed out in the past, coordiantes
https://github.com/ignitionrobotics/sdf_tutorials/blob/azeey/better_pose_update/specify_pose/proposal.md?plain=1#L279
I am indifferent between Separately, would it be confusing for users if we supported both |
To answer my own question: if we are only supporting one form of Euler angles, I think we can also pick a single form for quaternions. So I would lean towards |
I like the proposal. |
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Okay, I've updated the document to \cc @aaronchongth |
#57) * Add motivation for quaternions as rotation format Signed-off-by: Steve Peters <scpeters@openrobotics.org> Co-authored-by: Addisu Z. Taddese <addisu@openrobotics.org>
This updates the proposal to reflect the accepted implementation in gazebosim/sdformat#589 and the proposed implementation in gazebosim/sdformat#690.
Preview: http://sdformat.org/tutorials?tut=better_pose_proposal&cat=pose_semantics_docs&branch=azeey%2Fbetter_pose_update