Topic class

Wrapper to interact with ROS topics.


Topic({required Ros ros, required String name, required String type, String compression = 'none', int throttleRate = 0, bool latch = false, int queueSize = 100, int queueLength = 0, bool reconnectOnClose = true})


advertiseId String?
Advertiser ID provided by ros.
read / write
compression String
The type of compression to use, like 'png' or 'cbor'.
read / write
hashCode int
The hash code for this object.
isAdvertised bool
Checks whether or not the topic is currently advertising.
latch bool
Latch the topic when publishing.
read / write
name String
Name of the topic.
read / write
publishId String
Publisher ID provided by ros.
read / write
queueLength int
The queue length at the bridge side used when subscribing.
read / write
queueSize int
The queue created at the bridge side for republishing topics.
read / write
reconnectOnClose bool
Flag to enable resubscription and readvertisement on a ROS connection close event.
read / write
ros Ros
The ROS connection.
read / write
runtimeType Type
A representation of the runtime type of the object.
subscribeId String?
Subscription ID provided by ros.
read / write
subscription Stream<Map<String, dynamic>>?
Stream subscribers to the topic can listen to.
read / write
throttleRate int
The rate (in ms between messages) at which to throttle the topic.
read / write
type String
Message type the topic uses.
read / write


Advertise the topic.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
publish(dynamic message) Future<void>
Publish a message to the topic.
safeSend(Request message) Future<void>
Safely send a message to ROS.
subscribe(SubscribeHandler subscribeHandler) Future<void>
toString() String
A string representation of this object.
unadvertise() Future<void>
Stop advertising the topic.
unsubscribe() Future<void>
Unsubscribe from the topic.
watchForClose() Future<void>
Wait for the connection to close and then reset advertising variables.


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