Function rcl_remap_node_name

Function Documentation

rcl_ret_t rcl_remap_node_name(const rcl_arguments_t *local_arguments, const rcl_arguments_t *global_arguments, const char *node_name, rcl_allocator_t allocator, char **output_name)

Remap a node name based on given rules.

This function returns the node name that a node with the given name would be remapped to. When a node’s name is remapped it changes its logger name and the output of expanding relative topic and service names.

When composing nodes make sure that the final node names used are unique per process. There is not currently a way to independently remap the names of two nodes that were created with the same node name and are manually composed into one process.

The behavior of local_arguments, global_arguments, node_name, the order remap rules are applied, and node specific rules is identical to rcl_remap_topic_name().

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • local_arguments[in] Arguments to be used before global arguments.

  • global_arguments[in] Command line arguments to use if no local rules matched, or NULL or zero-initialized to ignore global arguments.

  • node_name[in] The current name of the node.

  • allocator[in] A valid allocator to use.

  • output_name[out] Either an allocated string with the remapped name, or NULL if no remap rules matched the name.

Returns:

RCL_RET_OK If the name was remapped or no rules matched, or

Returns:

RCL_RET_INVALID_ARGUMENT if any arguments are invalid, or

Returns:

RCL_RET_BAD_ALLOC if allocating memory failed, or

Returns:

RCL_RET_NODE_INVALID_NAME if the name is invalid, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.