-
Notifications
You must be signed in to change notification settings - Fork 410
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
Some times, callback are not called during a call to Executor::spin_util_future_complete #717
Comments
I looks like you only publish the message once? If so the message might be broadcast before the publisher has been been matched with a subscriber. You can use a service rather than pub/sub if you want to make sure an event driven message is delivered. This thread may be relevant: ros2/ros2#344 |
@borgmanJeremy , I publish the message once, but before publishing it I wait for subscriber to be connected to publisher (thanks to the call to method I think there is a big difference between my ticket and the one you linked. In my issue I am blocking execution of the thread until callback is called thanks to the |
Sorry, I've seen some of the questions about how the executor works and I've been wanting to relpy, but we've been super busy for the last few months. I had decided I would reply to those questions with links to updated documentation after doing some changes that were planned to the executor's architecture, but we ended up pushing that work off until later, so that also contributed to the delay. I'll attempt to look into this issue in a few weeks, if no one else gets to it first. |
Hi, Sometimes I have this output (fail) :
And sometimes I have this output :
|
Ok, I think I found what is the problem, and of course, the problem is not in rclcpp, but in my test... When reading carefully logs in the @1r0b1n0 message, I can see that when test fail, this is because topic filtered is added after we finished waiting for topic dataIn. So the problem is just that we must wait for both connections to be established before continuing !!! Adding the following line in my SetUp function make the test pass every times : ASSERT_FALSE(wait_for_subscriber(testerNode, "dataIn", 1000ms, 5ms));
ASSERT_FALSE(wait_for_subscriber(filterNode, "filtered", 1000ms, 5ms)); |
…os2#717) Signed-off-by: Stephen Brawner <brawner@gmail.com>
Bug report
Required Info:
Steps to reproduce issue
You can try this unit test file :
Expected behavior
I excepect that this test pass every time when I launch it.
Actual behavior
Some times, this test doesn't pass.
When this test doesn't pass it is always because the spin_util_future_complete return a timeout.
ASSERT_EQ(this->executor.spin_until_future_complete(future, std::chrono::seconds(1)), FutureReturnCode::SUCCESS);
When this occurs, I can't read neither the dataIn callback trace, nor the filtered trace. So that looks like the callback of "dataIn" subscription is never called.
Additional information
If I try to rise the timeout in spin_until_future_complete (to 10 seconds), test will also fail.
I also post this "bug" as question on Answers.ros.org because, I am not really sure that is a bug. Maybe I didn't well understood how executors work. But nobody answers there.
You can see that I try to use intraprocess comunication (I passed true as a third agument into my node's constructors). If let the default arguments, behaviour is the same.
The text was updated successfully, but these errors were encountered: