ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org

# Using Openni_launch in a multirobot system

Hello!

I am currently working on a huge project where several identical robots will work together using ROS as the framework. There will be a central roscore, with the same nodes/topics launched on each robot, but under different namespaces. I have successfully implemented this in my launchfiles using a group tag, but quickly hit another snag:

tf doesn't allow for namespaces the same way that nodes/topics do. I managed to solve this problem as well by setting the tf_prefix parameter for every node using tf (using some really ugly launchfile arguments).

The problem I'm standing before right now is a bit more difficult though. Each of the robots has a Kinect equipped, so the system will contain multiple Kinects, both nodes, topics and tf transforms.

Every approach I've tried so far has failed here. I can get the nodes/topics in the correct namespace, but I am unable to do the same for the Kinect.

I am using the

roslaunch openni_launch openni.launch


file to start the Kinect (which works fine in single robot systems).

Is there a way to have multiple Kinects in the same ROS system? Preferably not by changing the "camera" argument, since it would make the rest of the code unmanageable.

EDIT: I found this post: http://answers.ros.org/question/103/how-can-multiple-robots-communicate-using-ros where the answer suggests to use multiple masters. This would probably solve my problem at the expense of a few hours of coding. Still, it would be interesting to see if a single master solution is possible using openni_launch.

edit retag close merge delete

Sort by » oldest newest most voted

Well yes, you are right. You cannot work with the original tf tree. But there is a parameter called tf_prefix which kind of does the same as namespaces with the tf frames. With that you can push even the kinect tf frame such you can have multiple kinects in your system working on the same level (on the same logical level). I did a first testrun yesterday and it worked fine! Two turtlebots in parallel. Although the system became a little stressed I guess due to the many tf frames that are by definition shared among all nodes of the two bots. I currently consider to remap even the tf frames (on topic level) so that they don't have to be shared any more. This doesn't seem to be a clean approach, but maybe necessary.

more

I was trying for the same kind of setup with tf_prefix but couldn't get it set up properly, can you set the tf_prefix parameter in the <group> tag of the top level launch file? Sadly this setup won't work for me either way because I have limited bandwidth to work with. TF is too bandwidth intensive.
( 2011-12-20 23:09:51 -0600 )edit
Sorry for the delayed replay (mail informer didn't work) I experienced the same problem myself, all the tf frames shared with all robots totally stuffed my network (2 turtlebots are ok, but not more). I am currently not at work, so I cannot tell if tf_prefix in the group worked. I will post later.
( 2012-01-17 18:39:37 -0600 )edit
YES, the tf_prefix can be declared in the <group> tags and is then available for all nodes and launch files that are included.
( 2012-01-19 18:46:41 -0600 )edit

Per Lenander,

to answer your question: I am trying to approaching this with namespaces in the launch files.

<launch>
<group ns="namespace_name"/>
</group>
</launch>


With that it is possible to have one central roscore and seperated namespaces for all nodes on the robots, like "/namespace_name/camera/rgb/image_color". As I wrote before I still have problems with my kinect stack so it is pretty much not working yet, but I am rather confident, that this might work :) Hopefully this helps you with your problem.

more

The additional problem you will probably find out about soon is that even if you put nodes in a namespace, tf doesn't push down names. Hence, if you use tf in your system and run multiple robots, from the tf point of view there will only be one Kinect.
( 2011-12-15 01:54:42 -0600 )edit
Might not seem like such a problem at first (since the tf representation of the Kinect is static), but consider that tf only allows one parent for each frame... hence, the tf-kinect frame can only be attached to one robot.
( 2011-12-15 01:57:47 -0600 )edit

I have most probably exactly the same problem! Using a group tag and putting all nodes of one robot into a separated namespace works fine, but for some reason not for the kinect nodes. I can put them into a namespace though but then I am unable to pull any data from these topics. I cannot even echo the most basic topic like "/namespace/camera/depth/points".

I have checked the internal kinect management topics like "/namespace/openni_manager/bond" and it is working!

EDIT: It seems to be nothing else but a severe problem of the underlaying software driver of the kinect. As I realized even with the unchanged version of my launch file (without namespace) it is fairly often NOT working as well. And after several retries I observed the case that it was working even with my namespace changes. So now I am at the beginning again and looking for an answer. Will start with pulling the svn version of the kinect package and compile it from scratch, hopefully that will help. Cheers.

more

Yeah, I've also met problems with the Kinect launch files in general, where sometimes (more than I would like) it simply doesn't work and the only way to fix it is to relaunch the driver.
( 2011-12-15 01:55:59 -0600 )edit

Can u exactly tellme how to start multiple pr2s in simulation.. tried using different namespace in terminal .. doesnt work.

more

Sorry, never worked with the simulation tool.

I suggest you repost your question as a complete new one with appropriate title such people who know the answer can find it :)

more