Allow rclcpp::Time::max()
to support other clock types than RCL_SYSTEM_TIME
.
#2348
Labels
enhancement
New feature or request
As of yet,
rclcpp::Time::max()
calls theTime()
constructor without specified value forrcl_clock_type_t
:rclcpp/rclcpp/src/rclcpp/time.cpp
Lines 278 to 282 in fff009a
Hence,
rclcpp::Time::max()
returns aTime
value with clock typeRCL_SYSTEM_TIME
:rclcpp/rclcpp/include/rclcpp/time.hpp
Line 46 in fff009a
This means that you can't compare time values of type
RCL_ROS_TIME
torclcpp::Time::max()
.I propose to change the
max()
implementation as follows:This is backwards-compatible with the current implementation, yet allows to specify
RCL_ROS_TIME
if needed, e.g.:if( reported_time_ < rclcpp::Time::max(RCL_ROS_TIME) { [...] }
The text was updated successfully, but these errors were encountered: