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