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