problem with roscore subscription and publishing
Hi
Im having a small problem with my roscore. What happens is while running my code, after a while i publish flags for another program and the flags are never subscribed. Basically this is what happens. I have 2 nodes A and B. A subscribes to a topic "example" and B publishes data into in at around 20Hz. If i start B and then start A its able to subscribe. But if i start A and then start B nothing happens. Bascally what ive found is that if you subscribe to something and then publish, the subscriber will not recieve the data. But if i were publishing and then subscribe, then ill get the data. I know that this is not the problem because ive verified it using rostopic echo and rostopic pub. I echo and publish data, nothing is recieved but if i publish and echo i see the data on the terminal. BTW restarting roscore resolves this issue. The worst part of this is that it also happens when i run the code. Can someone help me out. Im using ros electric on ubuntu 11.10
After the error starts there are 2 cases (only roscore running so far, closed the rest)
Case 1
a. Open a new terminal and type "rostopic pub /stat geometry_msgs/Point -r 20 -- 0 1 0
b. Open another terminal and type "rostopic echo /stat"
In this case i will get the desired output during echo
Case 2
a. Open another terminal and type "rostopic echo /stat"
b. Open a new terminal and type "rostopic pub /stat geometry_msgs/Point -r 20 -- 0 1 0
In this case i do not get any output on the echo
Please tell me if i have made my problem clear
Please edit your question, adding the exact sequence of
rostopic
commands that demonstrates this failure.