RosbridgeTransport class

RobotTransport implementation over rosbridge v2 WebSockets.

Emits fused map poses at odometry rate by composing the latest map pose with the incremental odometry displacement since that anchor. Before a map pose arrives, raw odometry poses are emitted with their original frameId.

Implemented types

Constructors

RosbridgeTransport({required String robotId, RosbridgeTopics topics = const RosbridgeTopics(), Duration poseThrottle = const Duration(milliseconds: 100), Duration heartbeatInterval = const Duration(milliseconds: 200), Duration driveInterval = const Duration(milliseconds: 100), RosbridgeClient? client, RosbridgeClient? actionClient, HttpClient? httpClient})
Creates a RosbridgeTransport for robotId with topic mapping topics, throttling and safety intervals, and optional custom clients or TLS httpClient.

Properties

battery → Stream<BatteryState>
Stream of battery telemetry updates.
latefinal
currentBattery → BatteryState?
Latest known battery state, or null if none received yet.
no setteroverride
currentDeadman → String?
Current deadman state, or null when disconnected or when deadman_node is not running.
no setter
Most recent connection state.
no setteroverride
currentNavActivity → NavActivity?
Most recent navigation goal activity on the robot (including goals not sent by this app), or null if unknown.
no setteroverride
currentNavMode → String?
Latest vendor-specific navigation mode, or null if none received.
no setter
currentPose → RobotPose?
Latest known robot pose, typically in the map frame.
no setteroverride
currentWaypoints → List<NamedWaypoint>?
Latest list of robot-defined named waypoints, or null if not received.
no setteroverride
deadman → Stream<String>
Stream of robot deadman states (idle, armed, tripped).
latefinal
driveInterval → Duration
Republish interval for active teleoperation velocity commands.
final
hashCode → int
The hash code for this object.
no setterinherited
heartbeatInterval → Duration
Interval for publishing heartbeats to robot-side deadman_node.
final
lastStopAck ↔ Future<bool?>?
Acknowledgement future from the most recent stop call: true if Nav2 returned ERROR_NONE, false if rejected, or null if no reply arrived.
getter/setter pair
Stream of connection state transitions.
no setteroverride
Emits whenever a goal starts or changes state.
latefinal
Stream of vendor-specific navigation modes (when RosbridgeTopics.navModeTopic is configured).
latefinal
pose → Stream<RobotPose>
Stream of robot pose updates.
latefinal
poseThrottle → Duration
Minimum interval between odometry updates requested from rosbridge.
final
robotId → String
Identifier of the robot this transport communicates with.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sessionId → String
Random 8-hex-character session ID for this transport instance, used by deadman_node to distinguish the active controller from passive viewers.
final
topics → RosbridgeTopics
Configured ROS 2 topic, service, and action names.
final
waypoints → Stream<List<NamedWaypoint>>
Stream of updated waypoint lists published by the robot.
latefinal

Methods

connect(Uri endpoint, {String? token}) → Future<void>
Connects to the robot transport at endpoint with an optional bearer token.
override
dispose() → Future<void>
Closes connections and releases all resources.
override
drive(double linear, double angular) → bool
Sends a manual teleoperation velocity command.
override
goToWaypoint(String name) → bool
Commands the robot to navigate to a robot-defined waypoint by name.
override
Sends a 2D navigation goal (for example, Nav2 NavigateToPose).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stop() → bool
Stops all active navigation and manual motion.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited