Class TopicBridgeOptions

Class Documentation

class TopicBridgeOptions

Options for bridged topics.

Public Types

enum class AutoRemove

Values:

enumerator OnNoPublisher
enumerator OnNoSubscription
enumerator OnNoPublisherOrSubscription
enumerator Disabled

Public Functions

TopicBridgeOptions() = default

Constructor.

Default values:

  • callback_group = nullptr (node’s default)

  • qos_options = default (see QosOptions for more information)

  • remap_name = “” (no remap)

  • bidirectional = false (one-way)

  • reversed = false

  • wait_for_subscription = false

  • wait_for_publisher = true

  • auto_remove = AutoRemove::Disabled

  • delay = 0 (no extra delay to wait for publishers before creating bridge)

std::shared_ptr<rclcpp::CallbackGroup> callback_group() const

Get callback group associated with the topics pub/sub pair.

TopicBridgeOptions &callback_group(std::shared_ptr<rclcpp::CallbackGroup> group)

Set the callback group associated with the topics pub/sub pair.

QosOptions qos_options() const

Get QoS options.

TopicBridgeOptions &qos_options(const QosOptions &qos_options)

Set QoS options.

const std::string &remap_name() const

Get remap name.

TopicBridgeOptions &remap_name(const std::string &remap_name)

Set remap name.

An empty string implies no remap.

const bool &bidirectional() const

Get bidirectional option.

TopicBridgeOptions &bidirectional(const bool &bidirectional)

Set bidirectional option. If true, this will bridge the topic in both directions.

const bool &reversed() const

Get reversed option.

TopicBridgeOptions &reversed(const bool &reversed)

Set reversed option. If true, this will swap the ‘to’ and ‘from’ domain IDs.

const std::chrono::milliseconds &delay() const

Get bridge delay.

TopicBridgeOptions &delay(const std::chrono::milliseconds &delay)

Set bridge delay (amount of time to wait for publishers before creating bridge).

TopicBridgeOptions &wait_for_subscription(bool value)

Set wait_for_subscription to value.

When set to true, the domain bridge will wait for a subscription to be available in the “to domain” before creating the bridge.

If wait_for_publisher() is also true, the bridge will first wait for an available publisher and then for an available subscription. QoS matching will be taken from the publisher in that case.

bool wait_for_subscription() const

Get wait_for_subscription option.

TopicBridgeOptions &wait_for_publisher(bool value)

Set wait_for_publisher to value.

When set to true, the domain bridge will wait for a publisher to be available in the “from domain” before creating the bridge.

bool wait_for_publisher() const

Get wait_for_publisher option.

TopicBridgeOptions &auto_remove(AutoRemove value)

Set auto_remove to value.

If set to AutoRemove::OnNoPublisher the domain bridge will stop bridging when no publisher is available in the “from domain”. The bridge will automatically be created again when a new publisher is discovered.

If set to AutoRemove::OnNoSubscription the domain bridge will stop bridging when no subscription is available in the “to domain”. The bridge will automatically be created again when a new subscription is discovered.

When set to AutoRemove::Disabled, the bridge will keep running forever once created.

AutoRemove auto_remove() const

Get remove_if_no_publisher option.