Table Of Contents

Previous topic

User macro reference

Next topic

Developer documenation

This Page

genmsg Python API

Classes

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

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()
Returns:zip list of types and names (e.g. [(‘int32’, ‘x’), (‘int32’, ‘y’)], [(str,str),]
has_header()
Returns:True if msg decription contains a ‘Header header’

declaration at the beginning, bool

parsed_fields()
Returns:list of Field classes, [Field,]
class genmsg.SrvSpec(request, response, text, full_name='', short_name='', package='')
class genmsg.Constant(type_, name, val, val_text)

Container class for holding a Constant declaration

Attributes:

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

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