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

How to run multiple roscore/master in multiple machine?

asked 2016-02-17 14:19:41 -0500

Moon gravatar image

my project is to make a ground station "laptop" communicate with multiple raspberry-pi and multiple arduino ... can I run more than one roscore to run ROS on multiple machines to avoid single point of failure .

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-02-21 03:52:11 -0500

Moon gravatar image

multimaster_fkie is the answer . http://fkie.github.io/multimaster_fkie/

edit flag offensive delete link more
0

answered 2016-02-17 15:31:26 -0500

awaldrum gravatar image

If you mean have multiple roscores on multiple machines then yes, that is how ros works. You can have multiple laptops as long as they are mostly listening(as in not actively competing with each other to command the other nodes). If you mean multiple roscore instances on one machine, then no, that is not how ros works.

If you want to be sure the roscore stays active on the main machine, I suggest creating a script that would check and make sure roscore is still active. Here is an untested simplified version of what I have used for this purpose.

#! /bin/bash
keep_alive()
  process=$(basename $1)
  process="${process%%.*}" #remove timestamp
  while [ true ]
  do
    if pgrep "$process" > /dev/null
    then
        local returnVal=0;
    else
        echo "$process stopped"
        $process &
        local returnVal=1;
    fi
    sleep 5
  done
}

keep_alive roscore

In my case I wrapped the launch file launch with a bash script that was easily pgrep-able.

edit flag offensive delete link more

Comments

1

thanks for your script :) but my point is running more than roscore on multiple machines and those machines communicate with each others ... is that available on ROS or on communication between multiple machines required just one roscore must be run ?

Moon gravatar image Moon  ( 2016-02-18 05:52:42 -0500 )edit

Question Tools

Stats

Asked: 2016-02-17 14:19:41 -0500

Seen: 1,015 times

Last updated: Feb 21 '16