Publisher sleeping forever [closed]
Hi,
I'm just starting to learn ROS, and I'm following the Publisher/Subscriber tutorial.
For some reason, my publisher outputs the message only once: "[ INFO] [1368121934.629754145]: hello world 0." However, If I comment out loop_rate.sleep() from talker.cpp, then I get the expected publisher/subscriber behavior. Why is this happening?
I'm using Groovy and Ubuntu 13.04. I assume my problem could be caused by my version of Ubuntu, but this is the first issue I've encountered so far (I've used turtlesim, ros stage, rviz, etc).
Thanks!
A code snippet would be helpful
I just copy pasted the tutorial: http://www.ros.org/wiki/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29
talker.cpp should indeed output "hello world" over and over again. there could be some issue with packaging on 13.04, but if this basic program does not work...that would mean a lot of stuff on top of it would be broken. I was also potentially thinking it might be a log level issue with rosconsole.
Thanks for your reply. I guess I might have to install an older Ubuntu version then.
@Zayin I suggest that you look a little closer at the code snippet. And figure out how to reproduce the error. There are ways you could get this such as having the use_sim_time parameter set.
I have meet the same problem. I also ran talk.cpp in the tutorial. What I get is that: 1. If I run roscore first, and then rosrun -- talker. I can continuous get hello output 2. If I ran it through roslaunch , I can only see "hello" once. It will sleep forever
Maybe /use_sim_time is active but no bag is played? This would mean that time does not go forward and hence the sleep would never expire.