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

Revision history [back]

click to hide/show revision 1
initial version

(Assumption: you know the parameter names.)

I don't know if there's official API to achieve what you want. I've also browsed through issues and pull requests on ros_comm but couldn't find anything relevant.

You can find the parameter full names that contains the parameter name (say "baa") in Python by something like:

lislis = [n for n in rospy.get_param_names() if "baa" in n]                                     

print(lislis)
['/namespace_foo/foobin/baa']

(Note that this snippet is obviously not robust.)

(Assumption: you know the parameter names.names and they won't change.)

I don't know if there's official API to achieve what you want. I've also browsed through issues and pull requests on ros_comm but couldn't find anything relevant.

You can find the parameter full names that contains the parameter name (say "baa") in Python by something like:

lislis = [n for n in rospy.get_param_names() if "baa" in n]                                     

print(lislis)
['/namespace_foo/foobin/baa']

(Note that this snippet is obviously not robust.)

(Assumption: you know the parameter names and they won't change.)

I don't know if there's official API to achieve what you want. I've also browsed through issues and pull requests on ros_comm but couldn't find anything relevant.

You can find the parameter full names that contains the parameter name (say "baa") in Python by something like:

lislis = [n for n in rospy.get_param_names() if "baa" in n]                                     

print(lislis)
['/namespace_foo/foobin/baa']

(Note Note that this snippet is obviously not robust.)robust, as it is not searching the param name specifically.

(Assumption: you know the parameter names and they won't change.)

I don't know if there's official API to achieve what you want. I've also browsed through issues and pull requests on ros_comm but couldn't find anything relevant.

You can find the parameter full names that contains the parameter name (say "baa") in Python by something like:

lislis = [n for n in rospy.get_param_names() if "baa" in n]                                     
n.rsplit('/', 1)[-1] == "baa"]

print(lislis)
['/namespace_foo/foobin/baa']

Note that this snippet is obviously not robust, as it is not searching the param name specifically.

(Assumption: you know the parameter names and they won't change.)

I don't know if there's official API to achieve what you want. I've also browsed through issues and pull requests on ros_comm but couldn't find anything relevant.

You can find the parameter full names that contains the parameter name (say "baa") in Python by something like:

lislis = [n for n in rospy.get_param_names() if n.rsplit('/', 1)[-1] == "baa"]

print(lislis)
['/namespace_foo/foobin/baa']

Note that this snippet is obviously not robust, as it is not searching the param name specifically.


UPDATE) I too wanted a way to search parameter names downward (i.e. "from left to right"). But AFAIK there's only upward search (e.g. search_param). My guess is that there can be multiple leaves of the parameter name (the right-most portion. E.g. "baa" in the example above) can exist (while the root of namespace must be unique) so that searching a leaf name can return multiple elements and thus won't be as useful.

(Assumption: you know the parameter names and they won't change.)

I don't know if there's official API to achieve what you want. I've also browsed through issues and pull requests on ros_comm but couldn't find anything relevant.

You can find the parameter full names that contains the parameter name (say "baa") in Python by something like:

lislis = [n for n in rospy.get_param_names() if n.rsplit('/', 1)[-1] == "baa"]

print(lislis)
['/namespace_foo/foobin/baa']

Note that this snippet is obviously not robust, as it is not searching the param name specifically.


UPDATE) I too wanted a way to search parameter names downward (i.e. "from left to right"). But AFAIK there's only upward search (e.g. search_param). My guess is that there can be multiple leaves of the parameter name (the right-most portion. E.g. "baa" in the example above) can exist (while the root of namespace must be unique) so that searching a leaf name can return multiple elements and thus won't be as useful.

useful (because it's hard to write a deterministic logic with multiple parameters returned?).