0
$\begingroup$

Rosanswers logo

I am using ROS Electric. I have three ROS station, one is master and other two are client machines. Each client machine has its own Kinect. Master's IP is configured as ROS_MASTER_URI on both clients.

I am using this following launch file to launch the skeletal tracker on both clients.

<launch> 
<arg name="fixed_frame" value="openni_depth_frame"/>

<include file="$(find skeleton_markers)/launch/skeleton.launch"> </include>

 <node pkg="skeleton_markers" name="skeleton_markers" type="skeleton_markers.py" output="screen">
    <rosparam file="$(find skeleton_markers)/params/marker_params.yaml" command="load"/>
 </node>
</launch>

Now the problem is, this launch file publishes two topics /skeleton and /skeleton_markers. I tried to change the "name" parameters here, but it did not work. This file is also launched on those two clients, and need separate topic name. How can I remap these topics? Thanks in advance for your help.

Best regards, Tariq


Originally posted by Tariq on ROS Answers with karma: 3 on 2013-03-15

Post score: 0

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

I think the "cleaner" answer is to launch the nodes within a separate namespace. You can specify a namespace for each node as shown here. Depending on how the node is set up, all "local" topics should then be published under this separate namespace.

<node pkg="skeleton_markers" name="skeleton_markers" type="skeleton_markers.py" ns="system1"/>

I think the issue you're seeing above is that when you run rostopic list on a running system, it shows both the published and subscribed topic names. My guess is that when you modify the published topic names as shown above, you forget to also remap the topic that a different node is subscribing to. If you run rostopic info on a particular topic name (as shown by rostopic list), it will list out exactly which nodes are publishing/subscribing to each topic. This may help you troubleshoot.

I have not used skeleton_markers before, but it's possible that you may need to also tell the nodes to publish the markers in different rviz namespaces. Note that these namespaces are distinct from normal ROS namespaces. RViz requires that all markers have unique names, as a combination of their id and namespace values. It looks like the skeleton_markers node supports this through the use of the ~ns parameter. You can specify this parameter in your launch file also:

<node pkg="skeleton_markers" name="skeleton_markers" type="skeleton_markers.py" ns="system1">
  <param name="ns" value="skeleton1"/>
</node>

Edit:
According to your comments, it looks like the <include> file is pulling in additional topics in the root namespace, not your sub-namespaces. I suggest you read up on the roslaunch XML syntax.

When you review that documentation, you'll see that the <include> tag has an optional namespace parameter just like we used for the <node> tag: ns="system1". You can add this to the <include> tag to force it to publish its nodes in a sub-namespace as well.

At this point, though, there's a better way to set the namespace for multiple different roslaunch tags. Use the <group> tag. If you use this in combination with an <arg> tag, you can use the same launch file for both client machines and pass in the desired namespace on the command line when you call roslaunch:

<arg name="skel_ns"/>
<group ns="$(arg skel_ns)">
  <include file="$(find skeleton_markers)/launch/skeleton.launch"/>
  <node pkg="skeleton_markers" name="skeleton_markers" type="skeleton_markers.py" output="screen">
    <rosparam file="$(find skeleton_markers)/params/marker_params.yaml" command="load"/>
    <param name="ns" value=$(arg skel_ns)"/>
  </node>
</group>

roslaunch skel_client.launch skel_ns:="system1"

Good luck!


Originally posted by Jeremy Zoss with karma: 4976 on 2013-03-18

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by Tariq on 2013-03-23:
Thanks a lot Jeremy for you answer. This is really helpful for me to understand the architecture. The namespace renaming thing works for the 'skeleton_makers', so now the topics are published as /system1/skeleton and /system1/skeleton_markers.for space limitation, i'll finish my question in next cmn

Comment by Tariq on 2013-03-23:
But, the topic /skeleton is still exits. after 'rostopic info /skeleton', it says 'Publishers:/skeleton_tracker'. So I guess, this is published by the line ' '. How can I set a new name space name for 'skeleton.launch' file?

Comment by Tariq on 2013-03-23:
And, I am really sorry for the late reply. I was out of town, and didn't have access to the system.

Comment by Tariq on 2013-03-24:
Thanks a lot Jeremy for your valuable help. It works.

$\endgroup$
0
$\begingroup$

Rosanswers logo

Hi again,

You could do this :

<launch> <arg name="fixed_frame" value="openni_depth_frame"/>

<include file="$(find skeleton_markers)/launch/skeleton.launch"> </include>

<node pkg="skeleton_markers" name="skeleton_markers" type="skeleton_markers.py" output="screen" args="/skeleton:=/skeleton_1 /skeleton_markers:=/skeleton_markers_1"> <rosparam file="$(find skeleton_markers)/params/marker_params.yaml" command="load"/> </node> </launch>

And do the equivalent on the second machine (by changing number 1 to 2).

Let me know :-)

For future reference on remapping, see here

Bests,

Steph


Originally posted by Stephane.M with karma: 1304 on 2013-03-15

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Tariq on 2013-03-15:
Thanks Steph Again:). It works. It start publishes /skeleton_1 and /skeleton_markers_1 topic, the only problem is, it still publishes the /skeleton topic as well. But, not the /skeleton_markers topic.

Comment by Stephane.M on 2013-03-15:
Hum, that's weird, are you sure ? Try stopping all you running nodes, and try again. Because it should not publish the /skeleton anymore....

Comment by Tariq on 2013-03-15:
I guess, yes. I stopped all other running nodes. Then do 'rostopic list', there was not /skeleton topic. After launching, it is showing three topic '/skeleton /skeleton_1 and /skeleton_markers_1'. :(

Comment by Stephane.M on 2013-03-15:
hum. Instead of /skeleton:=/skeleton_1, try skeleton:=skeleton_1

Comment by Tariq on 2013-03-15:
No luck :( I've just tried, but the same result.

Comment by Stephane.M on 2013-03-16:
And the data is still published in /skeleton ? Or is it in /skeleton_1 ? Or in both ? (try to save with a rosbag, and do a rosbag info to see where is the information).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.