Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__ns remapping not working when specified for a particular node #262

Closed
dhood opened this issue Jun 19, 2018 · 4 comments
Closed

__ns remapping not working when specified for a particular node #262

dhood opened this issue Jun 19, 2018 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@dhood
Copy link
Member

dhood commented Jun 19, 2018

This works:

]$ ros2 run demo_nodes_cpp talker talker:__node:=new_node_name
[INFO] [new_node_name]: Publishing: 'Hello World: 1'
^Csignal_handler(2)

As does this:

$ ros2 run demo_nodes_cpp talker __ns:=/new_ns
[INFO] [new_ns.talker]: Publishing: 'Hello World: 1'
[INFO] [new_ns.talker]: Publishing: 'Hello World: 2'

But this doesn't seem to:

$ ros2 run demo_nodes_cpp talker talker:__ns:=/new_ns
[INFO] [talker]: Publishing: 'Hello World: 1'
[INFO] [talker]: Publishing: 'Hello World: 2'
^Csignal_handler(2)

There's a chance this combination isn't expected to work, but I think it might be.

@dhood dhood added the bug Something isn't working label Jun 19, 2018
@wjwwood
Copy link
Member

wjwwood commented Jun 19, 2018

I would also consider that to be a bug.

@sloretz
Copy link
Contributor

sloretz commented Jun 19, 2018

definitely a bug

There's a unit test for rcl_remap_node_namespace()

TEST_F(CLASSNAME(TestRemapFixture, RMW_IMPLEMENTATION), nodename_prefix_namespace_remap) {
rcl_ret_t ret;
rcl_arguments_t global_arguments;
SCOPE_ARGS(
global_arguments,
"process_name", "Node1:__ns:=/foo/bar", "Node2:__ns:=/this_one", "Node3:__ns:=/bar/foo");
{
char * output = NULL;
ret = rcl_remap_node_namespace(
NULL, &global_arguments, "Node1", rcl_get_default_allocator(), &output);
EXPECT_EQ(RCL_RET_OK, ret);
EXPECT_STREQ("/foo/bar", output);
rcl_get_default_allocator().deallocate(output, rcl_get_default_allocator().state);
}
{
char * output = NULL;
ret = rcl_remap_node_namespace(
NULL, &global_arguments, "Node2", rcl_get_default_allocator(), &output);
EXPECT_EQ(RCL_RET_OK, ret);
EXPECT_STREQ("/this_one", output);
rcl_get_default_allocator().deallocate(output, rcl_get_default_allocator().state);
}
{
char * output = NULL;
ret = rcl_remap_node_namespace(
NULL, &global_arguments, "Node3", rcl_get_default_allocator(), &output);
EXPECT_EQ(RCL_RET_OK, ret);
EXPECT_STREQ("/bar/foo", output);
rcl_get_default_allocator().deallocate(output, rcl_get_default_allocator().state);
}
}

but there's not an integration test for it https://github.com/ros2/rcl/blob/master/rcl/test/rcl/test_remap_integration.cpp

@dhood
Copy link
Member Author

dhood commented Jun 19, 2018 via email

@kev-the-dev
Copy link

Fixed and tested in #263

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants