_ExecutiveState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from flirtlib_ros/ExecutiveState.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class ExecutiveState(genpy.Message):
00009   _md5sum = "87a76fce09087102a8a2c11f3e8fb6be"
00010   _type = "flirtlib_ros/ExecutiveState"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Will the node publish localization messages to reset amcl if possible?
00013 bool publishing_localization
00014 
00015 # How bad the current localization is
00016 float32 localization_badness
00017 
00018 # How many successful navigations have been observed so far
00019 uint32 successful_navs
00020 """
00021   __slots__ = ['publishing_localization','localization_badness','successful_navs']
00022   _slot_types = ['bool','float32','uint32']
00023 
00024   def __init__(self, *args, **kwds):
00025     """
00026     Constructor. Any message fields that are implicitly/explicitly
00027     set to None will be assigned a default value. The recommend
00028     use is keyword arguments as this is more robust to future message
00029     changes.  You cannot mix in-order arguments and keyword arguments.
00030 
00031     The available fields are:
00032        publishing_localization,localization_badness,successful_navs
00033 
00034     :param args: complete set of field values, in .msg order
00035     :param kwds: use keyword arguments corresponding to message field names
00036     to set specific fields.
00037     """
00038     if args or kwds:
00039       super(ExecutiveState, self).__init__(*args, **kwds)
00040       #message fields cannot be None, assign default values for those that are
00041       if self.publishing_localization is None:
00042         self.publishing_localization = False
00043       if self.localization_badness is None:
00044         self.localization_badness = 0.
00045       if self.successful_navs is None:
00046         self.successful_navs = 0
00047     else:
00048       self.publishing_localization = False
00049       self.localization_badness = 0.
00050       self.successful_navs = 0
00051 
00052   def _get_types(self):
00053     """
00054     internal API method
00055     """
00056     return self._slot_types
00057 
00058   def serialize(self, buff):
00059     """
00060     serialize message into buffer
00061     :param buff: buffer, ``StringIO``
00062     """
00063     try:
00064       _x = self
00065       buff.write(_struct_BfI.pack(_x.publishing_localization, _x.localization_badness, _x.successful_navs))
00066     except struct.error as se: self._check_types(se)
00067     except TypeError as te: self._check_types(te)
00068 
00069   def deserialize(self, str):
00070     """
00071     unpack serialized message in str into this message instance
00072     :param str: byte array of serialized message, ``str``
00073     """
00074     try:
00075       end = 0
00076       _x = self
00077       start = end
00078       end += 9
00079       (_x.publishing_localization, _x.localization_badness, _x.successful_navs,) = _struct_BfI.unpack(str[start:end])
00080       self.publishing_localization = bool(self.publishing_localization)
00081       return self
00082     except struct.error as e:
00083       raise genpy.DeserializationError(e) #most likely buffer underfill
00084 
00085 
00086   def serialize_numpy(self, buff, numpy):
00087     """
00088     serialize message with numpy array types into buffer
00089     :param buff: buffer, ``StringIO``
00090     :param numpy: numpy python module
00091     """
00092     try:
00093       _x = self
00094       buff.write(_struct_BfI.pack(_x.publishing_localization, _x.localization_badness, _x.successful_navs))
00095     except struct.error as se: self._check_types(se)
00096     except TypeError as te: self._check_types(te)
00097 
00098   def deserialize_numpy(self, str, numpy):
00099     """
00100     unpack serialized message in str into this message instance using numpy for array types
00101     :param str: byte array of serialized message, ``str``
00102     :param numpy: numpy python module
00103     """
00104     try:
00105       end = 0
00106       _x = self
00107       start = end
00108       end += 9
00109       (_x.publishing_localization, _x.localization_badness, _x.successful_navs,) = _struct_BfI.unpack(str[start:end])
00110       self.publishing_localization = bool(self.publishing_localization)
00111       return self
00112     except struct.error as e:
00113       raise genpy.DeserializationError(e) #most likely buffer underfill
00114 
00115 _struct_I = genpy.struct_I
00116 _struct_BfI = struct.Struct("<BfI")


flirtlib_ros
Author(s): Bhaskara Marthi
autogenerated on Thu Nov 28 2013 11:21:50