Conversation
|
I think this will diverge from how DDS specifies |
|
Imo it would be even better to keep it as unsigned and once |
|
Changing it to signed isn't a good idea imo. You can't really compare it to the rcl If we were to change this at all I'd advocate for a single nanoseconds signed 64-bit integer, but that would probably be too disruptive (different argument and out of scope for this issue at least).
Either way I wouldn't make the change proposed here. |
|
Err, I thought we were talking about a time point not a duration, so never mind the part about 2038 problem. I still would leave this with an unsigned nanoseconds, though I could possibly be swayed if we could enforce the boundary on it that it's within |
|
I think the comparison to DDS is valuable. Not necessarily as in "follow what they do" but "consider why they chose what they did. The upper bound ensures that a duration message is automatically "nomalized" which I think is a good thing. |
Well, signed or unsigned doesn't change the boundary issue. It just means you need two boundaries or just one. Whereas having signed nanoseconds avoids mixing unsigned and signed arithmetic. |
|
The other thing to consider for consistency is the same semantic as ROS1. If we're going to break that consistency there's not much reason to keep it in two fields. The 64bit signed nanoseconds is much simpler to process. But for now I'd suggest keeping it as is. |
|
Ignoring the signed/unsigned mixing for the moment, if the duration message is signed |
|
|
Thanks for the explanation. |
While fixing an issue found in ros2/rclcpp#525 I noticed the
nanosecis unsigned. I'm not sure what this is supposed to mean. Doesnanosecalways have the same sign assec, or is it always positive?Code in rclcpp just adds the two together. However, ros2/rcutils#79 was opened to prevent mixing of signed/unsigned types. This PR makes
nanosecsigned, and adds a comment saying the two fields are to be combined by addition.CI on ros2/rclcpp#527