Skip to content

Convert ROS2 time value to signed int64_t #79

@serge-nikulin

Description

@serge-nikulin

I think that a signed value is a more metrologically and physically correct representation of any non-absolute, "non-Kelvin" time system in comparison the current ROS2 unsigned value.

Regardless of metrology correctness signed time value makes computations of durations (always a signed value!) more unerring in the programming sense. MISRA C 2012 rule 10.4 treats signed and unsigned as different incompatible types. It takes very messy coding to account for over- and underflow edge conditions in sign-mixed math.

The current nanoseconds uint64_t gives us ~584.5 years from 1970, int64_t is twice shorter. Correspondingly it's 2554AD and 2262AD.

I think both end dates are remote enough for both unsigned and signed values to be practical in today's applications.

CC: @wjwwood

Metadata

Metadata

Assignees

Labels

in reviewWaiting for review (Kanban column)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions