Ask Your Question
1

rosmaster zombie

asked 2013-04-26 13:17:04 -0600

130s gravatar image

updated 2013-04-27 07:16:39 -0600

I know zombie node can exist but is zombie master possible too?

With the following step, I keep getting rosgraph.masterapi.Master instance even after I stop master, which is not my intent. What's wrong?

  1. Run master (eg. by roscore)
  2. Run $ rosrun turtlesim turtlesim_node
  3. Run the python script I cite at the bottom. It keeps printing the instance info.
  4. Stop master. Surprisingly, print continues with the same content.

After 3, both 2 processes with the names roscore and rosmaster --core don't seem to be running. Stopping turtlesim when master is already stopped doesn't change anything. I suspect rosmaster could be sustaining even after it's shut down?

Code:

#!/usr/bin/env python
import time

import rosgraph
import rosnode


def prv_master_rosnode():
    master = rosgraph.Master('/rosnode')
    print 'master={}'.format(master)
    rosn = rosnode.get_api_uri(master, '/turtlesim')
    print 'rosnode obj={}'.format(rosn)


def prv_master_rosnode_iterate():
    while True:
        prv_master_rosnode()
        time.sleep(1)


if __name__ == '__main__':
    prv_master_rosnode_iterate()

Printed:

master=<rosgraph.masterapi.Master object at 0x7fc400553fd0>
rosnode obj=http://ramenrobot:52240/
master=<rosgraph.masterapi.Master object at 0x7fc400553fd0>
rosnode obj=http://ramenrobot:52240/
master=<rosgraph.masterapi.Master object at 0x7fc400553fd0>
rosnode obj=http://ramenrobot:52240/
: (never changes, never stops)
  • ros-groovy-rosnode 1.9.44-0quantal-20130326-0855-+0000
  • ros-groovy-rosgraph 1.9.44-0quantal-20130325-0834-+0000
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-04-27 07:37:36 -0600

dornhege gravatar image

I think something else is happening here. If you verified the processes do not run anymore (e.g. look via ps), they cannot give a reply because the binary just does not exist. The problem just linked is based on the fact that the master doesn't unregister nodes, so if the binary is gone, that can't be it.

I'd probably look into what the python API gives you or specifies, i.e. why do you still get the same replies. If it caches (and should) that's desired behavior. If it should contact the master to get that kind of info, something seems buggy.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-04-26 13:17:04 -0600

Seen: 339 times

Last updated: Apr 27 '13