Make Rate to select the clock to work with#2123
Merged
clalancette merged 18 commits intoros2:rollingfrom Aug 31, 2023
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the continue of [#1373] discussion and related to the ros-navigation/navigation2#3325 issue in Nav2
The initial idea is to make
rclcpp::Rateto work with ROS-time (currently it works only with system and steady times).What was made:
rclcpp::Clockpointer to therclcpp::Rateconstructor to allow developer to specify the clock to work with (by-default it is stillRCL_SYSTEM_TIMEif no clock is specified)rclcpp::ROSRaterate class, respective to ROS-timeCurrent implementation points:
rclcpp::GenericRate-> torclcpp::Rateand gave it the default clock to work withrclcpp::Rateandrclcpp::WallRateAPI remaining to be untouched as much as possiblerclcpp::Durationinstead ofstd::chrono::nanosecondsin durations andRate::get_type()routine instead of previously usedRate::is_steady()rclcpp::ROSRateclass that working with ROS time