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

Question about topics

asked 2015-02-12 07:32:09 -0500

pexison gravatar image

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.

2) 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.

3) What could be happening?

Thanks beforehand!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-02-12 12:02:12 -0500

Erwan R. gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-02-12 07:32:09 -0500

Seen: 148 times

Last updated: Feb 12 '15