ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

single rosmaster multi-turtlebots 2

asked 2015-08-14 13:26:14 -0500

Vinh K gravatar image

updated 2015-12-01 20:13:41 -0500

Hi Ros community, Has anyone successfully implemented single Master network on many turtlebots 2 as a distributed multi-robots?

ADDED: If some has implemented this on the actual turtlebots 2, if so could someone guide me as I have tried everything. Please help me setting it up from the beginning. I am having difficulty with running the default bring up command for turtlebot 2 which is

roslaunch turtlebot_bringup minimal.launch

update: it seem that the command

roslaunch turtlebot_bringup minimal.launch

is the issue. For those who have implemented the single master, how do you get the turtlebots to work ?

or the least what command does one use to launch the turtlebots?

Thanks

edit retag flag offensive close merge delete

Comments

Hello, I wonder if you have solved this problem? If so, please tell me how to do it, I am dealing with the same problem as you.Please.Thank you.

LucYang gravatar image LucYang  ( 2018-07-30 08:07:20 -0500 )edit

try to have use multimaster_fkie as your connection for multi-robot. In addition, rather than roslaunch turtlebot_bringup minimal.launch use roslaunch kobuki_node minimal.launch. I can not remember exactly, but turtlebot_bringup does not work for this case

Vinh K gravatar image Vinh K  ( 2018-07-30 09:56:06 -0500 )edit

So you have done this problem at last? Thank you very much for giving the advice and hope.

LucYang gravatar image LucYang  ( 2018-07-30 23:29:04 -0500 )edit

I did not continue after that attempt. But the other engineers from my team did.

Vinh K gravatar image Vinh K  ( 2018-07-30 23:32:44 -0500 )edit

It is really good to know someone has done it. Could please help me to ask the other engineers what are their solutions? English is not my native language, I am sorry if my asking way is rude, but I really want to solve this problem, I have been stuck here for more than a week.

LucYang gravatar image LucYang  ( 2018-07-31 03:02:40 -0500 )edit

Hi Luc,

I have asked and here is what I can tell from it.

  1. Ensure that you have Ubuntu with ROS Kinetic installed and have your ROS installations working properly.

  2. Follow this instruction to install multimaster_fkie

Vinh K gravatar image Vinh K  ( 2018-07-31 09:15:29 -0500 )edit

Instead of running

roslaunch turtlebot_bringup minimal.launch

run

roslaunch kobuki_bringup minimal.launch

Good luck

Vinh K gravatar image Vinh K  ( 2018-07-31 09:16:39 -0500 )edit

Thank you for your advice, I have successfully implemented multi-master with multimaster_fkie. As my turtlebot is not the standard equipment,roslaunch turtlebot_bringup minimal.launch is good for me if I export ROS_NAMESPACE=client1 on my turtlebot client1 , the same as my turtlebot client2.

LucYang gravatar image LucYang  ( 2018-07-31 19:27:27 -0500 )edit

2 Answers

Sort by » oldest newest most voted
3

answered 2015-08-14 15:52:25 -0500

updated 2015-08-14 17:48:24 -0500

Hi Vinh,

People have definitely done this. The "best" approach will be dependant on many factors, including (perhaps most importantly) the quality of the wireless links between the robots, as well as the amount of data that needs to be sent around, and so on.

If the robots will always have really good WiFi (i.e., they are always very close to an access point), you could try just running everything "out of the box" and just pushing each robot into its own namespace on the same master that is running either on one of the robots or on a separate machine (say, a machine that connects via wired Ethernet to the wired network connecting your wireless access point(s).

However, if the robots will sometimes have intermittent network connectivity, things get much more complicated. ROS1 "out of the box" does not handle this situation gracefully; the TCP buffers will back up, and then things get ugly. You can help some of this by running all your ROS1 connections over a VPN, which (surprisingly) can behave much better than "normal" TCP.

Alternatively, you could use an additional middleware, such as OpenSplice DDS, to handle the inter-robot links, and run a separate ROS master on each robot. (Note that ROS2 is being built on DDS for exactly this reason, among others, but it's not yet ready for day-to-day use.)

More specifically for the multiple-robots-on-wireless-LAN approach (the simplest):

Let's assume there is a computer that seems like a good candidate to run the ROS master (say, a workstation that will also run the RViz or other "system-wide" nodes). Let's pretend that computer is called overlord.local on the network and can be reached from all of the robots. When debugging this type of thing, it's important to ensure that, first, the LAN and mDNS is properly configured, so that when you run ping overlord.local on your robot laptops, it works.

Let's assume further that overlord.local can ssh into all of the laptops on the Turtlebots. You can make this work password-less using ssh-keygen to create a public/private keypair on overlord.local, and then ssh-copy-id to copy the private key to all of your robot laptops.

To run some robots, you'll start roscore on the overlord.local machine, and then shell into the robots, say turtle1.local and turtle2.local. The key thing to do once you've shelled into a robot is to point its ROS_MASTER_URI environment variable back to overlord.local. More specifically, from a shell (or in a .bashrc alias):

export ROS_MASTER_URI=http://overlord.local:11311

then, you'll need to have each turtlebot launch inside its own namespace; otherwise, the node names on turtle1 will be the same as on turtle2, and the ROS master will tell the previously-launched node to shut down when the new one starts. There are a few ways to set the namespace, but one fairly easy one is to set ROS_NAMESPACE to something unique, like ... (more)

edit flag offensive delete link more

Comments

thanks for the reply Morgan. For my case, the wifi is good since I am using 6 turtlebots in our robotics lab. However, the only issue is the bringup command that I have not been able to resolve for turtlebots 2.

Vinh K gravatar image Vinh K  ( 2015-08-14 16:09:28 -0500 )edit

This is the command to bring up turtlebots: roslaunch turtlebot_bringup minimal.launch. I can not run this command for more than 1 turtlebot. I needed to run this command for the robot to turn on and be able to move as well as all the sensors that it has.

Vinh K gravatar image Vinh K  ( 2015-08-14 16:16:39 -0500 )edit

Hi Vinh, again, lots of approaches are valid here, but one would be to make a "cluster mega-launch file" that has six <include> tags that specify the __ns attribute differently for each robot. That way, their nodes won't collide in the ROS namespace.

Morgan gravatar image Morgan  ( 2015-08-14 16:22:23 -0500 )edit

well Morgan, what i have done previously is to have that bring up command under different namespace for each turtlebots PC. For instance, this is what I have done:

Turtlebot 1 PC

  <group ns="robot1"
           <include file="$(find turtlebot_bringup)/launch/minimal.launch"/>
 </group>
Vinh K gravatar image Vinh K  ( 2015-08-14 16:34:13 -0500 )edit

I am not sure if this is what I am supposed to do. But after I did this, I have trouble moving turtlebot with: roslaunch turtlebot_teleop keyboard_teleop.launch which is what I normally use for a single robot.

Vinh K gravatar image Vinh K  ( 2015-08-14 16:44:32 -0500 )edit

<group ns="robot1">

<launch>

       <include file="$(find turtlebot_bringup)/launch/minimal.launch"/>

</launch>

</group>

I believed I did something similar like that, I just could not remember Morgan.

Vinh K gravatar image Vinh K  ( 2015-08-14 16:47:03 -0500 )edit

or what should I do since I am very new and lost with ROS networking for these turtlebots. should each robot PC have that ns above or but just replace robot1 to robotN corresponding to the robot number. Thanks

Vinh K gravatar image Vinh K  ( 2015-08-14 16:50:52 -0500 )edit

i'll edit my answer and attempt to include some suggestions in a longer post

Morgan gravatar image Morgan  ( 2015-08-14 17:30:44 -0500 )edit
0

answered 2017-09-06 04:41:15 -0500

roselight gravatar image

Hi In case you are still on this: Every launch file for every robot needs to get a namespace and a tf_prefix. So yes, you need to do this for all of the robots. You can sum up some launch files in one and then namespace them. An example and reference can be found here: multiple robots

Otherwise: check for every node with rosnode info NAME to which topics it subscribes and which it publishes, since the prefixes/namespaces have to be correctly resolved there.

good luck!

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2015-08-14 13:26:14 -0500

Seen: 2,311 times

Last updated: Sep 06 '17