Replace deprecated rclcpp::spin_some() (backport #541) #542
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.
Overview
This PR replaces deprecated rclcpp::spin_some(...) calls in control_toolbox/test/pid_ros_parameters_tests.cpp with a rclcpp::executors::SingleThreadedExecutor, as suggested in #488.
What changed
Files changed are:
In this PR we update control_toolbox/control_toolbox/test/pid_ros_parameters_tests.cpp so that the two tests which were using the deprecated rclcpp::spin_some(...) now create a rclcpp::executors::SingleThreadedExecutor, add the test node to it once, and call executor.spin_some() instead. This applies to TEST(PidParametersTest, SetParametersTest) and to TEST(PidParametersTest, SetBadParametersTest), where we replaced all the previous rclcpp::spin_some(...) calls with the executor-based version to match the current ROS 2 recommendation and to remove the deprecation warning.
Notes for Reviewer
I am very open to feedback and am happy to make any changes that are requested.
This is an automatic backport of pull request #541 done by Mergify.