ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

rosjava publisher and subscriber in the same node

asked 2012-05-28 19:31:38 -0600

jpiramirez gravatar image

updated 2012-05-30 16:30:57 -0600

If I take a single node (a class that extends AbstractNodeMain) and I include both publishers and a subscriber, the subscriber does not seem to receive any information that I publish to its topic with rostopic.

I was trying to merge both the Listener and Talker examples into a single entity that publishes using the executeCancellableLoop and subscribes to a topic with the addMessageListener method. My goal is to write a robot driver that publishes sensor data at the same time that it listens for movement commands. Can this be done?

If I avoid adding the subscriber the publisher works fine, and viceversa. If I add both things, the publisher works fine but the subscriber doesn't read any data, although the topic appears in the output of rostopic list.

I am using ROS Fuerte with the Python roscore.

edit retag flag offensive close merge delete

Comments

Could you share some code?

damonkohler gravatar image damonkohler  ( 2012-05-29 07:10:06 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-05-30 16:33:24 -0600

jpiramirez gravatar image

I moved my development from an x86 machine to a 64-bit one, running Ubuntu Precise and ROS Fuerte. My logging messages inside the subscriber started showing up on the rxconsole, so this is solved.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-05-28 19:31:38 -0600

Seen: 297 times

Last updated: May 30 '12