Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly remove subscription from wait_for WaitSet #1106

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/humble-source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ jobs:
ros_distro: humble
ref: humble
ros2_repo_branch: humble
os_name: ubuntu-22.04
1 change: 1 addition & 0 deletions .github/workflows/iron-source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ jobs:
ros_distro: iron
ref: iron
ros2_repo_branch: iron
os_name: ubuntu-22.04
2 changes: 1 addition & 1 deletion .github/workflows/rolling-coverage-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
secrets: inherit
with:
ros_distro: rolling
os_name: ubuntu-22.04
container: ubuntu:24.04
2 changes: 1 addition & 1 deletion .github/workflows/rolling-pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master
with:
ros_distro: rolling
os_name: ubuntu-22.04
container: ubuntu:24.04
1 change: 1 addition & 0 deletions .github/workflows/rolling-source-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ jobs:
ros_distro: rolling
ref: master
ros2_repo_branch: rolling
container: ubuntu:24.04
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "hardware_interface/types/hardware_interface_return_values.hpp"
#include "lifecycle_msgs/msg/state.hpp"
#include "rclcpp/utilities.hpp"
#include "rclcpp/logging.hpp"
#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
#include "test_joint_group_velocity_controller.hpp"

Expand All @@ -37,7 +38,9 @@ rclcpp::WaitResultKind wait_for(rclcpp::SubscriptionBase::SharedPtr subscription
rclcpp::WaitSet wait_set;
wait_set.add_subscription(subscription);
const auto timeout = std::chrono::seconds(10);
return wait_set.wait(timeout).kind();
auto ret = wait_set.wait(timeout).kind();
wait_set.remove_subscription(subscription);
return ret;
}
} // namespace

Expand Down Expand Up @@ -205,9 +208,11 @@ TEST_F(JointGroupVelocityControllerTest, CommandCallbackTest)

// wait for command message to be passed
ASSERT_EQ(wait_for(controller_->joints_command_subscriber_), rclcpp::WaitResultKind::Ready);
RCLCPP_INFO(controller_->get_node()->get_logger(), "message ready to be taken from subscription");

// process callbacks
rclcpp::spin_some(controller_->get_node()->get_node_base_interface());
RCLCPP_INFO(controller_->get_node()->get_logger(), "callback(s) processed");

// update successful
ASSERT_EQ(
Expand Down
Loading