Skip to content

move time files from rcl - #25

Merged
dirk-thomas merged 3 commits into
masterfrom
move_time
Jun 2, 2017
Merged

dirk-thomas merged 3 commits into
masterfrom
move_time

Conversation

@dirk-thomas

Copy link
Copy Markdown
Member

Previous CI builds looked good - the latest set addresses some linter warnings:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Please review since this is necessary to move forward on the logging API.

@Karsten1987

Copy link
Copy Markdown
Contributor

I don't feel really strong about it, but by just quickly browsing through the files, I have the feeling that this PR deserves a different place than rcutils. Does it make sense to create a ros-time related package? From what I've seen this PR is the complete implementation of time and thus goes beyond only utility functions. But I might be wrong.

@clalancette

Copy link
Copy Markdown
Contributor

@Karsten1987 I kind of see what you are saying, but I think this still counts as a utility, and thus it belongs in rcutils. However, it might make sense to make it a different package/library underneath rcutils; what do you think about that?

@mikaelarguedas

Copy link
Copy Markdown
Member

I tend to agree with @Karsten1987 maybe the time utilities deserve a specific package within the rcutils repository. But same as previous comments I don't feel very strongly about it.

@wjwwood

wjwwood commented Jun 1, 2017

Copy link
Copy Markdown
Member

I would also agree that putting the *_ros_time_source_t and related functions in here is not quite right. Ideally (IMO) these pr's would have:

  • moved everything but the ros time source stuff here (add logging API and macros #23 (comment))
  • create aliases from the rcutils_time* types and functions to rcl_time* equivalents (removes the need for use time from rcutils rclcpp#332)
    • For me the fact that the generic "time source" types and functions live in rcutils is an implementation detail of rcl.
  • add ros time stuff amongst the rcl aliases to rcutils, extending what's already there
    • this provides a "unified" interface for time for users of rcl (like rclcpp and rclpy)

But that's a lot of work, so maybe there is a compromise to be made, like putting the ros time source stuff back into rcl and just leaving the discrepancy in namespace. The other middle ground of moving everything to rcutils including the ros time source, is not as good of a compromise though I think.

I tend to agree with @Karsten1987 maybe the time utilities deserve a specific package within the rcutils repository.

I don't see a need for another package just for time. I think that everything except the "ros time" time source could easily belong in rcutils. For those in favor of that, what does a package just for time get us?

@Karsten1987

Karsten1987 commented Jun 1, 2017 via email

Copy link
Copy Markdown
Contributor

@mikaelarguedas

Copy link
Copy Markdown
Member

I don't see a need for another package just for time. I think that everything except the "ros time" time source could easily belong in rcutils. For those in favor of that, what does a package just for time get us?

It was more going in the direction of having the "ros time stuff" dissociated from the common utilities that are purely ros agnostic (as you expressed it much more clearly than me in your comment) than wanting the time utilities to have their own package. The additional package seemed to be the least amount of work allowing to not mix them in the same package. but I'm in favor of whatever compromise allowing this to move forward

@wjwwood

wjwwood commented Jun 1, 2017 •

Copy link
Copy Markdown
Member

There is also the other alternative I proposed (#23 (comment)), which I think might be the best of the alternatives, though maybe I didn't describe it properly.

Basically you would:

I think this requires more nuance than just moving everything, but it also provides the cleanest break between the logging macros and the time source concept.

@wjwwood

wjwwood commented Jun 1, 2017

Copy link
Copy Markdown
Member

My thinking behind this is that I believe that such a time package will
become bigger in the future (with sim time etc.) and having this a separate
package could allow ros2 agnostic packages such as TF2 use the same time
format than the ros2 stack without strongly depending on rcl*.

I think that's an admirable goal, but I see it as a separate decision from how to let the logging macros live in rcutils without moving ROS specific concepts into rcutils from rcl.

Also, anything using sim time will need a node to initialize sim time. It's possible that the interface, behind which sim time is implemented, could be generic and not tied to rcl*, but then I'd say it could just live in rcutils as a "general purpose C time source abstraction interface".

@dirk-thomas

Copy link
Copy Markdown
Member Author

change the logging macros that need time to just take a function pointer that returns the current time
this decouples them from the "time source" concept
a time source could still be wrapped in a function which is passed to the macro

The wrapping function can't be as simple as double get_now() imo. What does it do when the internal time source returns an error?

Anyway since we need a decision quickly on this topic I will schedule an in-person meeting for this today.

@wjwwood

wjwwood commented Jun 1, 2017

Copy link
Copy Markdown
Member

The wrapping function can't be as simple as double get_now() imo. What does it do when the internal time source returns an error?

We're sort of having the same conversation in two places, but as I said there you can have the get_now() function optionally return an error too and the logging macro can abort or exit or printf to stderr or whatever it wants if the get_now function fails.

@dirk-thomas

Copy link
Copy Markdown
Member Author

The conclusion of the ad hoc meeting was to only move the functionality to retrieve the current steady time from rcl to rcutils since it is required for the throttle macros. For consistency the same function for getting the system time is being moved (but not being used within rcutils at the moment). Any additional types and structures (e.g. time source, time source type, ROS time, etc.) are not being moved and stay in rcl.

I will update this as related PRs accordingly soon.

@dirk-thomas

Copy link
Copy Markdown
Member Author

New CI with updated PRs:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@dirk-thomas
dirk-thomas merged commit b8d4cb7 into master Jun 2, 2017
@dirk-thomas
dirk-thomas deleted the move_time branch June 2, 2017 05:11
@dirk-thomas dirk-thomas removed the in review Waiting for review (Kanban column) label Jun 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants