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

Is it possible to query if a particular namespace exists?

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

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
2

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

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

Stats

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

Seen: 618 times

Last updated: May 27 '11