Rosanswers logo

Hello, I just want to clarify some questions about the ros topics using a turtlebot.

If there is a node foo and this node use advertise with a topic bar and after using publish, the information will be sent like foo -> bar. The message is baz and is an stadart message type from ROS.

When bar recieve the message, bar doesnt respond. The questions are:

  1. I have to connect only foo -> bar or make something bidirectional foo <-> bar?

For example in the beginner tutorials is the teleop keyboard working good (based on the bringup minimal), but when I try to make a node and publish to the same topic like the keyboard teleop, there is no response from the robot.

  1. Where i can find the raw code of the turtlebot_teleop?

I made an echo an the messages are being published good, my subcriptions are the same that the teleop via keyboard to.

  1. What could be happening?

Thanks beforehand!

Originally posted by pexison on ROS Answers with karma: 82 on 2015-02-12

Post score: 0


1 Answer 1


Rosanswers logo

If your node "foo" is publishing on topic "bar", having a "rostopic echo bar" should show what data you are publishing from "foo". If you want two nodes to have a bidirectional connection, you have to connect "node1" to "node2" through topic "bar1" and then "node2" to "node1" through "bar2". Think of topics like input or output of nodes. input with the same name as output will communicate. In the node that have to listen to a certain topic, you have to "subscribe" to this topic. If you want a node to send information from "bar1" output topic to another node with "bar3" input topic, you have to remap to input from the second node to connect to "bar1".

You can do "rosnode info turtlebot_teleop" or "rostopic llist" when the nodes are running to know which topics are available.

Originally posted by Erwan R. with karma: 697 on 2015-02-12

This answer was ACCEPTED on the original site

Post score: 1


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.