Skip to content
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

Implement rcl_clock_time_started #1021

Merged
merged 2 commits into from
Dec 5, 2022
Merged

Conversation

methylDragon
Copy link
Contributor

@methylDragon methylDragon commented Dec 5, 2022

This PR reverts #1018 and implements rcl_clock_time_started instead, which checks if an rcl_clock_t has started (i.e., outputs a non-zero time when queried for current time.)

This was from an internal discussion that concluded that checking for time validity on a time point doesn't make sense (std::chrono's time points have no concept of validity, a time point reflecting (0, 0) is valid.) Instead, what matters is if a clock has a time point or not.

@methylDragon
Copy link
Contributor Author

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

Copy link
Member

@audrow audrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although this change itself looks good to me, i would suggest that the following procedure.

  1. revert Implement validity checks for time points #1018 only, and merge this revert commit in rolling.
  2. then apply rcl_clock_time_started.

it is up to package maintainers, but highly recommended. each PR should have complete fix as less dependencies as possible.

rcl/test/rcl/test_time.cpp Show resolved Hide resolved
@methylDragon
Copy link
Contributor Author

methylDragon commented Dec 5, 2022

although this change itself looks good to me, i would suggest that the following procedure.

  1. revert Implement validity checks for time points #1018 only, and merge this revert commit in rolling.
  2. then apply rcl_clock_time_started.

it is up to package maintainers, but highly recommended. each PR should have complete fix as less dependencies as possible.

Fair point! #1022

I've reconfigured this PR @fujitatomoya , the revert change is split off.
I also added a clarificatory comment in the tests: https://github.com/ros2/rcl/pull/1021/files

I will merge on green CI

@methylDragon methylDragon force-pushed the time-valid branch 2 times, most recently from 3aaab01 to 78f1934 Compare December 5, 2022 19:34
@methylDragon
Copy link
Contributor Author

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

@methylDragon methylDragon changed the title Implement rcl_clock_time_started and revert #1018 Implement rcl_clock_time_started Dec 5, 2022
Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with one comment

rcl/include/rcl/time.h Outdated Show resolved Hide resolved
methylDragon and others added 2 commits December 5, 2022 14:13
Signed-off-by: methylDragon <methylDragon@gmail.com>
Signed-off-by: methylDragon <methylDragon@gmail.com>

Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
@methylDragon methylDragon merged commit 09d86e2 into ros2:rolling Dec 5, 2022
@methylDragon methylDragon deleted the time-valid branch December 5, 2022 22:22
@methylDragon
Copy link
Contributor Author

@Mergifyio backport humble

@mergify
Copy link

mergify bot commented Jun 12, 2023

backport humble

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jun 12, 2023
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 09d86e2)
methylDragon added a commit that referenced this pull request Jun 13, 2023
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 09d86e2)

Co-authored-by: methylDragon <methylDragon@gmail.com>
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.

None yet

3 participants