-
Notifications
You must be signed in to change notification settings - Fork 417
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
failed to call wait_for_message
twice for one subscription
#1864
Comments
i do not really understand why this happens. since rclcpp/rclcpp/include/rclcpp/wait_for_message.hpp Lines 55 to 57 in 8afef51
|
in_use_state with true in
wait_set.add_subscription(subscription); for the same subscription without remove_subscription could throw the exception.rclcpp/rclcpp/include/rclcpp/wait_set_template.hpp Lines 151 to 154 in 8afef51
Notice that the destructor of WaitSet( |
@iuhilnehc-ynos i see it, thanks for the explanation. |
Bug report
Required Info:
Steps to reproduce issue
add the following test case in rclcpp/test/rclcpp/test_wait_for_message.cpp
Expected behavior
Test sucessfully
Actual behavior
[ RUN ] TestUtilities.wait_for_message_twice_one_sub
/home/chenlh/Projects/ROS2/ros2-master/src/ros2/rclcpp/rclcpp/test/rclcpp/test_wait_for_message.cpp:102: Failure
Value of: received
Actual: false
Expected: true
[ FAILED ] TestUtilities.wait_for_message_twice_one_sub (20159 ms)
Additional information
I need to add a new test that a subscription with different settings to receive messages from a publisher multiple times, there seems a convenient utility
rclcpp::wait_for_message
to do it. Unfortunately, it failed as follows,What about creating a PR using the following patch and the above test case?
The text was updated successfully, but these errors were encountered: