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

One big subscriber vs. multiple small subscribers?

asked 2016-01-11 03:18:00 -0500

gliese581gg gravatar image

updated 2016-01-11 10:18:00 -0500

lucasw gravatar image

I'm using rospy.

I have several nodes that need camera image and point cloud.

each of them needs to get the rgb image and point cloud in real time.

I'm thinking about 2 structures

  1. Create one node that subscribes image and overwrites them into jpg file. And Create another node that subscribes point cloud and overwrites them into psd file. Nodes open files

  2. Put 2 subscribers to every nodes.

which is better(speed, synchronization)?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2016-01-11 10:27:08 -0500

updated 2016-01-11 10:29:13 -0500

If you're worried about the overhead of multiple subscribers for high bandwidth/frequency topics like images and pointclouds, what you want is probably nodelets. From the wiki page:

Nodelets are designed to provide a way to run multiple algorithms on a single machine, in a single process, without incurring copy costs when passing messages intraprocess.

However, it has been said that "premature optimization is the root of all evil." I would recommend that you first try having your nodes subscribe independently as normal and see if you actually need to do anything fancier.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-01-11 03:14:01 -0500

Seen: 394 times

Last updated: Jan 11 '16