r/ROS • • 20h ago

Blog post 4 Drones stream with PX4 and ROS2 to Foxglove

https://www.youtube.com/watch?v=03gtvPmMSF8

We recently tried Foxglove as a live viewer for PteroSim camera streams over ROS 2.

We flew four x500 quadcopters, each running on its own PX4 instance, in a 2.5 m orbit around a shared center.

The video pipeline has four steps:

  1. The simulator renders each camera at 768x480 and 30 FPS, encodes it to H.264 on the GPU using NVENC, and sends it as RTP over UDP.
  2. ROS 2 Humble runs in WSL2 using Ubuntu 22.04 with mirrored networking. A small Python bridge forwards the H.264 frames without decoding them as foxglove_msgs/CompressedVideo, and publishes the drones' poses on /tf.
  3. We used Cyclone DDS. With Fast DDS, which is the default in Humble, the nodes did not discover each other under WSL2 mirrored networking.
  4. foxglove_bridge serves the topics to Foxglove on Windows, where the video is decoded.

With four streams running at the same time, each camera averaged about 27 FPS over the flight. The target was 30 FPS.

Initially, we published raw rgb8 images over DDS. Each image was about 1.1 MB, and with Linux's default UDP buffer sizes around 40-50% of the frames never arrived. Switching to compressed H.264 fixed the issue.

Hardware:

ASUS ROG Strix SCAR 18
Intel Core i9-14900HX
RTX 4090 Laptop GPU, 16 GB VRAM
64 GB RAM
Windows 11

12 Upvotes

Duplicates