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

Is it possible to query if a particular namespace exists?

asked 2011-05-27 04:55:58 -0500

I'm attempting to detect 3rd party configuration un-intrusively by checking which namespaces exist.

I suppose I can just check for a specific parameter in said namespace, but that feels a little wrong/less robust than checking for the namespace directly.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-05-27 06:59:25 -0500

kwc gravatar image

Parameters, topics, services, and nodes can all create namespaces. The only way to robustly check for a namespace is to

  1. Query for the parameter
  2. Parse the result from rosgraph.masterapi.Master.getSystemState()

It would be better, though, I think, for your 3rdparty configuration to more explicitly declare its presence (e.g. via parameter, or topic, or otherwise).

edit flag offensive delete link more

Question Tools


Asked: 2011-05-27 04:55:58 -0500

Seen: 590 times

Last updated: May 27 '11