Ask Your Question

Subscriber gets no messages

asked 2011-08-05 09:16:45 -0500

Poseidonius gravatar image


I am almost going crazy ... I analyse a bag file and monitor a strange behaviour. When I use the code below I have to comment one of rospy.Subscriber(...) lines. Otherwise the Program gets no message and rxgraph shows no connection. But with only one subscriber (regardless of which) the code works well!

What is wrong in my idea?

Best wishes from Germany Enjoy the weekend


import roslib; roslib.load_manifest('Localization')
import rospy
from std_msgs.msg import Float32

def callback(event, index):
     print index

rospy.Subscriber("/OdoLeft", Float32, callback, 0) # one of them have to be commented
rospy.Subscriber("/OdoRight", Float32, callback, 1)  
edit retag flag offensive close merge delete


Can you add the output of roswtf to your question?
tfoote gravatar imagetfoote ( 2011-08-06 10:29:49 -0500 )edit
Strange - on a Ubuntu PC the code works fine, just my Fedora presents the mentioned behaviour
Poseidonius gravatar imagePoseidonius ( 2011-08-08 06:22:32 -0500 )edit
Strange, indeed. Although I don't use Fedora, I would assume that it is not Fedora itself, but the system setup. Can you check the network setup tfoote posted below even on the local machine?
dornhege gravatar imagedornhege ( 2011-08-08 10:35:18 -0500 )edit
Another test, just to verify: Does this only happen on the bag file? If you do 2x rostopic pub, does everything work OK?
dornhege gravatar imagedornhege ( 2011-08-08 10:36:54 -0500 )edit

5 Answers

Sort by ยป oldest newest most voted

answered 2011-09-02 10:55:01 -0500

kwc gravatar image

no activity in a month, closing

edit flag offensive delete link more

answered 2011-08-05 12:11:55 -0500

dornhege gravatar image

I'm not sure, what's going on, but for me it works. The only thing I added was the #! line, but that doesn't cause this behavior.

I tested it with 2x rostopic pub. Perhaps that is something you should do for comparison as the script seems to work.

edit flag offensive delete link more

answered 2011-08-08 08:32:52 -0500

tfoote gravatar image

Are you running in a multi computer environment? If so can you check your network setup

edit flag offensive delete link more

answered 2011-08-06 20:10:56 -0500

Poseidonius gravatar image

updated 2011-08-06 20:28:17 -0500


according to the question of @tfoote I made a roswtf ... you are right, something is wrong with the Odo Channels. How can I isolate the problem? I am using ros diamond on a Fedora 14 PC, I take a bag file produced on another PC, start "rosbag play" and the small script above.

Thanks for your effort!

Loaded plugin tf.tfwtf
Package: Localization
Static checks summary:

Found 1 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING The following stack.xml file list invalid dependencies:
* /home/eos/workspace/SmartX/stack.xml (image_common appears to be an unnecessary depend)
* /home/eos/workspace/SmartX/stack.xml (robot_model appears to be an unnecessary depend)
* /home/eos/workspace/SmartX/stack.xml (visualization_common appears to be an unnecessary depend)
* /home/eos/workspace/ros/ccny_vision/stack.xml (visualization_common appears to be an unnecessary depend)

Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
... done running graph rules

Online checks summary:

WARNING The following nodes are unexpectedly connected:
* /rosbag->/rosout (/rosout)
* /odomapper->/rosout (/rosout)

Found 4 error(s).

ERROR Communication with [/rosbag] raised an error: 
ERROR Communication with [/odomapper] raised an error: 
ERROR The following nodes should be connected but aren't:
* /rosbag->/odomapper (/OdoRight)
* /rosbag->/odomapper (/OdoLeft)
edit flag offensive delete link more


Next time please edit your question to add more details. Otherwise it looks like an answer.
tfoote gravatar imagetfoote ( 2011-08-08 08:31:32 -0500 )edit

answered 2011-08-08 08:37:22 -0500

Poseidonius gravatar image

The .bag file was recorded in a multi computer environment. Does the origin influences the rosbag replay?

Thanks for your effort

Best wishes

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-08-05 09:16:45 -0500

Seen: 340 times

Last updated: Sep 02 '11