Function rcl_node_resolve_name

Function Documentation

rcl_ret_t rcl_node_resolve_name(const rcl_node_t *node, const char *input_name, rcl_allocator_t allocator, bool is_service, bool only_expand, char **output_name)

Expand a given name into a fully-qualified topic name and apply remapping rules.

Attribute

Adherence

Allocates Memory

Yes

Thread-Safe

No

Uses Atomics

No

Lock-Free

Yes

Parameters:
  • node[in] Node object. Its name, namespace, local/global command line arguments are used.

  • input_name[in] Topic name to be expanded and remapped.

  • allocator[in] The allocator to be used when creating the output topic.

  • is_service[in] For services use true, for topics use false.

  • only_expand[in] When true, remapping rules are ignored.

  • output_name[out] Output char * pointer.

Returns:

RCL_RET_OK if the topic name was expanded successfully, or

Returns:

RCL_RET_INVALID_ARGUMENT if any of input_name, node_name, node_namespace or output_name are NULL, or

Returns:

RCL_RET_INVALID_ARGUMENT if both local_args and global_args are NULL, or

Returns:

RCL_RET_BAD_ALLOC if allocating memory failed, or

Returns:

RCL_RET_TOPIC_NAME_INVALID if the given topic name is invalid (see rcl_validate_topic_name()), or

Returns:

RCL_RET_NODE_INVALID_NAME if the given node name is invalid (see rmw_validate_node_name()), or

Returns:

RCL_RET_NODE_INVALID_NAMESPACE if the given node namespace is invalid (see rmw_validate_namespace()), or

Returns:

RCL_RET_UNKNOWN_SUBSTITUTION for unknown substitutions in name, or

Returns:

RCL_RET_ERROR if an unspecified error occurs.