-
Notifications
You must be signed in to change notification settings - Fork 111
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
Make Quaternion valid by default #74
Conversation
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.
It seems like a reasonable change to me. I'm not sure if there's any ramifications we should worry about given that a lot of code is using this message. I'm not familiar enough with ros1_bridge to know if there is anything else that needs to be done.
I'd like to get feedback from others.
The |
My concern would that someone is potentially relying on this behavior already. An example I can think of would be:
I don't have any cases of this happening readily, but it's potentially out there. |
That pseudocode seems too abstract to address as a potential concern. So far I'm not able to think of any valid use case that this change would break. The only common usage I can think of for the I can think of two possibilities for breakage that I would consider invalid use cases:
This both seem like abuses of the intended purpose of generated interfaces and I assume there's no commitment to not breaking mis-use like that. |
Apologies, it was a bit hand-wavy. I meant to say initialized vs uninitialized rather than valid/invalid. To your first bullet point, an example I could think of is in the IMU message, where if the quaternion value is not all-zeros, it can be assumed that the sensor is providing a filtered orientation, where alternatively the program could choose to use the angular rates instead and compute an orientation. I agree that this is probably a shortcoming of the downstream users of the Quaternion message, rather than the Quaternion message itself. I believe at least in |
Signed-off-by: Josh Langsfeld <[email protected]>
e88626b
to
36ee852
Compare
That's what releases/versioning is for? It will probably break something for someone, but it does seem like a step forward IMO. |
Fair enough, I'm not opposed. It probably warrants a note on the Eloquent release page. |
I appreciated the discussion to make sure we'd thought through possible consequences. Hopefully this will turn out to be a very easy win. |
Those tests are manually "initializing" quaternions by setting a member other than |
@jdlangs Would you mind contributing some PRs to update those tests so that they are compatible with this change? |
PR made: ros2/geometry2#177 |
Thanks! I'll run CI again to see where we stand: Edit: re-triggered with up-to-date repos file. All test failures are unrelated; also occurring in the most recent nightly CI jobs. |
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.
@jdlangs Thanks for the contribution! I'll document this change in the Eloquent release notes.
Thanks for your time checking this and getting it included! |
Signed-off-by: Josh Langsfeld <[email protected]>
It was often a gotcha in ROS1 that creating a default
Quaternion
object didn't give you the identity quaternion (w,x,y,z == 1,0,0,0
) but rather an invalid quaternion with everything initialized to zero. I always thought this was the perfect use of default values in the.msg
file. Any particular reason why this hasn't been done already?