00001 """autogenerated by genpy from proximity_sensor_driver/proximity_sensor_measurement.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import std_msgs.msg
00008
00009 class proximity_sensor_measurement(genpy.Message):
00010 _md5sum = "73f5f29ac482ceb683fbc4b5d848cfa6"
00011 _type = "proximity_sensor_driver/proximity_sensor_measurement"
00012 _has_header = True
00013 _full_text = """Header header
00014 bool is_connected
00015 uint8 cell_count
00016 uint8[] value
00017 uint8[] offset
00018 uint8[] limit
00019 bool status_go
00020 bool status_err
00021 ================================================================================
00022 MSG: std_msgs/Header
00023 # Standard metadata for higher-level stamped data types.
00024 # This is generally used to communicate timestamped data
00025 # in a particular coordinate frame.
00026 #
00027 # sequence ID: consecutively increasing ID
00028 uint32 seq
00029 #Two-integer timestamp that is expressed as:
00030 # * stamp.secs: seconds (stamp_secs) since epoch
00031 # * stamp.nsecs: nanoseconds since stamp_secs
00032 # time-handling sugar is provided by the client library
00033 time stamp
00034 #Frame this data is associated with
00035 # 0: no frame
00036 # 1: global frame
00037 string frame_id
00038
00039 """
00040 __slots__ = ['header','is_connected','cell_count','value','offset','limit','status_go','status_err']
00041 _slot_types = ['std_msgs/Header','bool','uint8','uint8[]','uint8[]','uint8[]','bool','bool']
00042
00043 def __init__(self, *args, **kwds):
00044 """
00045 Constructor. Any message fields that are implicitly/explicitly
00046 set to None will be assigned a default value. The recommend
00047 use is keyword arguments as this is more robust to future message
00048 changes. You cannot mix in-order arguments and keyword arguments.
00049
00050 The available fields are:
00051 header,is_connected,cell_count,value,offset,limit,status_go,status_err
00052
00053 :param args: complete set of field values, in .msg order
00054 :param kwds: use keyword arguments corresponding to message field names
00055 to set specific fields.
00056 """
00057 if args or kwds:
00058 super(proximity_sensor_measurement, self).__init__(*args, **kwds)
00059
00060 if self.header is None:
00061 self.header = std_msgs.msg.Header()
00062 if self.is_connected is None:
00063 self.is_connected = False
00064 if self.cell_count is None:
00065 self.cell_count = 0
00066 if self.value is None:
00067 self.value = ''
00068 if self.offset is None:
00069 self.offset = ''
00070 if self.limit is None:
00071 self.limit = ''
00072 if self.status_go is None:
00073 self.status_go = False
00074 if self.status_err is None:
00075 self.status_err = False
00076 else:
00077 self.header = std_msgs.msg.Header()
00078 self.is_connected = False
00079 self.cell_count = 0
00080 self.value = ''
00081 self.offset = ''
00082 self.limit = ''
00083 self.status_go = False
00084 self.status_err = False
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_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00100 _x = self.header.frame_id
00101 length = len(_x)
00102 if python3 or type(_x) == unicode:
00103 _x = _x.encode('utf-8')
00104 length = len(_x)
00105 buff.write(struct.pack('<I%ss'%length, length, _x))
00106 _x = self
00107 buff.write(_struct_2B.pack(_x.is_connected, _x.cell_count))
00108 _x = self.value
00109 length = len(_x)
00110
00111 if type(_x) in [list, tuple]:
00112 buff.write(struct.pack('<I%sB'%length, length, *_x))
00113 else:
00114 buff.write(struct.pack('<I%ss'%length, length, _x))
00115 _x = self.offset
00116 length = len(_x)
00117
00118 if type(_x) in [list, tuple]:
00119 buff.write(struct.pack('<I%sB'%length, length, *_x))
00120 else:
00121 buff.write(struct.pack('<I%ss'%length, length, _x))
00122 _x = self.limit
00123 length = len(_x)
00124
00125 if type(_x) in [list, tuple]:
00126 buff.write(struct.pack('<I%sB'%length, length, *_x))
00127 else:
00128 buff.write(struct.pack('<I%ss'%length, length, _x))
00129 _x = self
00130 buff.write(_struct_2B.pack(_x.status_go, _x.status_err))
00131 except struct.error as se: self._check_types(se)
00132 except TypeError as te: self._check_types(te)
00133
00134 def deserialize(self, str):
00135 """
00136 unpack serialized message in str into this message instance
00137 :param str: byte array of serialized message, ``str``
00138 """
00139 try:
00140 if self.header is None:
00141 self.header = std_msgs.msg.Header()
00142 end = 0
00143 _x = self
00144 start = end
00145 end += 12
00146 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00147 start = end
00148 end += 4
00149 (length,) = _struct_I.unpack(str[start:end])
00150 start = end
00151 end += length
00152 if python3:
00153 self.header.frame_id = str[start:end].decode('utf-8')
00154 else:
00155 self.header.frame_id = str[start:end]
00156 _x = self
00157 start = end
00158 end += 2
00159 (_x.is_connected, _x.cell_count,) = _struct_2B.unpack(str[start:end])
00160 self.is_connected = bool(self.is_connected)
00161 start = end
00162 end += 4
00163 (length,) = _struct_I.unpack(str[start:end])
00164 start = end
00165 end += length
00166 if python3:
00167 self.value = str[start:end].decode('utf-8')
00168 else:
00169 self.value = str[start:end]
00170 start = end
00171 end += 4
00172 (length,) = _struct_I.unpack(str[start:end])
00173 start = end
00174 end += length
00175 if python3:
00176 self.offset = str[start:end].decode('utf-8')
00177 else:
00178 self.offset = str[start:end]
00179 start = end
00180 end += 4
00181 (length,) = _struct_I.unpack(str[start:end])
00182 start = end
00183 end += length
00184 if python3:
00185 self.limit = str[start:end].decode('utf-8')
00186 else:
00187 self.limit = str[start:end]
00188 _x = self
00189 start = end
00190 end += 2
00191 (_x.status_go, _x.status_err,) = _struct_2B.unpack(str[start:end])
00192 self.status_go = bool(self.status_go)
00193 self.status_err = bool(self.status_err)
00194 return self
00195 except struct.error as e:
00196 raise genpy.DeserializationError(e)
00197
00198
00199 def serialize_numpy(self, buff, numpy):
00200 """
00201 serialize message with numpy array types into buffer
00202 :param buff: buffer, ``StringIO``
00203 :param numpy: numpy python module
00204 """
00205 try:
00206 _x = self
00207 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00208 _x = self.header.frame_id
00209 length = len(_x)
00210 if python3 or type(_x) == unicode:
00211 _x = _x.encode('utf-8')
00212 length = len(_x)
00213 buff.write(struct.pack('<I%ss'%length, length, _x))
00214 _x = self
00215 buff.write(_struct_2B.pack(_x.is_connected, _x.cell_count))
00216 _x = self.value
00217 length = len(_x)
00218
00219 if type(_x) in [list, tuple]:
00220 buff.write(struct.pack('<I%sB'%length, length, *_x))
00221 else:
00222 buff.write(struct.pack('<I%ss'%length, length, _x))
00223 _x = self.offset
00224 length = len(_x)
00225
00226 if type(_x) in [list, tuple]:
00227 buff.write(struct.pack('<I%sB'%length, length, *_x))
00228 else:
00229 buff.write(struct.pack('<I%ss'%length, length, _x))
00230 _x = self.limit
00231 length = len(_x)
00232
00233 if type(_x) in [list, tuple]:
00234 buff.write(struct.pack('<I%sB'%length, length, *_x))
00235 else:
00236 buff.write(struct.pack('<I%ss'%length, length, _x))
00237 _x = self
00238 buff.write(_struct_2B.pack(_x.status_go, _x.status_err))
00239 except struct.error as se: self._check_types(se)
00240 except TypeError as te: self._check_types(te)
00241
00242 def deserialize_numpy(self, str, numpy):
00243 """
00244 unpack serialized message in str into this message instance using numpy for array types
00245 :param str: byte array of serialized message, ``str``
00246 :param numpy: numpy python module
00247 """
00248 try:
00249 if self.header is None:
00250 self.header = std_msgs.msg.Header()
00251 end = 0
00252 _x = self
00253 start = end
00254 end += 12
00255 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00256 start = end
00257 end += 4
00258 (length,) = _struct_I.unpack(str[start:end])
00259 start = end
00260 end += length
00261 if python3:
00262 self.header.frame_id = str[start:end].decode('utf-8')
00263 else:
00264 self.header.frame_id = str[start:end]
00265 _x = self
00266 start = end
00267 end += 2
00268 (_x.is_connected, _x.cell_count,) = _struct_2B.unpack(str[start:end])
00269 self.is_connected = bool(self.is_connected)
00270 start = end
00271 end += 4
00272 (length,) = _struct_I.unpack(str[start:end])
00273 start = end
00274 end += length
00275 if python3:
00276 self.value = str[start:end].decode('utf-8')
00277 else:
00278 self.value = str[start:end]
00279 start = end
00280 end += 4
00281 (length,) = _struct_I.unpack(str[start:end])
00282 start = end
00283 end += length
00284 if python3:
00285 self.offset = str[start:end].decode('utf-8')
00286 else:
00287 self.offset = str[start:end]
00288 start = end
00289 end += 4
00290 (length,) = _struct_I.unpack(str[start:end])
00291 start = end
00292 end += length
00293 if python3:
00294 self.limit = str[start:end].decode('utf-8')
00295 else:
00296 self.limit = str[start:end]
00297 _x = self
00298 start = end
00299 end += 2
00300 (_x.status_go, _x.status_err,) = _struct_2B.unpack(str[start:end])
00301 self.status_go = bool(self.status_go)
00302 self.status_err = bool(self.status_err)
00303 return self
00304 except struct.error as e:
00305 raise genpy.DeserializationError(e)
00306
00307 _struct_I = genpy.struct_I
00308 _struct_3I = struct.Struct("<3I")
00309 _struct_2B = struct.Struct("<2B")