Re: [ros-users] Node Handle details

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: User discussions
日付:  
To: User discussions
題目: Re: [ros-users] Node Handle details
On Tue, Dec 21, 2010 at 5:55 PM, Josh Faust <> 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