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

How to implement the "pipeline pattern" in ROS?

asked 2014-05-29 10:50:33 -0500

foopeter gravatar image

updated 2014-05-29 10:54:11 -0500

Hi,

as far as I understand in ROS the connections between nodes are implicitely given by topic names. So for example node A provides "camera_image", and node B subscribes to "camera_image", and provides "edge_detections". Now, A and B are connected. The names are hard-coded in the nodes source files.

But what if I want to install a node C between A and B, which takes "camera_image", provides "black_and_white_image"? Node B now should no longer subscribe to "camera_image", but to "black_and_white_image".

Of course I don't want to change the source of B. Should I pass the topic name as command line argument?

What is my fundamental misunderstanding here?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
5

answered 2014-05-29 11:03:35 -0500

ahendrix gravatar image

The default topic names are coded into the nodes in question, but they can be changed at runtime through remapping arguments.

In your example, you would remap the input topic of node B to black_and_white_image, like:

rosrun pkg_B B_node camera_image:=black_and_white_image

Note that the topic type is also hardcoded, and cannot be changed at runtime unless the node explicitly supports it.

edit flag offensive delete link more

Comments

1

Also, you can conveniently remap in launch files: http://wiki.ros.org/roslaunch/XML/remap

demmeln gravatar image demmeln  ( 2014-05-29 11:35:58 -0500 )edit

Thank you, this makes it very clear!

foopeter gravatar image foopeter  ( 2014-06-02 00:57:04 -0500 )edit

Question Tools

Stats

Asked: 2014-05-29 10:50:33 -0500

Seen: 184 times

Last updated: May 29 '14