A Practical Guide for Getting More from Your Wi-Fi
If you’ve ever worked with mobile robots over Wi-Fi, you’ve likely run into this scenario: You’ve set up a robot with a camera, maybe two. You’re out in the field—or even just across the lab—trying to view a live feed while also running navigation, collecting data, or teleoperating. But then, things start to break down. Latency creeps in. Messages are lost. Video stutters. The whole system feels like it’s hanging on by a thread.
Most of the time, the issue boils down to one simple thing: network bandwidth.
Streaming raw video over a wireless connection can easily saturate your network, especially if you’re dealing with high-resolution cameras, multiple streams, or shared Wi-Fi. And in ROS, the default camera setup often does just that—publishing full, uncompressed image messages at full frame rate.
The good news? You can do a lot better with just a few changes, and we have two guides that show you how.
Why Raw Video in ROS is a Problem
Let’s start with the basics. ROS camera drivers typically publish raw uncompressed image data by default, meaning it sends a full array of pixel values for every frame. At a resolution of 1280×720 with 3 bytes per pixel (RGB) at 30 frames per second, that’s already over 660 Mbps of bandwidth per camera, which well surpasses what the vast majority of Wi-Fi networks can even dream to support. Now, throw in some packet loss or interference, and the result is pretty predictable: laggy streams, overloaded topics, or in worst cases, full-on disconnection.
That’s where compression comes in. By compressing image data before it’s sent, you can reduce bandwidth usage dramatically, often without sacrificing much in terms of visual quality or latency.
Camera Compression Options in ROS 2
The Camera Data Compression guide discusses the image_transport framework and the most common compression methods used in ROS 2. Importantly, it shows how to implement the H.264 compression (using FFMPEG), a standard commonly used for network video compression, using the Clearpath ROS 2 packages.
Even if you’re not working with a Clearpath robot, the principles in this guide apply directly to any camera on ROS 2.
Tuning Compression Parameters
Unfortunately, simply enabling compression is often not enough to achieve the level of compression and video quality required for a given application. The default parameters rarely provide enough compression to fit within the available Wi-Fi bandwidth, and in the case of H.264, may introduce a video delay. For these reasons, it is very important to take it one step further and tune the compression settings.
The Video Over Wi-Fi tutorial describes a case study where a Blackfly camera is being set up for use in teleoperation. It discusses evaluating the bandwidth availability, how to calculate the current bandwidth needs, choosing the compression method, and the tuning process itself. The compression settings are tuned to fit the needs of the application, considering a number of different factors such as latency, frame rate, reliability, quality and efficiency.
Final Thoughts
There can be a tendency to blame the network whenever data is lost or video is laggy. But often it is a problem of trying to send an unreasonable amount of data over the network. Never before have there been such small sensors that can provide such vast amounts of data. As roboticists, we have to be increasingly thoughtful about how we allocate our bandwidth and make full use of the tools at hand.
You might be surprised by how much smoother your system can run with just a few well-placed adjustments.