Ask Your Question
3

Can a ros node do the equivalent of 'rosnode ping'

asked 2012-03-06 05:30:23 -0600

Murph gravatar image

Is there a way (hopefully in rospy) do something like 'rosnode ping' natively? I want to check if another node is running.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2012-03-06 05:35:19 -0600

kwc gravatar image

Yes, but its probably a bad idea to code this sort of logic into your nodes. The intent of an anon pub/sub system is to not know what other nodes are running. That way you can freely interchange bags, alternate implementations, etc... Instead, test for the data/state you want to see, rather than the nodes you want to see.

For how to do the ping operation, simply read the source of rosnode. It requires making outbound XMLRPC calls, so it is a 'slow' operation.

edit flag offensive delete link more

Comments

1

Thanks for the answer. Yeah, this is not a good idea generally, but it makes sense for my project.

Murph gravatar imageMurph ( 2012-03-07 08:29:12 -0600 )edit

As a follow-up, can a node figure out it's actual name? (If it was created with anonymous=True).

Murph gravatar imageMurph ( 2012-03-07 08:30:18 -0600 )edit
kwc gravatar imagekwc ( 2012-03-07 09:46:09 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-03-06 05:30:23 -0600

Seen: 1,529 times

Last updated: Mar 06 '12