0
$\begingroup$

Rosanswers logo

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.


Originally posted by Per Lenander on ROS Answers with karma: 55 on 2011-12-13

Post score: 3

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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.


Originally posted by JBuesch with karma: 237 on 2011-12-20

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by JBuesch on 2012-01-19:
YES, the tf_prefix can be declared in the tags and is then available for all nodes and launch files that are included.

Comment by JBuesch on 2012-01-17:
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.

Comment by Per Lenander on 2011-12-21:
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 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.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by JBuesch with karma: 237 on 2011-12-15

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Per Lenander on 2011-12-15:
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.

Comment by Per Lenander on 2011-12-15:
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.

$\endgroup$

Your Answer

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