Ivan, <br>The node name is actually embedded in the ROS_INFO output, although it does not display to the console.  <br><br>If you are debugging several nodes at once I suggest you try the tool rxconsole. <a href="http://www.ros.org/wiki/rxconsole" target="_blank">http://www.ros.org/wiki/rxconsole</a> It displays the debugging info, line number, and more.  And its output can be filtered using regexs.  It's display can be paused and scrolled back, refiltered etc.  <br>



<br>This also will work for multiple machines and terminals, so you don't have to worry about launching everything together to get debugging interleaved.  <br><br>To your question, I don't actually know how to print the name.  Good design principles would suggest that you don't need to know the name within the node because all names can be remapped, and if they are then they would be fragile if the name was coded inside.  <br>


<br>Tully<br><br><div class="gmail_quote">On Thu, Sep 9, 2010 at 10:22 AM, Ivan Dryanovski <span dir="ltr"><<a href="mailto:ivan.dryanovski@gmail.com" target="_blank">ivan.dryanovski@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<br>
<br>
Can I access the name of a node from inside a cpp program? I know that<br>
one of the argv** arguments passed through the program is<br>
"__name:=FOO". Is there an easier way to access that, without having<br>
to parse through the argv values?<br>
<br>
What I am eventually interested in is having the name of the node<br>
prepended to ROS_INFO statements. I was going to do it manually by<br>
finding the name of the node and doing<br>
<br>
ROS_INFO("%s: Some message here.", nodeName_);<br>
<br>
Which would result in<br>
<br>
FOO: Some message here.<br>
<br>
If someone has a suggestion for a cleaner way to do this, let me know please!<br>
<br>
Thanks,<br>
<font color="#888888">Ivan Dryanovski<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org" target="_blank">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Tully Foote<br>Systems Engineer<br>Willow Garage, Inc.<br><a href="mailto:tfoote@willowgarage.com" target="_blank">tfoote@willowgarage.com</a><br>(650) 475-2827<br>