-
Notifications
You must be signed in to change notification settings - Fork 75
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
Controlling message loops without spinOnce()
#156
Comments
Hi, |
This is because everything is running in parallel, like in You can block and synchronize threads to your liking - it will not cause anything outside of the subscriber handler to grind to a halt. The only thing that will happen is that if the buffer of messages goes over the |
A problem I commonly have in
rospy
is the lack of aspinOnce()
equivalent. I often write code that interfaces ROS systems with other things, and that code needs to drive the event loop on its own, something like this pseudocode:Or:
But this doesn't actually seem to work the way that
roscpp::spinOnce()
does. In the first case, as far as I can tell it's possible for my message to never get published, or get published at weird places, and in general there doesn't seem to be a way to tell ROS to just flush its outgoing queue and get on with life. In the second case, it seems to work until I ctrl-C the program, and then the interrupt gets eaten and the program never stops running until I hard kill it -- just like rospy.Plz halp? All I want is to be able to sensibly control my message loops and tell my program when to actually move data around. I was hoping that Rust would do a better job of this than Python, and so far that's not been the case. (Though otherwise I'm real impressed with how well things work, I have to say that
rosrust_msg
is pure insanity and I love it.)The text was updated successfully, but these errors were encountered: