Package rosparam

Package rosparam

source code

Implementation of the rosparam as well as a library for modifying the state of the ROS Parameter Server using YAML files.

Classes
  RosParamException
rosparam base exception type
  RosParamIOException
Exception for communication-based (i/o) errors.
Functions
 
represent_xml_binary(loader, data)
Adds a pyyaml serializer to handle xmlrpclib.Binary objects
source code
 
represent_foo(loader, data) source code
 
construct_yaml_binary(loader, node)
Overrides pyaml's constructor for binary data.
source code
 
construct_angle_radians(loader, node)
python-yaml utility for converting rad(num) into float value
source code
 
construct_angle_degrees(loader, node)
python-yaml utility for converting deg(num) into float value
source code
 
print_params(params, ns)
Print contents of param dictionary to screen
source code
 
load_file(filename, default_namespace=None, verbose=False)
Load the YAML document from the specified file
source code
 
load_str(str, filename, default_namespace=None, verbose=False)
Load the YAML document as a string
source code
 
get_param_server() source code
 
get_param(param)
Download a parameter from Parameter Server
source code
 
dump_params(filename, param, verbose=False)
Download a parameter tree from the Parameter Server and store in a yaml file
source code
 
delete_param(param, verbose=False)
Delete a parameter from the Parameter Server
source code
 
set_param_raw(param, value, verbose=False)
Set param on the Parameter Server.
source code
 
set_param(param, value, verbose=False)
Set param on the ROS parameter server using a YAML value.
source code
 
upload_params(ns, values, verbose=False)
Upload params to the Parameter Server :param values: key/value dictionary, where keys are parameter names and values are parameter values, ``dict`` :param ns: namespace to load parameters into, ``str``
source code
 
list_params(ns)
Get list of parameters in ns
source code
 
yamlmain(argv=None)
Command-line main routine.
source code
Variables
  NAME = 'rosparam'
  NS = '_ns'
  pattern = re.compile(r'^rad\([^\)]*\)$')
  __package__ = 'rosparam'
Function Details

construct_yaml_binary(loader, node)

source code 

Overrides pyaml's constructor for binary data. Wraps binary data in xmlrpclib.Binary container instead of straight string representation.

load_file(filename, default_namespace=None, verbose=False)

source code 

Load the YAML document from the specified file

:param filename: name of filename, ``str``
:param default_namespace: namespace to load filename into, ``str``
:returns [(dict, str)...]: list of parameter dictionary and
  corresponding namespaces for each YAML document in the file
:raises: :exc:`RosParamException`: if unable to load contents of filename

load_str(str, filename, default_namespace=None, verbose=False)

source code 

Load the YAML document as a string

:param filename: name of filename, only used for debugging, ``str``
:param default_namespace: namespace to load filename into, ``str``
:param str: YAML text, ``str``
:returns: list of parameter dictionary and
    corresponding namespaces for each YAML document in the file, ``[(dict, str)...]``

get_param(param)

source code 

Download a parameter from Parameter Server

:param param: parameter name to retrieve from parameter
    server. If param is a parameter namespace, entire parameter
    subtree will be downloaded, ``str``

dump_params(filename, param, verbose=False)

source code 

Download a parameter tree from the Parameter Server and store in a yaml file

:param filename: name of file to save YAML representation, ``str`` :param param: name of parameter/namespace to dump, ``str`` :param verbose: print verbose output for debugging, ``bool``

delete_param(param, verbose=False)

source code 

Delete a parameter from the Parameter Server

:param param: parameter name, ``str`` :param verbose: print verbose output for debugging, ``bool``

set_param_raw(param, value, verbose=False)

source code 

Set param on the Parameter Server. Unlike set_param(), this takes in a Python value to set instead of YAML.

:param param: parameter name, ``str`` :param value XmlRpcLegalValue: value to upload, ``XmlRpcLegalValue``

set_param(param, value, verbose=False)

source code 

Set param on the ROS parameter server using a YAML value.

:param param: parameter name, ``str`` :param value: yaml-encoded value, ``str``

list_params(ns)

source code 

Get list of parameters in ns

:param ns: namespace to match, ``str``

yamlmain(argv=None)

source code 

Command-line main routine. Loads in one or more input files

:param argv: command-line arguments or None to use sys.argv, ``[str]``