Function rcl_publisher_get_topic_name

Function Documentation

const char *rcl_publisher_get_topic_name(const rcl_publisher_t *publisher)

Get the topic name for the publisher.

This function returns the publisher’s internal topic name string. This function can fail, and therefore return NULL, if the:

  • publisher is NULL

  • publisher is invalid (never called init, called fini, or invalid node)

The returned string is only valid as long as the rcl_publisher_t is valid. The value of the string may change if the topic name changes, and therefore copying the string is recommended if this is a concern.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:

publisher[in] pointer to the publisher

Returns:

name string if successful, otherwise NULL