-
Notifications
You must be signed in to change notification settings - Fork 522
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Feature request
I wonder if rclcpp could support add/minus time with msg::Time on the left as caller.
In the current delivery,
std_msgs::msg::Header header;
header.stamp = rclcpp::Duration::from_seconds(1) + header.stamp; // OK, unintuitive
header.stamp = rclcpp::Time(header.stamp) + rclcpp::Duration::from_seconds(1); // OK, with conversion and implicit conversion
header.stamp = header.stamp + rclcpp::Duration::from_seconds(1); // CE
header.stamp += rclcpp::Duration::from_seconds(1); // CEIt is more intuitive for the user to choose the third (furthermore, fourth) option instead of the first two.
I think the operators +, -, +=, -= can be implemented in duration.hpp and duration.cpp without any backward incompatiblity.
Furthermore, aside from rclcpp::Time containing a clock, rclcpp::Duration only contains nanoseconds which makes this task simpler.
Also in a higher level view, "a time" can always add "a duration" and conclude another "time."
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed