ros2 / ros2/rclcpp

Time: Enable operators with different clock sources if one of the times is zero.

Open
#2,113 1 comment 0 reactions 1 assignee View on GitHub

@methylDragon is already working on this.

Since Mar 9, 2023.

Dominant language
C++
Stars
805
Forks
564
Avg merge
1d 17h
Merged PRs (30d)
27

Description

Feature request

Feature description

There should be a possibility to compare a Time object constructed by rclcpp::Time() or rclcpp::Time(0) with a Time object obtained from get_clock()->now() and similar without the possibility of a runtime error to enable checking for uninitialized time.

Implementation considerations

This can be implemented in a simple way by modifying the implementation of the rclcpp::Time class' comparison operators in the corresponding file: https://github.com/ros2/rclcpp/blob/rolling/rclcpp/src/rclcpp/time.cpp. An example implementation of the feature is provided here: https://github.com/matemat13/rclcpp/tree/zero_time_fix.

A possibly related feature request: #2025.

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.