roslua: ROS client library for Lua

Module roslua.srv_spec

Service specification. This module contains the SrvSpec class to read and represent ROS service specification (YAML files). Service specifications should be obtained by using the get_srvspec() function, which is aliased for convenience as roslua.get_srvspec().

The service files are read on the fly, no offline code generation is necessary. This avoids the need to write yet another code generator. After reading the service specifications contains two fields, the reqspec field contains the request message specification, the respspec field contains the response message specification.

Copyright© Tim Niemueller, Carnegie Mellon University, Intel Research Pittsburgh

Release: Released under BSD license

Functions

SrvSpec:load () Load service specification from file.
SrvSpec:load_from_string (s) Load specification from string.
SrvSpec:md5 () Get MD5 sum of type specification.
SrvSpec:new (o) Constructor.
SrvSpec:print (indent) Print specification.
get_srvspec (srv_type) Get service specification.
is_srvspec (testobj) Check if the given object is a message spec.


Functions

SrvSpec:load ()
Load service specification from file. Will search for the appropriate service specification file (using rospack) and will then read and parse the file.
SrvSpec:load_from_string (s)
Load specification from string.

Parameters

  • s: string containing the service specification
SrvSpec:md5 ()
Get MD5 sum of type specification. This will create a text representation of the service specification and generate the MD5 sum for it. The value is cached so concurrent calls will cause the cached value to be returned

Return value:

MD5 sum of message specification
SrvSpec:new (o)
Constructor.

Parameters

  • o: Object initializer, must contain a field type with the string representation of the type name.
SrvSpec:print (indent)
Print specification.

Parameters

  • indent: string (normally spaces) to put before every line of output
get_srvspec (srv_type)
Get service specification. It is recommended to use the aliased version roslua.get_srvspec().

Parameters

  • srv_type: service type (e.g. std_msgs/String). The name must include the package.
is_srvspec (testobj)
Check if the given object is a message spec.

Parameters

  • testobj: object to test

Return value:

true if testobj is a message spec, false otherwise

Valid XHTML 1.0!