r/ROS • u/TungDA87 • 16h ago
Project Open-sourced robot_stream: ~30 fps WebRTC/WHEP video + Nav2 deadman cutoff on Wi-Fi drop (ROS 2 Humble + Flutter)
Repo (BSD-3-Clause): https://github.com/robot-stream/robot_stream
Flutter/Dart packages on pub.dev: https://pub.dev/packages/robot_stream
I built robot_stream for a Jetson Orin Nano robot (no NVENC hardware encoder) running ROS 2 Humble after running into three practical issues with standard setups:
• MJPEG (web_video_server) used ~5.6 Mbps per viewer at 640×480 q50 (~229 ms median latency) and re-encoded per viewer (4 viewers dropped raw camera FPS from 29.5 → 18 fps). Switching to a single GStreamer x264enc (zerolatency, vbv-buf-capacity=100, sliced-threads=true) → MediaMTX (WHEP) stream brought it to ~30 fps / 1.3–1.5 Mbps, ~1–1.5% CPU when idle on Jetson Orin Nano, and didn't slow down YOLO11m running on GPU in A/B tests.
• Android Wi-Fi power saving quietly batched incoming UDP packets and inflated WebRTC's receiver jitter buffer to 85–150 ms on a 2–5 ms LAN. Holding an Android WIFI_MODE_FULL_LOW_LATENCY WifiLock dropped it to 10–20 ms without dropping frames.
• Deadman & non-blocking STOP: In the video (robot driving to a Nav2 waypoint at 0.20 m/s), cutting the phone's Wi-Fi caused deadman_node to cancel the Nav2 goal in ~0.7 s (1.0 s heartbeat timeout; robot coasted ~20–25 cm). During hold-to-drive teleop, the velocity gate also zeroes /cmd_vel after 0.3 s without commands.
Robot setup: includes a nav2_standard profile (tested on a simulated TurtleBot3 fake node + Nav2/AMCL) and a one-command setup script (bash robot_node/scripts/install_robot.sh, amd64 & arm64).
Limitations to keep in mind: LAN/VPN only out of the box, token auth only covers robot_stream endpoints (:9091, WHEP — use ROS_LOCALHOST_ONLY=1 or SROS2 to protect LAN DDS, and pass tls:=true so the token isn't sent in cleartext on Wi-Fi), no 2D OccupancyGrid tap-to-goal widget yet, and software deadman doesn't replace a hardware E-stop.
Curious what operator UI stack folks here use on phones/tablets, and what you'd want most next (4G/TURN remote access, 2D Nav2 map + tap-to-goal, multi-camera, SROS2/per-user auth, or NVENC/VAAPI presets)?