$search
00001 """autogenerated by genmsg_py from ShadowPST.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class ShadowPST(roslib.message.Message): 00008 _md5sum = "ab86b3368a7316c12291b90583e1910e" 00009 _type = "sr_robot_msgs/ShadowPST" 00010 _has_header = True #flag to mark the presence of a Header object 00011 _full_text = """Header header 00012 int16[] pressure 00013 int16[] temperature 00014 00015 ================================================================================ 00016 MSG: std_msgs/Header 00017 # Standard metadata for higher-level stamped data types. 00018 # This is generally used to communicate timestamped data 00019 # in a particular coordinate frame. 00020 # 00021 # sequence ID: consecutively increasing ID 00022 uint32 seq 00023 #Two-integer timestamp that is expressed as: 00024 # * stamp.secs: seconds (stamp_secs) since epoch 00025 # * stamp.nsecs: nanoseconds since stamp_secs 00026 # time-handling sugar is provided by the client library 00027 time stamp 00028 #Frame this data is associated with 00029 # 0: no frame 00030 # 1: global frame 00031 string frame_id 00032 00033 """ 00034 __slots__ = ['header','pressure','temperature'] 00035 _slot_types = ['Header','int16[]','int16[]'] 00036 00037 def __init__(self, *args, **kwds): 00038 """ 00039 Constructor. Any message fields that are implicitly/explicitly 00040 set to None will be assigned a default value. The recommend 00041 use is keyword arguments as this is more robust to future message 00042 changes. You cannot mix in-order arguments and keyword arguments. 00043 00044 The available fields are: 00045 header,pressure,temperature 00046 00047 @param args: complete set of field values, in .msg order 00048 @param kwds: use keyword arguments corresponding to message field names 00049 to set specific fields. 00050 """ 00051 if args or kwds: 00052 super(ShadowPST, self).__init__(*args, **kwds) 00053 #message fields cannot be None, assign default values for those that are 00054 if self.header is None: 00055 self.header = std_msgs.msg._Header.Header() 00056 if self.pressure is None: 00057 self.pressure = [] 00058 if self.temperature is None: 00059 self.temperature = [] 00060 else: 00061 self.header = std_msgs.msg._Header.Header() 00062 self.pressure = [] 00063 self.temperature = [] 00064 00065 def _get_types(self): 00066 """ 00067 internal API method 00068 """ 00069 return self._slot_types 00070 00071 def serialize(self, buff): 00072 """ 00073 serialize message into buffer 00074 @param buff: buffer 00075 @type buff: StringIO 00076 """ 00077 try: 00078 _x = self 00079 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00080 _x = self.header.frame_id 00081 length = len(_x) 00082 buff.write(struct.pack('<I%ss'%length, length, _x)) 00083 length = len(self.pressure) 00084 buff.write(_struct_I.pack(length)) 00085 pattern = '<%sh'%length 00086 buff.write(struct.pack(pattern, *self.pressure)) 00087 length = len(self.temperature) 00088 buff.write(_struct_I.pack(length)) 00089 pattern = '<%sh'%length 00090 buff.write(struct.pack(pattern, *self.temperature)) 00091 except struct.error as se: self._check_types(se) 00092 except TypeError as te: self._check_types(te) 00093 00094 def deserialize(self, str): 00095 """ 00096 unpack serialized message in str into this message instance 00097 @param str: byte array of serialized message 00098 @type str: str 00099 """ 00100 try: 00101 if self.header is None: 00102 self.header = std_msgs.msg._Header.Header() 00103 end = 0 00104 _x = self 00105 start = end 00106 end += 12 00107 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00108 start = end 00109 end += 4 00110 (length,) = _struct_I.unpack(str[start:end]) 00111 start = end 00112 end += length 00113 self.header.frame_id = str[start:end] 00114 start = end 00115 end += 4 00116 (length,) = _struct_I.unpack(str[start:end]) 00117 pattern = '<%sh'%length 00118 start = end 00119 end += struct.calcsize(pattern) 00120 self.pressure = struct.unpack(pattern, str[start:end]) 00121 start = end 00122 end += 4 00123 (length,) = _struct_I.unpack(str[start:end]) 00124 pattern = '<%sh'%length 00125 start = end 00126 end += struct.calcsize(pattern) 00127 self.temperature = struct.unpack(pattern, str[start:end]) 00128 return self 00129 except struct.error as e: 00130 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00131 00132 00133 def serialize_numpy(self, buff, numpy): 00134 """ 00135 serialize message with numpy array types into buffer 00136 @param buff: buffer 00137 @type buff: StringIO 00138 @param numpy: numpy python module 00139 @type numpy module 00140 """ 00141 try: 00142 _x = self 00143 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00144 _x = self.header.frame_id 00145 length = len(_x) 00146 buff.write(struct.pack('<I%ss'%length, length, _x)) 00147 length = len(self.pressure) 00148 buff.write(_struct_I.pack(length)) 00149 pattern = '<%sh'%length 00150 buff.write(self.pressure.tostring()) 00151 length = len(self.temperature) 00152 buff.write(_struct_I.pack(length)) 00153 pattern = '<%sh'%length 00154 buff.write(self.temperature.tostring()) 00155 except struct.error as se: self._check_types(se) 00156 except TypeError as te: self._check_types(te) 00157 00158 def deserialize_numpy(self, str, numpy): 00159 """ 00160 unpack serialized message in str into this message instance using numpy for array types 00161 @param str: byte array of serialized message 00162 @type str: str 00163 @param numpy: numpy python module 00164 @type numpy: module 00165 """ 00166 try: 00167 if self.header is None: 00168 self.header = std_msgs.msg._Header.Header() 00169 end = 0 00170 _x = self 00171 start = end 00172 end += 12 00173 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00174 start = end 00175 end += 4 00176 (length,) = _struct_I.unpack(str[start:end]) 00177 start = end 00178 end += length 00179 self.header.frame_id = str[start:end] 00180 start = end 00181 end += 4 00182 (length,) = _struct_I.unpack(str[start:end]) 00183 pattern = '<%sh'%length 00184 start = end 00185 end += struct.calcsize(pattern) 00186 self.pressure = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=length) 00187 start = end 00188 end += 4 00189 (length,) = _struct_I.unpack(str[start:end]) 00190 pattern = '<%sh'%length 00191 start = end 00192 end += struct.calcsize(pattern) 00193 self.temperature = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=length) 00194 return self 00195 except struct.error as e: 00196 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00197 00198 _struct_I = roslib.message.struct_I 00199 _struct_3I = struct.Struct("<3I")