Ask Your Question

awaldrum's profile - activity

2016-02-17 16:31:39 -0500 answered a question How to run multiple roscore/master in multiple machine?

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
  process=$(basename $1)
  process="${process%%.*}" #remove timestamp
  while [ true ]
    if pgrep "$process" > /dev/null
        local returnVal=0;
        echo "$process stopped"
        $process &
        local returnVal=1;
    sleep 5

keep_alive roscore

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

2015-09-18 14:02:29 -0500 received badge  Supporter (source)