Package roslib :: Module gentools
[frames] | no frames]

Module gentools

source code

Library for supporting message and service generation for all ROS client libraries. This is mainly responsible for calculating the md5sums and message definitions of classes.

Functions
str
compute_md5_text(get_deps_dict, spec, rospack=None)
Compute the text used for md5 calculation.
source code
str
compute_md5_v1(get_deps_dict)
Compute original V1 md5 hash for message/service.
source code
str
compute_md5(get_deps_dict, rospack=None)
Compute md5 hash for message/service
source code
str
compute_md5_v2(get_deps_dict, rospack=None)
Compute md5 hash for message/service
source code
str
compute_full_text(get_deps_dict)
Compute full text of message/service, including text of embedded types.
source code
dict
get_file_dependencies(f, stdout=sys.stderr, stderr=sys.stderr, rospack=None)
Compute dependencies of the specified message/service file
source code
dict
get_dependencies(spec, package, compute_files=True, stdout=sys.stderr, stderr=sys.stderr, rospack=None)
Compute dependencies of the specified Msgs/Srvs
source code
Variables
  __package__ = 'roslib'
Function Details

compute_md5_text(get_deps_dict, spec, rospack=None)

source code 

Compute the text used for md5 calculation. MD5 spec states that we removes comments and non-meaningful whitespace. We also strip packages names from type names. For convenience sake, constants are reordered ahead of other declarations, in the order that they were originally defined.

Returns: str
text for ROS MD5-processing

compute_md5_v1(get_deps_dict)

source code 

Compute original V1 md5 hash for message/service. This was replaced with V2 in ROS 0.6.

Parameters:
  • get_deps_dict (dict) - dictionary returned by get_dependencies call
Returns: str
md5 hash

compute_md5(get_deps_dict, rospack=None)

source code 

Compute md5 hash for message/service

Parameters:
  • get_deps_dict (dict), dict - dictionary returned by get_dependencies call
Returns: str
md5 hash

compute_md5_v2(get_deps_dict, rospack=None)

source code 

Compute md5 hash for message/service

Parameters:
  • get_deps_dict (dict), dict - dictionary returned by get_dependencies call
Returns: str
md5 hash

compute_full_text(get_deps_dict)

source code 

Compute full text of message/service, including text of embedded types. The text of the main msg/srv is listed first. Embedded msg/srv files are denoted first by an 80-character '=' separator, followed by a type declaration line,'MSG: pkg/type', followed by the text of the embedded type.

Parameters:
  • get_deps_dict (dict), dict - dictionary returned by get_dependencies call
Returns: str
concatenated text for msg/srv file and embedded msg/srv types.

get_file_dependencies(f, stdout=sys.stderr, stderr=sys.stderr, rospack=None)

source code 

Compute dependencies of the specified message/service file

Parameters:
  • f (str) - message or service file to get dependencies for
  • stdout (file), pipe - stdout pipe
  • stderr (file), pipe - stderr pipe
Returns: dict
'files': list of files that  file depends on, 'deps': list of dependencies by type, 'spec': Msgs/Srvs instance.

get_dependencies(spec, package, compute_files=True, stdout=sys.stderr, stderr=sys.stderr, rospack=None)

source code 

Compute dependencies of the specified Msgs/Srvs

Parameters:
  • spec (roslib.msgs.MsgSpec/roslib.srvs.SrvSpec) - message or service instance
  • package (str) - package name
  • stdout (file) - (optional) stdout pipe
  • stderr (file) - (optional) stderr pipe
  • compute_files (bool) - (optional, default=True) compute file dependencies of message ('files' key in return value)
Returns: dict
dict: * 'files': list of files that  file depends on * 'deps': list of dependencies by type * 'spec': Msgs/Srvs instance. * 'uniquedeps': list of dependencies with duplicates removed, * 'package': package that dependencies were generated relative to.