rmw_time_t is redundant with rcutils_duration_value_t and doesn't need to be a struct

Open
#215 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

  • #255 by @emersonknapp — closed without merging
  • #298 by @emersonknapp — closed without merging

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
32/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Start by locating the rmw_time_t declaration shown in the issue and tracing its uses across the rmw interface. Check how those uses depend on sec/nsec fields versus a nanosecond value, and identify the relevant tests or API checks. Done means the representation and naming consistently describe a duration without breaking the interface.

Written by the indexing model from the issue text.

Description

backlog

rmw_time_t is defined as:

typedef struct RMW_PUBLIC_TYPE rmw_time_t
{
  uint64_t sec;
  uint64_t nsec;
} rmw_time_t;

This differs from rcutils_duration_value_t which admits a value as just a int64_t holding nanoseconds. It probably makes sense to replace rmw_time_t with a type alias for rcutils_duration_value_t, and to make clear that it is a duration, not a time point.

Dominant language
C
Stars
121
Forks
89
Avg merge
17h 40m
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ros2/rmw

All issues in ros2/rmw

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.