robot_stream library

All-in-one Flutter umbrella package for robot_stream.

Re-exports robot_stream_core, robot_stream_mjpeg, robot_stream_webrtc, and robot_stream_rosbridge so Flutter apps can add a single dependency for low-latency ROS 2 robot video streaming, telemetry, Nav2 navigation, and teleoperation.

Because this package depends on robot_stream_webrtc (flutter_webrtc) and robot_stream_core (dart:io), it targets Android, iOS, and macOS (not web). For lighter apps or pure-Dart CLI tools, depend on the individual robot_stream_* packages directly.

Classes

BatteryState
Battery telemetry reported by the robot.
LinkClosed
Transport has been disposed and can no longer be used.
LinkConnected
Connected to the robot transport.
LinkConnecting
Actively establishing the initial connection to the robot.
LinkIdle
Initial state before RobotTransport.connect is called.
LinkReconnecting
Connection dropped; waiting retryIn before attempting to reconnect.
LinkRejected
Connection rejected by the robot (HTTP 401/403: missing or invalid token).
LinkState
Connection state of a telemetry and command channel to a robot.
LowLatencyWifi
Controls an Android WIFI_MODE_FULL_LOW_LATENCY WifiLock via the native plugin (RobotStreamWebrtcPlugin.kt); no-op on other platforms.
MjpegFrameDecoder
Splits an MJPEG byte stream (multipart/x-mixed-replace) into individual JPEG images.
MjpegScanner
Synchronous core of MjpegFrameDecoder, exposed for direct testing and chunk-by-chunk decoding.
MjpegSource
HTTP MJPEG VideoSource (for example, ROS web_video_server).
MjpegView
Displays the latest JPEG frame emitted by an MjpegSource.
NamedWaypoint
A named waypoint defined by the robot, sent with RobotTransport.goToWaypoint.
The most recent navigation goal running on or completed by the robot.
A 2D navigation goal.
A handle to an active navigation goal.
Progress feedback reported by the robot during navigation (for example, Nav2 NavigateToPose feedback).
RobotPose
2D pose of a ground robot.
RobotProfile
Application-side profile describing a robot's ROS topics and operational safety limits.
RobotTransport
Telemetry and command transport channel to a robot (for example, rosbridge), kept separate from video streaming.
RobotVideoView
Displays hardware-decoded WebRTC video from a WhepSource via flutter_webrtc.
RosbridgeActionGoal
Handle to an action goal submitted via RosbridgeClient.sendActionGoal.
RosbridgeActionResult
Terminal result of a rosbridge ROS 2 action goal.
RosbridgeClient
Client for the rosbridge v2 JSON-over-WebSocket protocol.
RosbridgeTopics
ROS 2 topic, service, and action names used by RosbridgeTransport.
RosbridgeTransport
RobotTransport implementation over rosbridge v2 WebSockets.
VideoClosed
Stream has been disposed and cannot be reused.
VideoConnecting
Opening the initial connection; no frames have arrived yet.
VideoError
Structured error reported by a VideoSource.
VideoFailed
Unrecoverable error (for example, HTTP 401/403 invalid token or bad topic).
VideoIdle
Initial state before connect has been called.
VideoPlaying
Actively receiving video frames.
VideoReconnecting
Stream disconnected or stalled; retrying after retryIn.
VideoSource
A live video source streaming from a robot (such as WebRTC/WHEP or MJPEG).
VideoState
Connection state of a VideoSource.
VideoStats
Video stream metrics measured over a sampling window (typically 1 second).
WhepAnswer
Result of a WHEP offer POST: the SDP answer and optional session resource URI (from the Location header) used to DELETE the session on teardown.
WhepSignaling
Pure-HTTP WHEP signaling client (draft-ietf-wish-whep).
WhepSource
Receive-only WebRTC VideoSource using WHEP signaling (for example, MediaMTX at http://<host>:8889/<path>/whep).

Enums

Navigation goal state reported by the robot, regardless of who initiated it (app, voice command, or another node).
Final outcome of a navigation goal submitted via RobotTransport.navigateTo.
VideoErrorKind
Classification of a VideoError.

Functions

certFingerprint(List<int> der) → String
Computes the lowercase hex SHA-256 fingerprint (without colons) of a DER-encoded certificate.
mediamtxCredential(String token) → String
Formats a robot token into the Bearer credential expected by MediaMTX internal auth (user:pass → robot_stream:<token>).
mediamtxWhepUri({required String host, String path = 'robot_cam', int port = 8889, bool secure = false}) → Uri
Builds a MediaMTX WHEP endpoint URI, for example http://192.168.1.100:8889/robot_cam/whep.
normalizeFingerprint(String s) → String
Normalizes a SHA-256 fingerprint string to lowercase hex without colons or whitespace.
pinnedHttpClient(String sha256Hex) → HttpClient
Creates a dart:io HttpClient that only trusts certificates matching the SHA-256 fingerprint sha256Hex.
rosbridgeUri({required String host, int port = 9091, bool secure = false}) → Uri
Builds a rosbridge WebSocket URI targeting the robot_stream guard port (ws://<host>:9091 by default, which enforces token auth and audit logging).
webVideoServerUri({required String host, required String topic, int port = 8080, int? quality, int? width, int? height}) → Uri
Builds an HTTP MJPEG stream URI for ROS web_video_server, for example http://<host>:8080/stream?topic=/camera/color/image_raw&type=mjpeg.

Typedefs

RosbridgeConnector = WebSocketChannel Function(Uri uri, Map<String, String> headers)
Function that opens a WebSocketChannel to uri with HTTP headers.

Exceptions / Errors

WhepException
Exception thrown when a WHEP HTTP signaling request fails or returns an invalid response.