[ros-users] Node Handle details

Jack O'Quin jack.oquin at gmail.com
Wed Dec 22 03:31:58 UTC 2010


On Tue, Dec 21, 2010 at 5:55 PM, Josh Faust <jfaust at willowgarage.com> wrote:
>>
>> I use ros::init() to specify the node namespace.
>
> ros::init() specifies the node's name, not its namespace.  The node's name
> determines where a private name ("~name") goes.

Plus, it's better not to use the node name when advertising topics to
other nodes. In complex roslaunch scenarios, node names are likely to
be changed in the launch file. So, other nodes should rely on
well-known topic names, not on guessing the node name.

Several alternate implementations may advertise the same topic. For
example, many camera drivers advertise "camera/image_raw" and
"camera/camera_info". If there is more than one camera, each will be
pushed down into its own namespace: "front/camera/image_raw", etc.
Consumers of the images need not worry about which device driver sends
them.
-- 
 joq



More information about the ros-users mailing list