_COMPortMessages.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/COMPortMessages.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 COMPortMessages(genpy.Message):
00009   _md5sum = "88218ad4124322a799282c496fb3a33f"
00010   _type = "applanix_msgs/COMPortMessages"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint8 port_num
00013 
00014 uint32 MESSAGES_NMEA_GST=1
00015 uint32 MESSAGES_NMEA_GGA=2
00016 uint32 MESSAGES_NMEA_HDT=4
00017 uint32 MESSAGES_NMEA_ZDA=8
00018 uint32 MESSAGES_NMEA_EVT1=16
00019 uint32 MESSAGES_NMEA_EVT2=32
00020 uint32 MESSAGES_NMEA_VTG=64
00021 uint32 MESSAGES_NMEA_PASHR=128
00022 uint32 MESSAGES_NMEA_GGA2=8192
00023 uint32 MESSAGES_NMEA_PPS=16384
00024 uint32 MESSAGES_NMEA_GGK=32768
00025 uint32 MESSAGES_NMEA_RMC=65536
00026 uint32 MESSAGES_BIN_GIMBAL_LOOP=1
00027 uint32 MESSAGES_BIN_RDR1=2
00028 uint32 MESSAGES_BIN_PAST2=4
00029 uint32 MESSAGES_BIN_PPS=65536
00030 uint32 MESSAGES_BIN_TM1B=131072
00031 uint32 messages
00032 
00033 uint8 update_rate
00034 
00035 """
00036   # Pseudo-constants
00037   MESSAGES_NMEA_GST = 1
00038   MESSAGES_NMEA_GGA = 2
00039   MESSAGES_NMEA_HDT = 4
00040   MESSAGES_NMEA_ZDA = 8
00041   MESSAGES_NMEA_EVT1 = 16
00042   MESSAGES_NMEA_EVT2 = 32
00043   MESSAGES_NMEA_VTG = 64
00044   MESSAGES_NMEA_PASHR = 128
00045   MESSAGES_NMEA_GGA2 = 8192
00046   MESSAGES_NMEA_PPS = 16384
00047   MESSAGES_NMEA_GGK = 32768
00048   MESSAGES_NMEA_RMC = 65536
00049   MESSAGES_BIN_GIMBAL_LOOP = 1
00050   MESSAGES_BIN_RDR1 = 2
00051   MESSAGES_BIN_PAST2 = 4
00052   MESSAGES_BIN_PPS = 65536
00053   MESSAGES_BIN_TM1B = 131072
00054 
00055   __slots__ = ['port_num','messages','update_rate']
00056   _slot_types = ['uint8','uint32','uint8']
00057 
00058   def __init__(self, *args, **kwds):
00059     """
00060     Constructor. Any message fields that are implicitly/explicitly
00061     set to None will be assigned a default value. The recommend
00062     use is keyword arguments as this is more robust to future message
00063     changes.  You cannot mix in-order arguments and keyword arguments.
00064 
00065     The available fields are:
00066        port_num,messages,update_rate
00067 
00068     :param args: complete set of field values, in .msg order
00069     :param kwds: use keyword arguments corresponding to message field names
00070     to set specific fields.
00071     """
00072     if args or kwds:
00073       super(COMPortMessages, self).__init__(*args, **kwds)
00074       #message fields cannot be None, assign default values for those that are
00075       if self.port_num is None:
00076         self.port_num = 0
00077       if self.messages is None:
00078         self.messages = 0
00079       if self.update_rate is None:
00080         self.update_rate = 0
00081     else:
00082       self.port_num = 0
00083       self.messages = 0
00084       self.update_rate = 0
00085 
00086   def _get_types(self):
00087     """
00088     internal API method
00089     """
00090     return self._slot_types
00091 
00092   def serialize(self, buff):
00093     """
00094     serialize message into buffer
00095     :param buff: buffer, ``StringIO``
00096     """
00097     try:
00098       _x = self
00099       buff.write(_struct_BIB.pack(_x.port_num, _x.messages, _x.update_rate))
00100     except struct.error as se: self._check_types(se)
00101     except TypeError as te: self._check_types(te)
00102 
00103   def deserialize(self, str):
00104     """
00105     unpack serialized message in str into this message instance
00106     :param str: byte array of serialized message, ``str``
00107     """
00108     try:
00109       end = 0
00110       _x = self
00111       start = end
00112       end += 6
00113       (_x.port_num, _x.messages, _x.update_rate,) = _struct_BIB.unpack(str[start:end])
00114       return self
00115     except struct.error as e:
00116       raise genpy.DeserializationError(e) #most likely buffer underfill
00117 
00118 
00119   def serialize_numpy(self, buff, numpy):
00120     """
00121     serialize message with numpy array types into buffer
00122     :param buff: buffer, ``StringIO``
00123     :param numpy: numpy python module
00124     """
00125     try:
00126       _x = self
00127       buff.write(_struct_BIB.pack(_x.port_num, _x.messages, _x.update_rate))
00128     except struct.error as se: self._check_types(se)
00129     except TypeError as te: self._check_types(te)
00130 
00131   def deserialize_numpy(self, str, numpy):
00132     """
00133     unpack serialized message in str into this message instance using numpy for array types
00134     :param str: byte array of serialized message, ``str``
00135     :param numpy: numpy python module
00136     """
00137     try:
00138       end = 0
00139       _x = self
00140       start = end
00141       end += 6
00142       (_x.port_num, _x.messages, _x.update_rate,) = _struct_BIB.unpack(str[start:end])
00143       return self
00144     except struct.error as e:
00145       raise genpy.DeserializationError(e) #most likely buffer underfill
00146 
00147 _struct_I = genpy.struct_I
00148 _struct_BIB = struct.Struct("<BIB")


applanix_msgs
Author(s): Mike Purvis
autogenerated on Thu Jan 2 2014 11:04:51