$search
00001 """autogenerated by genmsg_py from estimateRigidRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 00007 class estimateRigidRequest(roslib.message.Message): 00008 _md5sum = "eaeb4f6d418a85830ffa122d5a7a9cc8" 00009 _type = "pr2_interactive_segmentation/estimateRigidRequest" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """geometry_msgs/Point[] features_old 00012 geometry_msgs/Point[] features_new 00013 00014 ================================================================================ 00015 MSG: geometry_msgs/Point 00016 # This contains the position of a point in free space 00017 float64 x 00018 float64 y 00019 float64 z 00020 00021 """ 00022 __slots__ = ['features_old','features_new'] 00023 _slot_types = ['geometry_msgs/Point[]','geometry_msgs/Point[]'] 00024 00025 def __init__(self, *args, **kwds): 00026 """ 00027 Constructor. Any message fields that are implicitly/explicitly 00028 set to None will be assigned a default value. The recommend 00029 use is keyword arguments as this is more robust to future message 00030 changes. You cannot mix in-order arguments and keyword arguments. 00031 00032 The available fields are: 00033 features_old,features_new 00034 00035 @param args: complete set of field values, in .msg order 00036 @param kwds: use keyword arguments corresponding to message field names 00037 to set specific fields. 00038 """ 00039 if args or kwds: 00040 super(estimateRigidRequest, self).__init__(*args, **kwds) 00041 #message fields cannot be None, assign default values for those that are 00042 if self.features_old is None: 00043 self.features_old = [] 00044 if self.features_new is None: 00045 self.features_new = [] 00046 else: 00047 self.features_old = [] 00048 self.features_new = [] 00049 00050 def _get_types(self): 00051 """ 00052 internal API method 00053 """ 00054 return self._slot_types 00055 00056 def serialize(self, buff): 00057 """ 00058 serialize message into buffer 00059 @param buff: buffer 00060 @type buff: StringIO 00061 """ 00062 try: 00063 length = len(self.features_old) 00064 buff.write(_struct_I.pack(length)) 00065 for val1 in self.features_old: 00066 _x = val1 00067 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00068 length = len(self.features_new) 00069 buff.write(_struct_I.pack(length)) 00070 for val1 in self.features_new: 00071 _x = val1 00072 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00073 except struct.error as se: self._check_types(se) 00074 except TypeError as te: self._check_types(te) 00075 00076 def deserialize(self, str): 00077 """ 00078 unpack serialized message in str into this message instance 00079 @param str: byte array of serialized message 00080 @type str: str 00081 """ 00082 try: 00083 end = 0 00084 start = end 00085 end += 4 00086 (length,) = _struct_I.unpack(str[start:end]) 00087 self.features_old = [] 00088 for i in range(0, length): 00089 val1 = geometry_msgs.msg.Point() 00090 _x = val1 00091 start = end 00092 end += 24 00093 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00094 self.features_old.append(val1) 00095 start = end 00096 end += 4 00097 (length,) = _struct_I.unpack(str[start:end]) 00098 self.features_new = [] 00099 for i in range(0, length): 00100 val1 = geometry_msgs.msg.Point() 00101 _x = val1 00102 start = end 00103 end += 24 00104 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00105 self.features_new.append(val1) 00106 return self 00107 except struct.error as e: 00108 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00109 00110 00111 def serialize_numpy(self, buff, numpy): 00112 """ 00113 serialize message with numpy array types into buffer 00114 @param buff: buffer 00115 @type buff: StringIO 00116 @param numpy: numpy python module 00117 @type numpy module 00118 """ 00119 try: 00120 length = len(self.features_old) 00121 buff.write(_struct_I.pack(length)) 00122 for val1 in self.features_old: 00123 _x = val1 00124 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00125 length = len(self.features_new) 00126 buff.write(_struct_I.pack(length)) 00127 for val1 in self.features_new: 00128 _x = val1 00129 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 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 end = 0 00143 start = end 00144 end += 4 00145 (length,) = _struct_I.unpack(str[start:end]) 00146 self.features_old = [] 00147 for i in range(0, length): 00148 val1 = geometry_msgs.msg.Point() 00149 _x = val1 00150 start = end 00151 end += 24 00152 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00153 self.features_old.append(val1) 00154 start = end 00155 end += 4 00156 (length,) = _struct_I.unpack(str[start:end]) 00157 self.features_new = [] 00158 for i in range(0, length): 00159 val1 = geometry_msgs.msg.Point() 00160 _x = val1 00161 start = end 00162 end += 24 00163 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00164 self.features_new.append(val1) 00165 return self 00166 except struct.error as e: 00167 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00168 00169 _struct_I = roslib.message.struct_I 00170 _struct_3d = struct.Struct("<3d") 00171 """autogenerated by genmsg_py from estimateRigidResponse.msg. Do not edit.""" 00172 import roslib.message 00173 import struct 00174 00175 00176 class estimateRigidResponse(roslib.message.Message): 00177 _md5sum = "f8cc7c148e0090fd4023bed192be4679" 00178 _type = "pr2_interactive_segmentation/estimateRigidResponse" 00179 _has_header = False #flag to mark the presence of a Header object 00180 _full_text = """int32[] inliers 00181 int32 success 00182 00183 """ 00184 __slots__ = ['inliers','success'] 00185 _slot_types = ['int32[]','int32'] 00186 00187 def __init__(self, *args, **kwds): 00188 """ 00189 Constructor. Any message fields that are implicitly/explicitly 00190 set to None will be assigned a default value. The recommend 00191 use is keyword arguments as this is more robust to future message 00192 changes. You cannot mix in-order arguments and keyword arguments. 00193 00194 The available fields are: 00195 inliers,success 00196 00197 @param args: complete set of field values, in .msg order 00198 @param kwds: use keyword arguments corresponding to message field names 00199 to set specific fields. 00200 """ 00201 if args or kwds: 00202 super(estimateRigidResponse, self).__init__(*args, **kwds) 00203 #message fields cannot be None, assign default values for those that are 00204 if self.inliers is None: 00205 self.inliers = [] 00206 if self.success is None: 00207 self.success = 0 00208 else: 00209 self.inliers = [] 00210 self.success = 0 00211 00212 def _get_types(self): 00213 """ 00214 internal API method 00215 """ 00216 return self._slot_types 00217 00218 def serialize(self, buff): 00219 """ 00220 serialize message into buffer 00221 @param buff: buffer 00222 @type buff: StringIO 00223 """ 00224 try: 00225 length = len(self.inliers) 00226 buff.write(_struct_I.pack(length)) 00227 pattern = '<%si'%length 00228 buff.write(struct.pack(pattern, *self.inliers)) 00229 buff.write(_struct_i.pack(self.success)) 00230 except struct.error as se: self._check_types(se) 00231 except TypeError as te: self._check_types(te) 00232 00233 def deserialize(self, str): 00234 """ 00235 unpack serialized message in str into this message instance 00236 @param str: byte array of serialized message 00237 @type str: str 00238 """ 00239 try: 00240 end = 0 00241 start = end 00242 end += 4 00243 (length,) = _struct_I.unpack(str[start:end]) 00244 pattern = '<%si'%length 00245 start = end 00246 end += struct.calcsize(pattern) 00247 self.inliers = struct.unpack(pattern, str[start:end]) 00248 start = end 00249 end += 4 00250 (self.success,) = _struct_i.unpack(str[start:end]) 00251 return self 00252 except struct.error as e: 00253 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00254 00255 00256 def serialize_numpy(self, buff, numpy): 00257 """ 00258 serialize message with numpy array types into buffer 00259 @param buff: buffer 00260 @type buff: StringIO 00261 @param numpy: numpy python module 00262 @type numpy module 00263 """ 00264 try: 00265 length = len(self.inliers) 00266 buff.write(_struct_I.pack(length)) 00267 pattern = '<%si'%length 00268 buff.write(self.inliers.tostring()) 00269 buff.write(_struct_i.pack(self.success)) 00270 except struct.error as se: self._check_types(se) 00271 except TypeError as te: self._check_types(te) 00272 00273 def deserialize_numpy(self, str, numpy): 00274 """ 00275 unpack serialized message in str into this message instance using numpy for array types 00276 @param str: byte array of serialized message 00277 @type str: str 00278 @param numpy: numpy python module 00279 @type numpy: module 00280 """ 00281 try: 00282 end = 0 00283 start = end 00284 end += 4 00285 (length,) = _struct_I.unpack(str[start:end]) 00286 pattern = '<%si'%length 00287 start = end 00288 end += struct.calcsize(pattern) 00289 self.inliers = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 00290 start = end 00291 end += 4 00292 (self.success,) = _struct_i.unpack(str[start:end]) 00293 return self 00294 except struct.error as e: 00295 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00296 00297 _struct_I = roslib.message.struct_I 00298 _struct_i = struct.Struct("<i") 00299 class estimateRigid(roslib.message.ServiceDefinition): 00300 _type = 'pr2_interactive_segmentation/estimateRigid' 00301 _md5sum = '536808d5a729d88f5d653c8f3bc1c5db' 00302 _request_class = estimateRigidRequest 00303 _response_class = estimateRigidResponse