Function rcl_logging_rosout_init_publisher_for_node

Function Documentation

rcl_ret_t rcl_logging_rosout_init_publisher_for_node(rcl_node_t *node)

Creates a rosout publisher for a node and registers it to be used by the logging system.

Calling this for an rcl_node_t will create a new publisher on that node that will be used by the logging system to publish all log messages from that Node’s logger.

If a publisher already exists for this node then a new publisher will NOT be created.

It is expected that after creating a rosout publisher with this function rcl_logging_destroy_rosout_publisher_for_node() will be called for the node to cleanup the publisher while the Node is still valid.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:

node[in] a valid rcl_node_t that the publisher will be created on

Returns:

RCL_RET_OK if the logging publisher was created successfully, or

Returns:

RCL_RET_NODE_INVALID if the argument is invalid, or

Returns:

RCL_RET_BAD_ALLOC if allocating memory failed, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.