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

Revision history [back]

click to hide/show revision 1
initial version

This mostly depends on how your sensors are hooked up to your computer.

The general rule of thumb for ROS nodes that interface with hardware is to have one ROS node for each unique interface, usually because the operating system only allows a single process to access that resource. So for example if you have a single serial port or USB device, you'll probably want a single process, but if you have sensors on a network or one sensor per serial port, it's usually easier to run one node for each device.

If possible, it's generally much easier to write a node that handles a single sensor.

As for how to choose topics, I've seen systems that publish one topic per sensor, and systems that combine data from multiple sensors (of the same type) on a single topic. In either case, it's important to set the correct frame_id on each message so that the subscriber knows the correct TF frame for that sensor data. Most subscribers (such as navigation and move_base) expect one topic per sensor, so I recommend that unless you have a custom system.