Skip to content
PPHYSICAL AI GUIDESTART HERE →

Field guide

ROS 2 Sensor Bandwidth: Will Cameras and Point Clouds Fit?

Calculate camera and point-cloud payload rates from ROS 2 message strides. Run a per-link budget, avoid compression assumptions and plan meaningful measurements.

By Physical AI Guide Editorial TeamPublished Updated

The short answer

Budget sensor bytes per message, message rate and the actual path across each network link. For raw images use step × height; for point clouds use row_step × height. These data buffers are only part of the traffic, so a payload-only budget that already exceeds the link rate rejects the proposal before any overhead is added.

Consider two hypothetical 1280 by 720 RGB cameras at 30 frames per second, plus a 640 by 480 point cloud with 16 bytes per point at 10 updates per second. If all three cross the same one-gigabit link in the same direction, their tightly packed data buffers alone require 1720.320 megabits per second. They cannot fit at the stated rates, even before message metadata, protocol overhead or other traffic.

This guide supplies a runnable calculation and a measurement worksheet. We executed the arithmetic, not a ROS 2 deployment, camera trial or network benchmark. The configurations and proposed acceptance process are illustrative. No compression performance or robot task outcome is claimed.

Start with the bytes actually carried by the message

The pinned Jazzy sensor_msgs/Image definition defines step as the full row length in bytes, and data as a byte array of size step × rows. It separately supplies image width, height and encoding.

For that data buffer:

image_bytes_per_message = step * height
image_bytes_per_second = image_bytes_per_message * frames_per_second
payload_megabits_per_second = image_bytes_per_second * 8 / 1_000_000

For a tightly packed, three-channel, eight-bit image, an illustrative row length is width × 3. Do not assume every stream uses that layout. A depth image, a different channel representation or row padding changes the count. Read the actual encoding and stride, and check the actual buffer length. Megapixels alone do not specify a byte rate.

The PointCloud2 definition defines point_step as bytes per point, row_step as bytes per row, and data size as row_step × height. Its fields array describes the point layout. An unordered cloud has height one and width equal to the number of points.

Use:

cloud_bytes_per_message = row_step * height
cloud_bytes_per_second = cloud_bytes_per_message * updates_per_second

Do not replace the actual stride with a guess that every point contains only three four-byte coordinates. Additional fields and padding belong in the budget. Our example explicitly assumes a 16-byte point and no row padding; it does not describe every depth camera or lidar.

A one-gigabit proposal that fails before overhead

All figures below are calculated data-buffer rates using decimal units: one MB is 1,000,000 bytes, and one Mbps is 1,000,000 bits per second. These are not measured throughput figures.

Stream Assumed layout and rate Bytes per message Payload Mbps
Camera A 1280 × 720, three bytes per pixel, 30 Hz 2,764,800 663.552
Camera B Same as Camera A 2,764,800 663.552
Point cloud 640 × 480, 16 bytes per point, 10 Hz 4,915,200 393.216
Combined All cross the same directional link Not one combined message 1720.320

Each camera contributes 663.552 Mbps. The pair contributes 1327.104 Mbps; the cloud adds 393.216 Mbps. Their combined rate is 215.040 MB/s.

That is already above a nominal 1000 Mbps link. A QoS setting cannot make these unchanged bytes fit at these unchanged rates. This conclusion is arithmetic, not a claim about any particular network adapter or middleware.

Now suppose the images are genuinely resized to 640 by 360 before crossing that link, still at 30 Hz and three bytes per pixel. The pair’s calculated payload falls to 331.776 Mbps. With the original cloud, the sum becomes 724.992 Mbps.

That alternative passes only the simple payload-versus-line-rate screen. It does not establish adequate operational headroom, acceptable bursts, latency or image quality. If resizing happens only after reception, the upstream link still carries the larger images. If the smaller image loses the detail needed for a grasp or inspection, the network saving does not make it an acceptable design. Check the camera feature and exposure budget before reducing resolution.

Draw a path from each producer to its consumers and mark which data crosses each constrained link. Keep robot-to-server and server-to-robot traffic separate. Also distinguish a sensor’s device connection from the network carrying its processed ROS messages.

Our proposed link worksheet should ask:

  • Where are raw images converted, resized, compressed or turned into clouds?
  • Which representations cross the robot uplink, and which remain on the same computer?
  • Is a remote viewer, recorder or diagnostic subscription active during acceptance?
  • Does the configured transport send separate copies to remote consumers or share delivery? Verify the actual behavior rather than multiplying by subscriber count automatically.
  • What other traffic competes on the same path, including other robots and recordings sent elsewhere?
  • Which link counters and observation points cover each direction?

A cloud derived on the receiving server should not be added to the robot uplink merely because it exists in the ROS graph. Conversely, if the robot publishes both depth images and derived clouds across that uplink, both belong in its budget. A recorder writing on the same host is not automatically a second network copy; a remote recorder may change the path and load.

This is a topology-accounting method, not a guarantee about a particular DDS implementation. Record the transport and configuration that were actually evaluated. The ROS 2 network-failure guide covers the separate questions of QoS matching, delivery and stale-data responses.

Run the stride-aware payload calculation

This standard-library Python 3 example reproduces the budget. It also checks a padded image row so a width-only shortcut cannot silently become the calculation method.

from math import isclose


def payload_mbps(row_bytes, rows, hz, copies=1):
    assert row_bytes > 0 and rows > 0 and hz > 0
    assert isinstance(copies, int) and copies > 0
    return row_bytes * rows * hz * copies * 8 / 1_000_000


# Illustrative layouts, not measurements from a device.
cameras = payload_mbps(1280 * 3, 720, 30, copies=2)
cloud = payload_mbps(640 * 16, 480, 10)
total = cameras + cloud
smaller_cameras = payload_mbps(640 * 3, 360, 30, copies=2)
smaller_total = smaller_cameras + cloud

# One extra 64-byte padding region per image row.
padded_pair = payload_mbps(1280 * 3 + 64, 720, 30, copies=2)
padding_cost = padded_pair - cameras

line_rate_mbps = 1000  # Nominal link rate, not usable payload capacity.
print(f"Raw camera pair: {cameras:.3f} Mbps")
print(f"Point cloud: {cloud:.3f} Mbps")
print(f"Combined raw: {total:.3f} Mbps")
print(f"Above nominal line rate: {total > line_rate_mbps}")
print(f"Smaller-image alternative: {smaller_total:.3f} Mbps")
print(f"Padded-row pair adds: {padding_cost:.4f} Mbps")

assert isclose(cameras, 1327.104)
assert isclose(cloud, 393.216)
assert isclose(total, 1720.320)
assert isclose(smaller_total, 724.992)
assert isclose(padding_cost, 22.1184)
assert total > line_rate_mbps

Here copies=2 represents two explicitly assumed equal camera streams crossing the budgeted link, not an inferred multiplier for two subscribers. For a real cloud, supply its actual row_step and height; for a real image, supply its actual step and height.

The extra row padding adds 22.1184 Mbps to the pair in this hypothetical case. Assertions validate arithmetic only. Passing them does not demonstrate a camera’s supported mode, achieved frame rate or an application’s ability to process the stream.

Compression needs measured sizes and task evidence

The pinned CompressedImage definition supplies a format field and a compressed byte buffer. It does not specify a guaranteed compression ratio. Do not approve a link by dividing the raw-image number by an unsupported fixed factor.

For a representative observation interval, sum the actual encoded buffer bytes and divide by the interval duration. Preserve frame counts and the distribution of encoded sizes, not just one favorable average. Retain the codec, settings, source image layout and scene conditions so the measurement can be reproduced.

This is still a buffer-rate observation, not complete on-wire traffic. Measure encode/decode time and capture-to-use age separately. Validate the decoded images against the actual inspection, localization or manipulation requirement. A reduction in bytes is not evidence that the task still works. Our sensor-timing guide explains why observation age needs an explicit clock model.

What ros2 topic bw can and cannot establish

The pinned Jazzy topics tutorial documents ros2 topic hz and ros2 topic bw. It explicitly warns that both observe reception on the subscriptions created by those commands. Platform resources and QoS can make their results differ from the publisher’s rate or bandwidth.

On an authorized, non-motion test setup, commands using your actual topic names could include:

ros2 topic info /camera/image_raw --verbose
ros2 topic hz /camera/image_raw
ros2 topic bw /camera/image_raw

These are inspection examples, not commands we executed or a measured output transcript. Check command options in your installed distribution. Adding a diagnostic subscription can change the workload, so record where it runs and whether the baseline already included it.

A low receiving rate is not proof of spare network capacity. First distinguish a slow producer, an overloaded observer, QoS effects and actual loss or congestion. Correlate topic observations with interface/link counters and the rate of observations accepted by the real application. Do not label a topic-level bandwidth reading as Ethernet wire utilization or a latency guarantee.

A practical acceptance record

The following is our proposed handoff worksheet, not a ROS standard. Mark unperformed checks NOT TESTED and choose application limits before looking at favorable runs.

Record Evidence to request
Budgeted path Hosts, links, directions, transport configuration and other traffic
Stream layout Message type, encoding or fields, row stride, height and actual buffer length
Production rate Configured rate, produced count, observed count and interval
Payload screen Per-stream byte rate and sum on each link, with units
Encoded alternative Actual buffer-size distribution, codec settings and timing
Link observation Directional traffic counters, observation point and matched workload
Application result Accepted frame rate, observation age, dropped/rejected inputs and task error limits
Headroom and bursts Declared operating margin, justification and simultaneous-load evidence
Ownership Who controls sensor modes, transport, diagnostics and acceptance reruns

Do not treat a universal percentage of line rate as safe utilization. The required margin depends on bursts, competing traffic and the application’s deadlines. A payload calculation can disprove a proposed configuration; approving one requires evidence under representative concurrent load.

Ask the integration partner to reconcile the message budget, observed link traffic and application timing for the same configuration. Keep missing measurements explicit. A camera mode that fits on paper but loses required observations during normal operation has not passed that acceptance process.

Sources and limits

Reviewed November 23, 2026. These are first-party Jazzy source snapshots, not new experimental results. Revision dates are not represented as publication dates of individual message definitions.

  1. ROS 2 Image.msg, common_interfaces revision a941f14bb318d8d904505ed935ccbb97f24a70a4. Source for uncompressed image dimensions, encoding, row length and buffer-size definition.
  2. ROS 2 PointCloud2.msg, same revision. Source for point layout, point and row strides, unordered-cloud dimensions and buffer size.
  3. ROS 2 CompressedImage.msg, same revision. Source for the format field and compressed buffer, not any claimed compression performance.
  4. ROS 2 Jazzy, Understanding topics, documentation revision bb5ba426fe4de413362f605c27074385c83ff9e3. Source for topic inspection commands and the receiving-subscription limitations of rate and bandwidth observations.

The numerical configurations, link-accounting method, executed arithmetic and acceptance worksheet are Physical AI Guide’s analysis. We did not run ROS 2 commands, measure a network, acquire sensor data or establish robot performance. This budget supports an engineering review; it is not safety certification or a validated transport configuration.

Frequently asked questions

How do I calculate a ROS 2 camera stream's bandwidth?

For an uncompressed sensor_msgs Image, multiply step in bytes per row by height and frames per second. Multiply by eight for bits per second. This counts the image data buffer, not the full serialized message, transport overhead or retransmissions. Budget each network link and direction separately.

Does ros2 topic bw measure Ethernet wire utilization?

No. The Jazzy tutorial says the value reflects reception on the subscription created by the command and can differ from publisher bandwidth because of platform resources and QoS. Use it as a topic-level observation alongside link counters, topology and application timing, not as a complete wire-rate measurement.

Can I assume a fixed compression ratio for robot images?

No. The CompressedImage message defines a format and compressed buffer, not a guaranteed reduction. Measure encoded buffer sizes and encode/decode timing under representative conditions, then validate that the decoded images still support the task.