Time: Enable operators with different clock sources if one of the times is zero.
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.