00001 """autogenerated by genpy from srs_leg_detector/DetectLegsRequest.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 DetectLegsRequest(genpy.Message):
00009 _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
00010 _type = "srs_leg_detector/DetectLegsRequest"
00011 _has_header = False
00012 _full_text = """
00013
00014 """
00015 __slots__ = []
00016 _slot_types = []
00017
00018 def __init__(self, *args, **kwds):
00019 """
00020 Constructor. Any message fields that are implicitly/explicitly
00021 set to None will be assigned a default value. The recommend
00022 use is keyword arguments as this is more robust to future message
00023 changes. You cannot mix in-order arguments and keyword arguments.
00024
00025 The available fields are:
00026
00027
00028 :param args: complete set of field values, in .msg order
00029 :param kwds: use keyword arguments corresponding to message field names
00030 to set specific fields.
00031 """
00032 if args or kwds:
00033 super(DetectLegsRequest, self).__init__(*args, **kwds)
00034
00035 def _get_types(self):
00036 """
00037 internal API method
00038 """
00039 return self._slot_types
00040
00041 def serialize(self, buff):
00042 """
00043 serialize message into buffer
00044 :param buff: buffer, ``StringIO``
00045 """
00046 try:
00047 pass
00048 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00049 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00050
00051 def deserialize(self, str):
00052 """
00053 unpack serialized message in str into this message instance
00054 :param str: byte array of serialized message, ``str``
00055 """
00056 try:
00057 end = 0
00058 return self
00059 except struct.error as e:
00060 raise genpy.DeserializationError(e)
00061
00062
00063 def serialize_numpy(self, buff, numpy):
00064 """
00065 serialize message with numpy array types into buffer
00066 :param buff: buffer, ``StringIO``
00067 :param numpy: numpy python module
00068 """
00069 try:
00070 pass
00071 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00072 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00073
00074 def deserialize_numpy(self, str, numpy):
00075 """
00076 unpack serialized message in str into this message instance using numpy for array types
00077 :param str: byte array of serialized message, ``str``
00078 :param numpy: numpy python module
00079 """
00080 try:
00081 end = 0
00082 return self
00083 except struct.error as e:
00084 raise genpy.DeserializationError(e)
00085
00086 _struct_I = genpy.struct_I
00087 """autogenerated by genpy from srs_leg_detector/DetectLegsResponse.msg. Do not edit."""
00088 import sys
00089 python3 = True if sys.hexversion > 0x03000000 else False
00090 import genpy
00091 import struct
00092
00093 import geometry_msgs.msg
00094 import std_msgs.msg
00095 import sensor_msgs.msg
00096
00097 class DetectLegsResponse(genpy.Message):
00098 _md5sum = "941854f3e81fd64b94eaa0d5b1ad95e1"
00099 _type = "srs_leg_detector/DetectLegsResponse"
00100 _has_header = False
00101 _full_text = """
00102 sensor_msgs/PointCloud leg_list
00103
00104
00105 ================================================================================
00106 MSG: sensor_msgs/PointCloud
00107 # This message holds a collection of 3d points, plus optional additional
00108 # information about each point.
00109
00110 # Time of sensor data acquisition, coordinate frame ID.
00111 Header header
00112
00113 # Array of 3d points. Each Point32 should be interpreted as a 3d point
00114 # in the frame given in the header.
00115 geometry_msgs/Point32[] points
00116
00117 # Each channel should have the same number of elements as points array,
00118 # and the data in each channel should correspond 1:1 with each point.
00119 # Channel names in common practice are listed in ChannelFloat32.msg.
00120 ChannelFloat32[] channels
00121
00122 ================================================================================
00123 MSG: std_msgs/Header
00124 # Standard metadata for higher-level stamped data types.
00125 # This is generally used to communicate timestamped data
00126 # in a particular coordinate frame.
00127 #
00128 # sequence ID: consecutively increasing ID
00129 uint32 seq
00130 #Two-integer timestamp that is expressed as:
00131 # * stamp.secs: seconds (stamp_secs) since epoch
00132 # * stamp.nsecs: nanoseconds since stamp_secs
00133 # time-handling sugar is provided by the client library
00134 time stamp
00135 #Frame this data is associated with
00136 # 0: no frame
00137 # 1: global frame
00138 string frame_id
00139
00140 ================================================================================
00141 MSG: geometry_msgs/Point32
00142 # This contains the position of a point in free space(with 32 bits of precision).
00143 # It is recommeded to use Point wherever possible instead of Point32.
00144 #
00145 # This recommendation is to promote interoperability.
00146 #
00147 # This message is designed to take up less space when sending
00148 # lots of points at once, as in the case of a PointCloud.
00149
00150 float32 x
00151 float32 y
00152 float32 z
00153 ================================================================================
00154 MSG: sensor_msgs/ChannelFloat32
00155 # This message is used by the PointCloud message to hold optional data
00156 # associated with each point in the cloud. The length of the values
00157 # array should be the same as the length of the points array in the
00158 # PointCloud, and each value should be associated with the corresponding
00159 # point.
00160
00161 # Channel names in existing practice include:
00162 # "u", "v" - row and column (respectively) in the left stereo image.
00163 # This is opposite to usual conventions but remains for
00164 # historical reasons. The newer PointCloud2 message has no
00165 # such problem.
00166 # "rgb" - For point clouds produced by color stereo cameras. uint8
00167 # (R,G,B) values packed into the least significant 24 bits,
00168 # in order.
00169 # "intensity" - laser or pixel intensity.
00170 # "distance"
00171
00172 # The channel name should give semantics of the channel (e.g.
00173 # "intensity" instead of "value").
00174 string name
00175
00176 # The values array should be 1-1 with the elements of the associated
00177 # PointCloud.
00178 float32[] values
00179
00180 """
00181 __slots__ = ['leg_list']
00182 _slot_types = ['sensor_msgs/PointCloud']
00183
00184 def __init__(self, *args, **kwds):
00185 """
00186 Constructor. Any message fields that are implicitly/explicitly
00187 set to None will be assigned a default value. The recommend
00188 use is keyword arguments as this is more robust to future message
00189 changes. You cannot mix in-order arguments and keyword arguments.
00190
00191 The available fields are:
00192 leg_list
00193
00194 :param args: complete set of field values, in .msg order
00195 :param kwds: use keyword arguments corresponding to message field names
00196 to set specific fields.
00197 """
00198 if args or kwds:
00199 super(DetectLegsResponse, self).__init__(*args, **kwds)
00200 #message fields cannot be None, assign default values for those that are
00201 if self.leg_list is None:
00202 self.leg_list = sensor_msgs.msg.PointCloud()
00203 else:
00204 self.leg_list = sensor_msgs.msg.PointCloud()
00205
00206 def _get_types(self):
00207 """
00208 internal API method
00209 """
00210 return self._slot_types
00211
00212 def serialize(self, buff):
00213 """
00214 serialize message into buffer
00215 :param buff: buffer, ``StringIO``
00216 """
00217 try:
00218 _x = self
00219 buff.write(_struct_3I.pack(_x.leg_list.header.seq, _x.leg_list.header.stamp.secs, _x.leg_list.header.stamp.nsecs))
00220 _x = self.leg_list.header.frame_id
00221 length = len(_x)
00222 if python3 or type(_x) == unicode:
00223 _x = _x.encode('utf-8')
00224 length = len(_x)
00225 buff.write(struct.pack('<I%ss'%length, length, _x))
00226 length = len(self.leg_list.points)
00227 buff.write(_struct_I.pack(length))
00228 for val1 in self.leg_list.points:
00229 _x = val1
00230 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00231 length = len(self.leg_list.channels)
00232 buff.write(_struct_I.pack(length))
00233 for val1 in self.leg_list.channels:
00234 _x = val1.name
00235 length = len(_x)
00236 if python3 or type(_x) == unicode:
00237 _x = _x.encode('utf-8')
00238 length = len(_x)
00239 buff.write(struct.pack('<I%ss'%length, length, _x))
00240 length = len(val1.values)
00241 buff.write(_struct_I.pack(length))
00242 pattern = '<%sf'%length
00243 buff.write(struct.pack(pattern, *val1.values))
00244 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00245 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00246
00247 def deserialize(self, str):
00248 """
00249 unpack serialized message in str into this message instance
00250 :param str: byte array of serialized message, ``str``
00251 """
00252 try:
00253 if self.leg_list is None:
00254 self.leg_list = sensor_msgs.msg.PointCloud()
00255 end = 0
00256 _x = self
00257 start = end
00258 end += 12
00259 (_x.leg_list.header.seq, _x.leg_list.header.stamp.secs, _x.leg_list.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00260 start = end
00261 end += 4
00262 (length,) = _struct_I.unpack(str[start:end])
00263 start = end
00264 end += length
00265 if python3:
00266 self.leg_list.header.frame_id = str[start:end].decode('utf-8')
00267 else:
00268 self.leg_list.header.frame_id = str[start:end]
00269 start = end
00270 end += 4
00271 (length,) = _struct_I.unpack(str[start:end])
00272 self.leg_list.points = []
00273 for i in range(0, length):
00274 val1 = geometry_msgs.msg.Point32()
00275 _x = val1
00276 start = end
00277 end += 12
00278 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00279 self.leg_list.points.append(val1)
00280 start = end
00281 end += 4
00282 (length,) = _struct_I.unpack(str[start:end])
00283 self.leg_list.channels = []
00284 for i in range(0, length):
00285 val1 = sensor_msgs.msg.ChannelFloat32()
00286 start = end
00287 end += 4
00288 (length,) = _struct_I.unpack(str[start:end])
00289 start = end
00290 end += length
00291 if python3:
00292 val1.name = str[start:end].decode('utf-8')
00293 else:
00294 val1.name = str[start:end]
00295 start = end
00296 end += 4
00297 (length,) = _struct_I.unpack(str[start:end])
00298 pattern = '<%sf'%length
00299 start = end
00300 end += struct.calcsize(pattern)
00301 val1.values = struct.unpack(pattern, str[start:end])
00302 self.leg_list.channels.append(val1)
00303 return self
00304 except struct.error as e:
00305 raise genpy.DeserializationError(e) #most likely buffer underfill
00306
00307
00308 def serialize_numpy(self, buff, numpy):
00309 """
00310 serialize message with numpy array types into buffer
00311 :param buff: buffer, ``StringIO``
00312 :param numpy: numpy python module
00313 """
00314 try:
00315 _x = self
00316 buff.write(_struct_3I.pack(_x.leg_list.header.seq, _x.leg_list.header.stamp.secs, _x.leg_list.header.stamp.nsecs))
00317 _x = self.leg_list.header.frame_id
00318 length = len(_x)
00319 if python3 or type(_x) == unicode:
00320 _x = _x.encode('utf-8')
00321 length = len(_x)
00322 buff.write(struct.pack('<I%ss'%length, length, _x))
00323 length = len(self.leg_list.points)
00324 buff.write(_struct_I.pack(length))
00325 for val1 in self.leg_list.points:
00326 _x = val1
00327 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00328 length = len(self.leg_list.channels)
00329 buff.write(_struct_I.pack(length))
00330 for val1 in self.leg_list.channels:
00331 _x = val1.name
00332 length = len(_x)
00333 if python3 or type(_x) == unicode:
00334 _x = _x.encode('utf-8')
00335 length = len(_x)
00336 buff.write(struct.pack('<I%ss'%length, length, _x))
00337 length = len(val1.values)
00338 buff.write(_struct_I.pack(length))
00339 pattern = '<%sf'%length
00340 buff.write(val1.values.tostring())
00341 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00342 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00343
00344 def deserialize_numpy(self, str, numpy):
00345 """
00346 unpack serialized message in str into this message instance using numpy for array types
00347 :param str: byte array of serialized message, ``str``
00348 :param numpy: numpy python module
00349 """
00350 try:
00351 if self.leg_list is None:
00352 self.leg_list = sensor_msgs.msg.PointCloud()
00353 end = 0
00354 _x = self
00355 start = end
00356 end += 12
00357 (_x.leg_list.header.seq, _x.leg_list.header.stamp.secs, _x.leg_list.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00358 start = end
00359 end += 4
00360 (length,) = _struct_I.unpack(str[start:end])
00361 start = end
00362 end += length
00363 if python3:
00364 self.leg_list.header.frame_id = str[start:end].decode('utf-8')
00365 else:
00366 self.leg_list.header.frame_id = str[start:end]
00367 start = end
00368 end += 4
00369 (length,) = _struct_I.unpack(str[start:end])
00370 self.leg_list.points = []
00371 for i in range(0, length):
00372 val1 = geometry_msgs.msg.Point32()
00373 _x = val1
00374 start = end
00375 end += 12
00376 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00377 self.leg_list.points.append(val1)
00378 start = end
00379 end += 4
00380 (length,) = _struct_I.unpack(str[start:end])
00381 self.leg_list.channels = []
00382 for i in range(0, length):
00383 val1 = sensor_msgs.msg.ChannelFloat32()
00384 start = end
00385 end += 4
00386 (length,) = _struct_I.unpack(str[start:end])
00387 start = end
00388 end += length
00389 if python3:
00390 val1.name = str[start:end].decode('utf-8')
00391 else:
00392 val1.name = str[start:end]
00393 start = end
00394 end += 4
00395 (length,) = _struct_I.unpack(str[start:end])
00396 pattern = '<%sf'%length
00397 start = end
00398 end += struct.calcsize(pattern)
00399 val1.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00400 self.leg_list.channels.append(val1)
00401 return self
00402 except struct.error as e:
00403 raise genpy.DeserializationError(e) #most likely buffer underfill
00404
00405 _struct_I = genpy.struct_I
00406 _struct_3I = struct.Struct("<3I")
00407 _struct_3f = struct.Struct("<3f")
00408 class DetectLegs(object):
00409 _type = 'srs_leg_detector/DetectLegs'
00410 _md5sum = '941854f3e81fd64b94eaa0d5b1ad95e1'
00411 _request_class = DetectLegsRequest
00412 _response_class = DetectLegsResponse