Skip to content

robot_stream: low-latency WebRTC video + Nav2/teleop for ROS 2 in Flutter (deadman-protected, open source)

ROS Discourse — Community updates1anhtung_dao

The author released robot_stream, an open-source BSD-3-Clause tool comprising a ROS 2 Humble gateway and Flutter/Dart packages for low-latency WebRTC/WHEP video streaming, telemetry, Nav2 navigation, and deadman-protected teleoperation.

Hi everyone,

I just open-sourced robot_stream (BSD-3-Clause) — an end-to-end ROS 2 Humble gateway + Flutter/Dart package suite for low-latency WebRTC/WHEP robot video streaming, telemetry, Nav2 navigation, and deadman-protected teleoperation.

(A short demo video — Wheeltec R550 on Jetson Orin Nano streaming H.264 over WebRTC/WHEP to an Android phone while driving to a Nav2 waypoint, plus Wi-Fi cutoff triggering the deadman goal cancel — is embedded at the top of the GitHub README linked below.)

Why I built this

While building a mobile teleop app for a ROS 2 robot (Jetson Orin Nano, which has no NVENC hardware encoder), I kept hitting the same practical issues:

  1. MJPEG (web_video_server) is easy to start with, but on 5 GHz Wi-Fi it used ~5.6 Mbps per viewer at 640×480 q50, added ~229 ms glass-to-glass latency, and re-encoded JPEG separately for each viewer (4 viewers dropped raw camera FPS from 29.5 → 18 fps).
  2. Android Wi-Fi power saving quietly batched incoming WebRTC UDP packets, inflating libwebrtc’s receiver jitter buffer to 85–150 ms even on a 2–5 ms LAN. Holding an Android WIFI_MODE_FULL_LOW_LATENCY WifiLock brought it down to 10–20 ms at 30 fps without dropping frames (unlike ForcePlayoutDelay(0, 0)).
  3. rosbridge_server on Humble has no authentication, doesn’t cancel Nav2 goals when a phone drops off Wi-Fi, and with send_action_goals_in_new_thread=False an active Nav2 goal can block a cancel/stop request on the same WebSocket connection.

What’s included

  • Robot side (robot_node/robot_stream_ros, ROS 2 Humble, amd64 & arm64):

    • stream_node + MediaMTX (WHEP): GStreamer x264enc (zerolatency, vbv-buf-capacity=100, sliced-threads=true) → local RTP/UDP → MediaMTX. Single encode for all viewers, auto-matched camera QoS, and on-demand streaming (~1–1.5% CPU when idle on Jetson Orin Nano).
    • deadman_node: per-session heartbeat tracking (1.0 s timeout cancels active Nav2 goals even if another view-only client stays connected) + teleop velocity gate (0.3 s command timeout outputs zero /cmd_vel + velocity clamping).
    • rosbridge_guard: wraps local rosbridge_server (127.0.0.1:9090) on :9091 with per-robot bearer token auth, optional self-signed TLS, and rotating JSON-line command audit logs.
    • waypoints_node: serves named waypoints from YAML over /robot_stream/waypoints.
    • 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).
  • Flutter / Dart side (published on pub.dev):

    • All-in-one umbrella package: robot_stream (flutter pub add robot_stream)
    • Or modular packages if you want a smaller app / pure-Dart CLI:
      • robot_stream_core — pure-Dart models, interfaces, SHA-256 TLS certificate pinning
      • robot_stream_webrtc — WHEP signaling + WhepSource + RobotVideoView + Android low-latency WifiLock plugin (iOS/macOS stubs)
      • robot_stream_mjpeg — MJPEG fallback with JPEG marker framing and stall detection
      • robot_stream_rosbridge — pure-Dart rosbridge v2 client with map+odom SE(2) pose fusion, non-blocking STOP over a dedicated action WebSocket, Nav2 goals, teleop, and heartbeats

Measured performance (LAN, 5 GHz Wi-Fi, 640×480 camera)

Stream / Client FPS Bandwidth Latency / Jitter Buffer
WebRTC/WHEP (RTP + vbv100/sliced) → Mac Chrome ~30 fps ~1.3–1.5 Mbps Driver header.stamp → display: p50 66–69 ms / p95 93 ms, jitter buffer 11 ms
WebRTC/WHEP → Samsung A33 (Android 15, WifiLock on) 29–30 fps ~1.3–1.5 Mbps header.stamp → decoded: ~33–43 ms p50 (~110–120 ms est. glass-to-glass), jitter buffer 10–20 ms (vs. 85–150 ms without WifiLock)
WebRTC/WHEP → iPad 5th gen (iPadOS 16.7) 25–29 fps ~1.3–1.5 Mbps header.stamp → decoded: ~41 ms p50, jitter buffer p50 17 ms / p95 19 ms
MJPEG (web_video_server, raw 640×480 q50) 28–30 fps 5.6 Mbps Glass-to-glass (Mac Chrome): median 229 ms

In alternating A/B load tests on Jetson Orin Nano with YOLO11m running on GPU, CPU H.264 streaming did not slow YOLO down. In the GitHub README demo (robot driving to a Nav2 waypoint), the deadman canceled the goal ~0.7 s after the phone’s Wi-Fi was cut (1.0 s heartbeat timeout, robot at 0.20 m/s) and the robot coasted ~20–25 cm. During hold-to-drive teleop, the velocity gate also zeroes /cmd_vel after 0.3 s without commands.

Links

Current limitations (Free edition)

  • LAN / VPN only out of the box — do not port-forward :8889 or :9091 to the public internet (use WireGuard/Tailscale or an authenticated TURN relay for remote access).
  • Token auth only covers the robot_stream endpoints (:9091, WHEP). DDS traffic on the LAN is not protected: any machine with ROS 2 on the same network can still publish /cmd_vel (use ROS_LOCALHOST_ONLY=1 or SROS2). A vendor rosbridge_server already exposed on :9090 also stays open.
  • Without tls:=true, the bearer token travels in cleartext on Wi-Fi.
  • No 2D OccupancyGrid map / tap-to-goal widget yet (currently supports named waypoints, forward steps, and hold-to-drive teleop).
  • Software deadman is an added safety layer, not a replacement for a hardware E-stop.

I’d really appreciate feedback from folks running ROS 2 mobile / tablet teleop in practice:

  1. What client stack are you using today for operator UIs (web app, Flutter, Qt, Foxglove)?
  2. What’s the biggest gap you’d want next: remote access over 4G/TURN, multi-camera, 2D Nav2 map + tap-to-goal, security (SROS2 / per-user auth), or hardware encoder presets (Jetson NVENC / VAAPI)?

Thanks for taking a look — happy to answer questions or hear bug reports on GitHub Issues / Discussions!

Source notes

  1. robot_stream: low-latency WebRTC video + Nav2/teleop for ROS 2 in Flutter (deadman-protected, open source)↩
Source evidence

Reported by the source; not independently verified.

unique_elapsed_hours
≈0.7[3]Reported trials
aggregate_sensor_hours
0.3[4]Reported trials
unique_elapsed_hours
0.3[4]Reported trials
unique_elapsed_hours
1–1.5[4]Reported trials
aggregate_sensor_hours
1–1.5[4]Reported trials
unique_elapsed_hours
≈229[5]Reported trials
unique_elapsed_hours
≈5.6[5]Reported trials
aggregate_sensor_hours
1.3–1.5[6]Reported trials
code
Reported pending[7]
  1. Hi everyone, I just open-sourced robot_stream (BSD-3-Clause) — an end-to-end ROS 2 Humble gateway + Flutter/Dart package suite for low-latency WebRTC/WHEP robot video streaming, telemetry, Nav2 navigation, and deadman-protected teleoperation. (A short demo video — Wheeltec R550 on Jetson Orin Nano streaming H.264 over WebRTC/WHEP to an Android phone while driving to a Nav2 waypoint, plus Wi-Fi cutoff triggering the d
    Exact source
  2. .6 Mbps Glass-to-glass (Mac Chrome): median 229 ms In alternating A/B load tests on Jetson Orin Nano with YOLO11m running on GPU, CPU H.264 streaming did not slow YOLO down. In the GitHub README demo (robot driving to a Nav2 waypoint), the deadman canceled the goal ~0.7 s after the phone’s Wi-Fi was cut (1.0 s heartbeat timeout, robot at 0.20 m/s) and the robot coasted ~20–25 cm. During hold-to-drive teleop, the velo
    Exact source↩
  3. UDP → MediaMTX. Single encode for all viewers, auto-matched camera QoS, and on-demand streaming (~1–1.5% CPU when idle on Jetson Orin Nano). deadman_node : per-session heartbeat tracking ( 1.0 s timeout cancels active Nav2 goals even if another view-only client stays connected) + teleop velocity gate ( 0.3 s command timeout outputs zero /cmd_vel + velocity clamping). rosbridge_guard : wraps local rosbridge_server ( 1
    Exact source↩
  4. eadman goal cancel — is embedded at the top of the GitHub README linked below.) Why I built this While building a mobile teleop app for a ROS 2 robot (Jetson Orin Nano, which has no NVENC hardware encoder), I kept hitting the same practical issues: MJPEG ( web_video_server ) is easy to start with, but on 5 GHz Wi-Fi it used ~5.6 Mbps per viewer at 640×480 q50, added ~229 ms glass-to-glass latency, and re-encoded JPEG
    Exact source↩
  5. ction robot_stream_rosbridge — pure-Dart rosbridge v2 client with map+odom SE(2) pose fusion, non-blocking STOP over a dedicated action WebSocket, Nav2 goals, teleop, and heartbeats Measured performance (LAN, 5 GHz Wi-Fi, 640×480 camera) Stream / Client FPS Bandwidth Latency / Jitter Buffer WebRTC/WHEP ( RTP + vbv100/sliced ) → Mac Chrome ~30 fps ~1.3–1.5 Mbps Driver header.stamp → display: p50 66–69 ms / p95 93 ms ,
    Exact source↩
  6. city gate also zeroes /cmd_vel after 0.3 s without commands. Links GitHub (code, robot_node/README.md setup guide, reference Flutter app, demo video): GitHub - robot-stream/robot_stream: Low-latency ROS 2 robot video streaming (WebRTC/WHEP & MJPEG), telemetry, Nav2 navigation, and deadman teleop for Flutter & Dart. · GitHub pub.dev ( robot_stream umbrella + sub-packages): robot_stream | Flutter package Current limita
    Exact source↩

Automatically extracted; no manual editorial approval recorded.

Article details
Signal

The author released an open-source ROS 2 Humble gateway and Flutter package suite designed to address specific latency and safety issues in mobile teleoperation, achieving ~1.3–1.5 Mbps bandwidth and 66–69 ms driver-to-display latency on LAN while implementing deadman protection that cancels navigation goals within 1.0 seconds of connection loss.

Timezone · UTC

Article dates follow your selected timezone. Briefing editions use Hong Kong time (UTC+8).