ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

What is difference between a node with ns and node inside group with same namespace?

asked 2016-12-02 01:13:53 -0500

cybodroid gravatar image

updated 2016-12-02 02:16:49 -0500

A node in ROS can have ns as an attribute that starts node in given namespace.

A node also be grouped inside a namespace by nesting it under group tag.

But is different in both scenario.

For me both types of code are giving different behavior:

Type 1:

<node name="controller_spawner$(arg robot_name)" pkg="controller_manager" type="spawner" respawn="false"
output="screen" ns="/$(arg robot_name)" args="joint1_velocity_controller joint2_velocity_controller                                  front_left_steering_position_controller front_right_steering_position_controller  joint_state_controller"/>

Type 2:

 <group="$(arg robot_name)">
    <node name="controller_spawner$(arg robot_name)" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" args="joint1_velocity_controller joint2_velocity_controller                                  front_left_steering_position_controller front_right_steering_position_controller  joint_state_controller"/>
</group>

Type 1 runs successfully and I get console output as:

Started controllers: joint1_velocity_controller, joint2_velocity_controller, front_left_steering_position_controller, front_right_steering_position_controller, joint_state_controller

Type 2 fails I get following output in console:

Controller Spawner couldn't find the expected controller_manager ROS interface.
edit retag flag offensive close merge delete

Comments

1

It would be nice if you could tell us what "different behaviour" you have observed, specifically.

gvdhoorn gravatar image gvdhoorn  ( 2016-12-02 01:36:12 -0500 )edit

Without context, it is hard to tell but I am editing question to make it more understandable.

cybodroid gravatar image cybodroid  ( 2016-12-02 02:14:46 -0500 )edit

Thanks for pointing this out. It solved the issue. I will add a reply to this answer myself. Thanks again for your time.

cybodroid gravatar image cybodroid  ( 2016-12-02 03:14:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-12-02 02:24:35 -0500

gvdhoorn gravatar image

Looks like one of them is absolute (/..), while the other is relative (no /).

edit flag offensive delete link more

Comments

I found out that there is no difference in both syntax. As @gvdhoorn pointed out, I had made a mistake and one of them is absolute (/..), while the other is relative (no /).

cybodroid gravatar image cybodroid  ( 2016-12-02 03:15:43 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-12-02 01:13:53 -0500

Seen: 1,089 times

Last updated: Dec 02 '16