Optionalcompression?: stringThe type of compression to use, like 'png', 'cbor', or 'cbor-raw'.
Optionallatch?: booleanLatch the topic when publishing.
The message type, like 'std_msgs/String'.
The topic name, like '/cmd_vel'.
Optionalqueue_length?: numberThe queue length at bridge side used when subscribing.
Optionalqueue_size?: numberThe queue created at bridge side for re-publishing webtopics.
Optionalreconnect_on_close?: booleanThe flag to enable resubscription and readvertisement on close event.
The ROSLIB.Ros connection handle.
Optionalthrottle_rate?: numberThe rate (in ms in between messages) at which to throttle the topics.
OptionaladvertiseStaticprefixedRegister as a publisher for the topic.
Calls each of the listeners registered for a given event.
Return an array listing the events for which the emitter has registered listeners.
Retrieves list of publishers for this topic.
Function with the following params:
OptionalfailedCallback: (error: string) => void = console.errorThe callback function when the service call failed.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Add a listener for a given event.
Add a one-time listener for a given event.
Remove all listeners, or those of the specified event.
Optionalevent: "message" | "warning" | "unadvertise" | "unsubscribe"Remove the listeners of a given event.
Every time a message is published for the given topic, the callback will be called with the message object.
Function with the following params:
Unregister as a publisher for the topic.
Unregister as a subscriber for the topic. Unsubscribing will stop and remove all subscribe callbacks. To remove a callback, you must explicitly pass the callback function in.
Optionalcallback: (...args: any[]) => voidThe callback to unregister, if provided and other listeners are registered the topic won't unsubscribe, just stop emitting to the passed listener.
Publish and/or subscribe to a topic in ROS.
Emits the following events: