Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.
This repository was archived by the owner on May 31, 2025. It is now read-only.

ros::init with no __name and name = "" is not tested in roscpp? #891

@furushchev

Description

@furushchev

I'd like to report a possible bug at roscpp initialization.
In roscpp initializer ros::init (const M_string &remappings, const std::string &name, uint32_t options=0), a node can be initialized even empty string is passed to name argument if remappings are passed through from command line arguments.
But if __name:=foobar is removed from remappings and name is empty, ros node can be registered with invalid name, which can occur unexpected errors.
I did experiment in some conditions. the result is followings:

remap_name node_name_empty test_group this_node::name this_node::namespace
true false false /test_node /
true false true /group1/test_node //group1
true true false /test_node /
true true true /group1/test_node //group1
false false false /test_node /
false false true /group1/test_node //group1
false true false / /
false true true //group1 //group1

In the last condition, namespace and name are the same and other nodes cannot resolve the node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions