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