What is difference between a node with ns and node inside group with same namespace?
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.
It would be nice if you could tell us what "different behaviour" you have observed, specifically.
Without context, it is hard to tell but I am editing question to make it more understandable.
Thanks for pointing this out. It solved the issue. I will add a reply to this answer myself. Thanks again for your time.