Hi Markus, <br><br>This is a good question.  If you could ask it on <a href="http://answers.ros.org">http://answers.ros.org</a> it's easier for the community to respond and find it in the future.  <br><br>Thanks,<br>Tully<br>

<br><div class="gmail_quote">On Thu, Jul 21, 2011 at 1:27 AM, Achtelik  Markus <span dir="ltr"><<a href="mailto:markus.achtelik@mavt.ethz.ch">markus.achtelik@mavt.ethz.ch</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 all,<br>
<br>
I tried to post this via <a href="http://nabble.com" target="_blank">nabble.com</a> but somehow it didn't get through ... I have a node publishing a topic let's say "my_topic". Simply running this node, rostopic list tells me as expected:<br>


/my_topic<br>
/rosout<br>
/rosout_agg<br>
<br>
Now, when I want to push this node to a namespace by:<br>
export ROS_NAMESPACE=my_ns<br>
<br>
rostopic list says:<br>
/my_ns/my_ns/my_ns/my_topic<br>
/rosout<br>
/rosout_agg<br>
<br>
Any idea where three times "my_ns" comes from? When I run the node from a launch file and set the "ns" attribute, everything is alright. I'm not doing anything fancy with namespaces etc. in the node, I put some example code below. rosversion ros says 1.4.8 .<br>


<br>
Best, Markus<br>
<br>
#include <ros/ros.h><br>
#include <std_msgs/String.h><br>
<br>
int main(int argc, char** argv)<br>
{<br>
<br>
  ros::init(argc, argv, "ns_test");<br>
  ros::NodeHandle nh;<br>
  ros::Publisher pub = nh.advertise<std_msgs::String> ("my_topic", 1);<br>
<br>
  ros::Rate r(5);<br>
  while (ros::ok())<br>
  {<br>
    std_msgs::String msg;<br>
    msg.data = "my string message";<br>
    pub.publish(msg);<br>
    r.sleep();<br>
  }<br>
  return 0;<br>
}<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">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>
</blockquote></div><br><br clear="all"><br>-- <br>Tully Foote<br>Systems Engineer<br>Willow Garage, Inc.<br><a href="mailto:tfoote@willowgarage.com">tfoote@willowgarage.com</a><br>(650) 475-2827<br>