genmsg Python API

Classes

class genmsg.MsgSpec(types, names, constants, text, full_name, package='', short_name='')[source]

Container class for storing loaded msg description files. Field types and names are stored in separate lists with 1-to-1 correspondence. MsgSpec can also return an md5 of the source text.

fields()[source]
Returns:zip list of types and names (e.g. [(‘int32’, ‘x’), (‘int32’, ‘y’)], [(str,str),]
has_header()[source]
Returns:True if msg decription contains a ‘Header header’ declaration at the beginning, bool
parsed_fields()[source]
Returns:list of Field classes, [Field,]
class genmsg.SrvSpec(request, response, text, full_name='', short_name='', package='')[source]
class genmsg.Constant(type_, name, val, val_text)[source]

Container class for holding a Constant declaration

Attributes:

  • type
  • name
  • val
  • val_text
class genmsg.Field(name, type)[source]

Container class for storing information about a single field in a MsgSpec

Attributes:

  • name
  • type
  • base_type
  • is_array
  • array_len
  • is_builtin
  • is_header