-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ROS2 migration guide replaces spinOnce with spin_some #4959
Comments
@wouter-heerwegh thanks for reporting this. @fujitatomoya I want a quick second opinion, does this sound like a reasonable request? If the answer is yes I can put together a PR. Somewhat related, the spin_all API documentation could use some love and this might warrant a second ticket. |
@kscottz i guess, some semantic for them are different from ROS 1 to ROS 2, but including that i will check to see if the doc or implementation needs to be updated. i will take a look. |
This issue has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/ros-news-for-the-week-of-january-20th-2025/41719/1 |
precisely IMO, the doc section is not well described... i would expect that all ready data in the single entity will be executed. that is the claim from ros2/rclcpp#2655.
I do not think so. https://docs.ros.org/en/diamondback/api/roscpp/html/namespaceros.html#af4afa6f0ad9f903f04a023982a95ff1c says that said, after all, i think migration doc is correct. what do you think? |
@fujitatomoya While it's definitely documented as such, I think the behaviour is slightly different. When I check the implementation of I'll make a small subscriber and publisher node to test the behaviour in ROS1, just to confirm. |
I think the real issue here, as show by this issue and #2655, is that the behavior of Regardless of where we land on this particular problem, we probably want to improve the API documentation and write a guide explaining when to use each variant of |
that definitely helps here 🚀 thanks! |
@fujitatomoya, I did the following tests:
ROS1
|
@wouter-heerwegh thank you very much for confirming this! and based on this result, i agree with you conclusion. there is a couple of things that i need to do,
|
could you take a look at #4966? |
Looks good to me, I guess another issue should be opened to keep track of a more elaborate part of the documentation explaining the differences between the spin methods, right? If some help is needed, I would gladly help out. |
thanks!
i can do that once i confirm the designed behavior. |
I recently stumbled on an issue where I was using
spin_some
in a node that was receiving messages at a higher rate than it was calling thespin_some
function. After a bunch of digging, I found the following issue on rclcpp ros2/rclcpp#2655, which mentions thatspin_some
only processes 1 message of each callback, rather then all work on all callbacks at that time.It seems that
spin_all
functionality more closely resembles thespinOnce
behaviour from ROS1.My code was converted according to the migration guide, so I think it would be best to change the example to use
spin_all
insteadThe text was updated successfully, but these errors were encountered: