Skip to content

Conversation

@saikishor
Copy link
Contributor

fixes: #488

This PR adds monotonic slew-free clock implementation that can be used for industrial applications where a slew-free clock plays a very important role when integrating ros2_control with industrial applications to avoid rattling sound in the actuators when there is a time drift

Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

LGTM, @fujitatomoya or @alsora do you mind to take a look ? you were involved in the thread discussion

@saikishor
Copy link
Contributor Author

Thank you @ahcorde for the review.

I would like to know if this can be backported till Jazzy? It is interesting to have it on older distros as it can fix some critical clock issues.

@ahcorde
Copy link
Contributor

ahcorde commented Jul 14, 2025

Thank you @ahcorde for the review.

I would like to know if this can be backported till Jazzy? It is interesting to have it on older distros as it can fix some critical clock issues.

It's new API, I would say it's save to backport this to other distros

@ahcorde
Copy link
Contributor

ahcorde commented Jul 14, 2025

Pulls: #507
Gist: https://gist.githubusercontent.com/ahcorde/e194fff2ddae8c36c65733d6ab997ece/raw/ff64299673a6693c53773eacd6b3fd7d103a65f2/ros2.repos
BUILD args: --packages-above-and-dependencies rcutils
TEST args: --packages-above rcutils
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/16489

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

@fujitatomoya
Copy link
Collaborator

@saikishor @ahcorde actually i am really interested in this clock type extension, i will take a look. please let me have a couple of days.

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.

as rcutils implementation this looks good to me.

btw, to extend the clock type for the application via rclcpp and rclpy, we need to merge all related PRs all together. (although we can go step by step, my preference is to merge all related PRs together once they are ready. so that we do not need to revert or roll back the fixes if anything come up.)

@saikishor are you also willing to work on rcl, rclcpp and rclpy to support RCL_RAW_STEADY_TIME type?

@saikishor
Copy link
Contributor Author

btw, to extend the clock type for the application via rclcpp and rclpy, we need to merge all related PRs all together. (although we can go step by step, my preference is to merge all related PRs together once they are ready. so that we do not need to revert or roll back the fixes if anything come up.)

@saikishor are you also willing to work on rcl, rclcpp and rclpy to support RCL_RAW_STEADY_TIME type?

Fair enough. I can try to work on this during these days.

I'm also very much interested in having these changes on older distros

@fujitatomoya
Copy link
Collaborator

@saikishor really appreciate your effort! thanks.

I'm also very much interested in having these changes on older distros

So am I. I am thinking that this is probably adding the functions and enum, so expecting that there is not ABI break for the downstream distros. i may be wrong, but that is my expectation at this point.

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 green CI.

@fujitatomoya
Copy link
Collaborator

Pulls: #507
Gist: https://gist.githubusercontent.com/fujitatomoya/d3a1460dfa46c360bdfd7870b9c80f2d/raw/ff64299673a6693c53773eacd6b3fd7d103a65f2/ros2.repos
BUILD args: --packages-above-and-dependencies rcutils
TEST args: --packages-above rcutils
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/16666

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

@fujitatomoya
Copy link
Collaborator

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

@fujitatomoya
Copy link
Collaborator

I believe CI failures are unrelated, none of the added unit tests are failing. i will go head to merge this.

@fujitatomoya fujitatomoya merged commit 89264ce into ros2:rolling Aug 21, 2025
3 checks passed
@fujitatomoya
Copy link
Collaborator

  • This fix is API/ABI compatible, so that we can backport this PR for the downstream distros.
  • This is low level system interface to get the monotonic raw clock from rcutils, which is useful for ROS 2 application in general to handle the raw sensing data coming from the sensors.

@fujitatomoya
Copy link
Collaborator

@Mergifyio backport kilted jazzy humble

@mergify
Copy link

mergify bot commented Aug 21, 2025

backport kilted jazzy humble

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Aug 21, 2025
* Add rcutils_raw_steady_time_now method for slew-free clock

Signed-off-by: Sai Kishor Kothakota <[email protected]>

* Added RCUTILS_LOG_WARN_ONCE about the behaviour on unsupported platforms

---------

Signed-off-by: Sai Kishor Kothakota <[email protected]>
(cherry picked from commit 89264ce)
mergify bot pushed a commit that referenced this pull request Aug 21, 2025
* Add rcutils_raw_steady_time_now method for slew-free clock

Signed-off-by: Sai Kishor Kothakota <[email protected]>

* Added RCUTILS_LOG_WARN_ONCE about the behaviour on unsupported platforms

---------

Signed-off-by: Sai Kishor Kothakota <[email protected]>
(cherry picked from commit 89264ce)
mergify bot pushed a commit that referenced this pull request Aug 21, 2025
* Add rcutils_raw_steady_time_now method for slew-free clock

Signed-off-by: Sai Kishor Kothakota <[email protected]>

* Added RCUTILS_LOG_WARN_ONCE about the behaviour on unsupported platforms

---------

Signed-off-by: Sai Kishor Kothakota <[email protected]>
(cherry picked from commit 89264ce)

# Conflicts:
#	src/time_unix.c
@saikishor
Copy link
Contributor Author

Thank you @fujitatomoya

ahcorde pushed a commit that referenced this pull request Aug 21, 2025
(cherry picked from commit 89264ce)

Signed-off-by: Sai Kishor Kothakota <[email protected]>
Co-authored-by: Sai Kishor Kothakota <[email protected]>
ahcorde pushed a commit that referenced this pull request Aug 21, 2025
(cherry picked from commit 89264ce)

Signed-off-by: Sai Kishor Kothakota <[email protected]>
Co-authored-by: Sai Kishor Kothakota <[email protected]>
ahcorde added a commit that referenced this pull request Aug 22, 2025
…507) (#515)

Signed-off-by: Tomoya Fujita <[email protected]>
Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
Co-authored-by: Sai Kishor Kothakota <[email protected]>
Co-authored-by: Tomoya Fujita <[email protected]>
Co-authored-by: Alejandro Hernandez Cordero <[email protected]>
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.

Use MONOTONIC_RAW instead of MONOTONIC for steady clock

4 participants