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