$search
00001 """autogenerated by genmsg_py from RawData.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import applanix_msgs.msg 00006 00007 class RawData(roslib.message.Message): 00008 _md5sum = "4422a864e3d230d8a0aeaca79366f060" 00009 _type = "applanix_msgs/RawData" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# Groups 23, 24, 10001, 10007, 10008, 10011, 10012 00012 TimeDistance td 00013 00014 uint16 receiver_type 00015 uint32 reserved 00016 00017 uint8[] message 00018 00019 ================================================================================ 00020 MSG: applanix_msgs/TimeDistance 00021 float64 time1 00022 float64 time2 00023 float64 distance 00024 uint8 time_types 00025 uint8 distance_type 00026 00027 """ 00028 __slots__ = ['td','receiver_type','reserved','message'] 00029 _slot_types = ['applanix_msgs/TimeDistance','uint16','uint32','uint8[]'] 00030 00031 def __init__(self, *args, **kwds): 00032 """ 00033 Constructor. Any message fields that are implicitly/explicitly 00034 set to None will be assigned a default value. The recommend 00035 use is keyword arguments as this is more robust to future message 00036 changes. You cannot mix in-order arguments and keyword arguments. 00037 00038 The available fields are: 00039 td,receiver_type,reserved,message 00040 00041 @param args: complete set of field values, in .msg order 00042 @param kwds: use keyword arguments corresponding to message field names 00043 to set specific fields. 00044 """ 00045 if args or kwds: 00046 super(RawData, self).__init__(*args, **kwds) 00047 #message fields cannot be None, assign default values for those that are 00048 if self.td is None: 00049 self.td = applanix_msgs.msg.TimeDistance() 00050 if self.receiver_type is None: 00051 self.receiver_type = 0 00052 if self.reserved is None: 00053 self.reserved = 0 00054 if self.message is None: 00055 self.message = '' 00056 else: 00057 self.td = applanix_msgs.msg.TimeDistance() 00058 self.receiver_type = 0 00059 self.reserved = 0 00060 self.message = '' 00061 00062 def _get_types(self): 00063 """ 00064 internal API method 00065 """ 00066 return self._slot_types 00067 00068 def serialize(self, buff): 00069 """ 00070 serialize message into buffer 00071 @param buff: buffer 00072 @type buff: StringIO 00073 """ 00074 try: 00075 _x = self 00076 buff.write(_struct_3d2BHI.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.receiver_type, _x.reserved)) 00077 _x = self.message 00078 length = len(_x) 00079 # - if encoded as a list instead, serialize as bytes instead of string 00080 if type(_x) in [list, tuple]: 00081 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00082 else: 00083 buff.write(struct.pack('<I%ss'%length, length, _x)) 00084 except struct.error as se: self._check_types(se) 00085 except TypeError as te: self._check_types(te) 00086 00087 def deserialize(self, str): 00088 """ 00089 unpack serialized message in str into this message instance 00090 @param str: byte array of serialized message 00091 @type str: str 00092 """ 00093 try: 00094 if self.td is None: 00095 self.td = applanix_msgs.msg.TimeDistance() 00096 end = 0 00097 _x = self 00098 start = end 00099 end += 32 00100 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.receiver_type, _x.reserved,) = _struct_3d2BHI.unpack(str[start:end]) 00101 start = end 00102 end += 4 00103 (length,) = _struct_I.unpack(str[start:end]) 00104 start = end 00105 end += length 00106 self.message = str[start:end] 00107 return self 00108 except struct.error as e: 00109 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00110 00111 00112 def serialize_numpy(self, buff, numpy): 00113 """ 00114 serialize message with numpy array types into buffer 00115 @param buff: buffer 00116 @type buff: StringIO 00117 @param numpy: numpy python module 00118 @type numpy module 00119 """ 00120 try: 00121 _x = self 00122 buff.write(_struct_3d2BHI.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.receiver_type, _x.reserved)) 00123 _x = self.message 00124 length = len(_x) 00125 # - if encoded as a list instead, serialize as bytes instead of string 00126 if type(_x) in [list, tuple]: 00127 buff.write(struct.pack('<I%sB'%length, length, *_x)) 00128 else: 00129 buff.write(struct.pack('<I%ss'%length, length, _x)) 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 if self.td is None: 00143 self.td = applanix_msgs.msg.TimeDistance() 00144 end = 0 00145 _x = self 00146 start = end 00147 end += 32 00148 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.receiver_type, _x.reserved,) = _struct_3d2BHI.unpack(str[start:end]) 00149 start = end 00150 end += 4 00151 (length,) = _struct_I.unpack(str[start:end]) 00152 start = end 00153 end += length 00154 self.message = str[start:end] 00155 return self 00156 except struct.error as e: 00157 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00158 00159 _struct_I = roslib.message.struct_I 00160 _struct_3d2BHI = struct.Struct("<3d2BHI")