class

Subscription()

- Class representing a ROS 2 Subscription

Members

member

events

Get the event handlers for this subscription.
Source:
member

events

Set the event handlers for this subscription.
Source:
member

isRaw :boolean

Type:
  • boolean
Source:
member

publisherCount

Get the number of publishers to this subscription.
Source:
member

topic :string

Type:
  • string
Source:

Methods

function

clearContentFilter() → {boolean}

Clear the current content-filter. No filtering is to be applied.
Source:
Returns:
- True if successful; false otherwise
Type boolean
function

hasContentFilter() → {boolean}

Test if the RMW supports content-filtered topics and that this subscription has an active wellformed content-filter.
Source:
Returns:
True if content-filtering will be applied; otherwise false.
Type boolean
function

setContentFilter(contentFilter) → {boolean}

If the RMW supports content-filtered topics set this subscription's content-filter.
Parameters:
Name Type Description
contentFilter object The content-filter description.
Properties
Name Type Attributes Description
expression string Specifies the criteria to select messages of interest. It is similar to the WHERE part of an SQL clause. Clear the current contentFilter if the expression is undefined or an empty string.
parameters Array.<object> <optional>
Array of objects that give values to the ‘parameters’ (i.e., "%n" tokens) in the filter_expression. The number of supplied parameters must fit with the requested values in the filter_expression (i.e., the number of %n tokens). default: undefined.
Source:
See:
Returns:
- True if successful; false otherwise
Type boolean