Re: [ros-users] Node Handle details

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: User discussions
Subject: Re: [ros-users] Node Handle details
On Wed, Dec 22, 2010 at 7:20 PM, joan_perez <> wrote:

>> 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.
> That was exactly the problem I found, many instances from a same node may
> be executed at the same time trying to advertise the same topic. That is
> the main reason I wanted to use namespaces.


> I do not think I understood the camera example. When you say topics will
> be pushed down, you mean if the developer explicity uses the node
> namespace?
> I can not see either, how consumers connected to the previously named
> topic "camera/image_raw" can resolve the topic name if there is no
> additional information (like I wanted to connect to the front camera
> instead of the back one).


I know two ways to specify a namespace (perhaps there are others).
Using the camera example:

* $ ROS_NAMESPACE=front rosrun camera1394 camera1394_node

* In a launch file, using something like <group ns="front"> around
the <node> item.

Both methods produce topics named /front/camera/image_raw and
/front/camera/camera_info.

> I hope I expressed myself correctly.


The question is clear. What might not have been clear is that the
node's "namespace" signifies the part of the name *before* the '/' and
the node name. That is what I meant by "pushing down" the namespace.
--
 joq