Skip to content

Conversation

johboe
Copy link
Contributor

@johboe johboe commented Sep 7, 2025

Description

Related to issues #21 and #175

Currently, the C++ implementation of the TimeSequencer is not working, as the following error is thrown:

terminate called after throwing an instance of 'std::runtime_error'
  what():  can't compare times with different time sources
[ros2run]: Aborted

The proposed fix implements the suggested solutions from the issues and initializes last_time_ in the constructor to use the clock type RCL_ROS_TIME. This is necessary because the message time stamp

rclcpp::Time stamp = mt::TimeStamp<M>::value(*e.getMessage());

(here) is returned with clock type RCL_ROS_TIME and comparing two different clock types is not allowed. The clock type in its corresponding test files is also changed.

Additionally, the timer update_timer_ is created using the node's clock instead of the wall clock to also work in simulation with sim-time.

Is this user-facing behavior change?

No

Did you use Generative AI?

No

Additional Information

Tested under ROS2 Jazzy and ROS2 Rolling.

Initializes last_time_ with RCL_ROS_TIME and uses the node's clock when comparing time stamps
Use RCL_ROS_TIME in all relevant commands in correct test file of TimeSequencer and fix code style from previous commits
@ahcorde
Copy link
Contributor

ahcorde commented Oct 2, 2025

Pulls: #202
Gist: https://gist.githubusercontent.com/ahcorde/efd445114b5639030707b7b74eca9f9f/raw/9f1980ba557418952997b61f823099889efe4cc7/ros2.repos
BUILD args: --packages-above-and-dependencies message_filters
TEST args: --packages-above message_filters
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/17159

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

@ahcorde ahcorde merged commit 19645c9 into ros2:rolling Oct 3, 2025
2 checks passed
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.

2 participants