$search
00001 """autogenerated by genmsg_py from SetModelsJointsStatesRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import pr2_gazebo_plugins.msg 00006 import geometry_msgs.msg 00007 00008 class SetModelsJointsStatesRequest(roslib.message.Message): 00009 _md5sum = "ecf71b483df7b70447575a8231727200" 00010 _type = "pr2_gazebo_plugins/SetModelsJointsStatesRequest" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """string[] model_names 00013 pr2_gazebo_plugins/ModelJointsState[] model_joints_states 00014 00015 ================================================================================ 00016 MSG: pr2_gazebo_plugins/ModelJointsState 00017 geometry_msgs/Pose[] model_pose # set as single element array if user wishes to specify model pose, otherwise, leave empty 00018 string[] joint_names # list of joint names 00019 float64[] joint_positions # list of desired joint positions, should match joint_names 00020 00021 ================================================================================ 00022 MSG: geometry_msgs/Pose 00023 # A representation of pose in free space, composed of postion and orientation. 00024 Point position 00025 Quaternion orientation 00026 00027 ================================================================================ 00028 MSG: geometry_msgs/Point 00029 # This contains the position of a point in free space 00030 float64 x 00031 float64 y 00032 float64 z 00033 00034 ================================================================================ 00035 MSG: geometry_msgs/Quaternion 00036 # This represents an orientation in free space in quaternion form. 00037 00038 float64 x 00039 float64 y 00040 float64 z 00041 float64 w 00042 00043 """ 00044 __slots__ = ['model_names','model_joints_states'] 00045 _slot_types = ['string[]','pr2_gazebo_plugins/ModelJointsState[]'] 00046 00047 def __init__(self, *args, **kwds): 00048 """ 00049 Constructor. Any message fields that are implicitly/explicitly 00050 set to None will be assigned a default value. The recommend 00051 use is keyword arguments as this is more robust to future message 00052 changes. You cannot mix in-order arguments and keyword arguments. 00053 00054 The available fields are: 00055 model_names,model_joints_states 00056 00057 @param args: complete set of field values, in .msg order 00058 @param kwds: use keyword arguments corresponding to message field names 00059 to set specific fields. 00060 """ 00061 if args or kwds: 00062 super(SetModelsJointsStatesRequest, self).__init__(*args, **kwds) 00063 #message fields cannot be None, assign default values for those that are 00064 if self.model_names is None: 00065 self.model_names = [] 00066 if self.model_joints_states is None: 00067 self.model_joints_states = [] 00068 else: 00069 self.model_names = [] 00070 self.model_joints_states = [] 00071 00072 def _get_types(self): 00073 """ 00074 internal API method 00075 """ 00076 return self._slot_types 00077 00078 def serialize(self, buff): 00079 """ 00080 serialize message into buffer 00081 @param buff: buffer 00082 @type buff: StringIO 00083 """ 00084 try: 00085 length = len(self.model_names) 00086 buff.write(_struct_I.pack(length)) 00087 for val1 in self.model_names: 00088 length = len(val1) 00089 buff.write(struct.pack('<I%ss'%length, length, val1)) 00090 length = len(self.model_joints_states) 00091 buff.write(_struct_I.pack(length)) 00092 for val1 in self.model_joints_states: 00093 length = len(val1.model_pose) 00094 buff.write(_struct_I.pack(length)) 00095 for val2 in val1.model_pose: 00096 _v1 = val2.position 00097 _x = _v1 00098 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00099 _v2 = val2.orientation 00100 _x = _v2 00101 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00102 length = len(val1.joint_names) 00103 buff.write(_struct_I.pack(length)) 00104 for val2 in val1.joint_names: 00105 length = len(val2) 00106 buff.write(struct.pack('<I%ss'%length, length, val2)) 00107 length = len(val1.joint_positions) 00108 buff.write(_struct_I.pack(length)) 00109 pattern = '<%sd'%length 00110 buff.write(struct.pack(pattern, *val1.joint_positions)) 00111 except struct.error as se: self._check_types(se) 00112 except TypeError as te: self._check_types(te) 00113 00114 def deserialize(self, str): 00115 """ 00116 unpack serialized message in str into this message instance 00117 @param str: byte array of serialized message 00118 @type str: str 00119 """ 00120 try: 00121 end = 0 00122 start = end 00123 end += 4 00124 (length,) = _struct_I.unpack(str[start:end]) 00125 self.model_names = [] 00126 for i in range(0, length): 00127 start = end 00128 end += 4 00129 (length,) = _struct_I.unpack(str[start:end]) 00130 start = end 00131 end += length 00132 val1 = str[start:end] 00133 self.model_names.append(val1) 00134 start = end 00135 end += 4 00136 (length,) = _struct_I.unpack(str[start:end]) 00137 self.model_joints_states = [] 00138 for i in range(0, length): 00139 val1 = pr2_gazebo_plugins.msg.ModelJointsState() 00140 start = end 00141 end += 4 00142 (length,) = _struct_I.unpack(str[start:end]) 00143 val1.model_pose = [] 00144 for i in range(0, length): 00145 val2 = geometry_msgs.msg.Pose() 00146 _v3 = val2.position 00147 _x = _v3 00148 start = end 00149 end += 24 00150 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00151 _v4 = val2.orientation 00152 _x = _v4 00153 start = end 00154 end += 32 00155 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00156 val1.model_pose.append(val2) 00157 start = end 00158 end += 4 00159 (length,) = _struct_I.unpack(str[start:end]) 00160 val1.joint_names = [] 00161 for i in range(0, length): 00162 start = end 00163 end += 4 00164 (length,) = _struct_I.unpack(str[start:end]) 00165 start = end 00166 end += length 00167 val2 = str[start:end] 00168 val1.joint_names.append(val2) 00169 start = end 00170 end += 4 00171 (length,) = _struct_I.unpack(str[start:end]) 00172 pattern = '<%sd'%length 00173 start = end 00174 end += struct.calcsize(pattern) 00175 val1.joint_positions = struct.unpack(pattern, str[start:end]) 00176 self.model_joints_states.append(val1) 00177 return self 00178 except struct.error as e: 00179 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00180 00181 00182 def serialize_numpy(self, buff, numpy): 00183 """ 00184 serialize message with numpy array types into buffer 00185 @param buff: buffer 00186 @type buff: StringIO 00187 @param numpy: numpy python module 00188 @type numpy module 00189 """ 00190 try: 00191 length = len(self.model_names) 00192 buff.write(_struct_I.pack(length)) 00193 for val1 in self.model_names: 00194 length = len(val1) 00195 buff.write(struct.pack('<I%ss'%length, length, val1)) 00196 length = len(self.model_joints_states) 00197 buff.write(_struct_I.pack(length)) 00198 for val1 in self.model_joints_states: 00199 length = len(val1.model_pose) 00200 buff.write(_struct_I.pack(length)) 00201 for val2 in val1.model_pose: 00202 _v5 = val2.position 00203 _x = _v5 00204 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00205 _v6 = val2.orientation 00206 _x = _v6 00207 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00208 length = len(val1.joint_names) 00209 buff.write(_struct_I.pack(length)) 00210 for val2 in val1.joint_names: 00211 length = len(val2) 00212 buff.write(struct.pack('<I%ss'%length, length, val2)) 00213 length = len(val1.joint_positions) 00214 buff.write(_struct_I.pack(length)) 00215 pattern = '<%sd'%length 00216 buff.write(val1.joint_positions.tostring()) 00217 except struct.error as se: self._check_types(se) 00218 except TypeError as te: self._check_types(te) 00219 00220 def deserialize_numpy(self, str, numpy): 00221 """ 00222 unpack serialized message in str into this message instance using numpy for array types 00223 @param str: byte array of serialized message 00224 @type str: str 00225 @param numpy: numpy python module 00226 @type numpy: module 00227 """ 00228 try: 00229 end = 0 00230 start = end 00231 end += 4 00232 (length,) = _struct_I.unpack(str[start:end]) 00233 self.model_names = [] 00234 for i in range(0, length): 00235 start = end 00236 end += 4 00237 (length,) = _struct_I.unpack(str[start:end]) 00238 start = end 00239 end += length 00240 val1 = str[start:end] 00241 self.model_names.append(val1) 00242 start = end 00243 end += 4 00244 (length,) = _struct_I.unpack(str[start:end]) 00245 self.model_joints_states = [] 00246 for i in range(0, length): 00247 val1 = pr2_gazebo_plugins.msg.ModelJointsState() 00248 start = end 00249 end += 4 00250 (length,) = _struct_I.unpack(str[start:end]) 00251 val1.model_pose = [] 00252 for i in range(0, length): 00253 val2 = geometry_msgs.msg.Pose() 00254 _v7 = val2.position 00255 _x = _v7 00256 start = end 00257 end += 24 00258 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00259 _v8 = val2.orientation 00260 _x = _v8 00261 start = end 00262 end += 32 00263 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00264 val1.model_pose.append(val2) 00265 start = end 00266 end += 4 00267 (length,) = _struct_I.unpack(str[start:end]) 00268 val1.joint_names = [] 00269 for i in range(0, length): 00270 start = end 00271 end += 4 00272 (length,) = _struct_I.unpack(str[start:end]) 00273 start = end 00274 end += length 00275 val2 = str[start:end] 00276 val1.joint_names.append(val2) 00277 start = end 00278 end += 4 00279 (length,) = _struct_I.unpack(str[start:end]) 00280 pattern = '<%sd'%length 00281 start = end 00282 end += struct.calcsize(pattern) 00283 val1.joint_positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00284 self.model_joints_states.append(val1) 00285 return self 00286 except struct.error as e: 00287 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00288 00289 _struct_I = roslib.message.struct_I 00290 _struct_4d = struct.Struct("<4d") 00291 _struct_3d = struct.Struct("<3d") 00292 """autogenerated by genmsg_py from SetModelsJointsStatesResponse.msg. Do not edit.""" 00293 import roslib.message 00294 import struct 00295 00296 00297 class SetModelsJointsStatesResponse(roslib.message.Message): 00298 _md5sum = "2ec6f3eff0161f4257b808b12bc830c2" 00299 _type = "pr2_gazebo_plugins/SetModelsJointsStatesResponse" 00300 _has_header = False #flag to mark the presence of a Header object 00301 _full_text = """bool success 00302 string status_message 00303 00304 00305 """ 00306 __slots__ = ['success','status_message'] 00307 _slot_types = ['bool','string'] 00308 00309 def __init__(self, *args, **kwds): 00310 """ 00311 Constructor. Any message fields that are implicitly/explicitly 00312 set to None will be assigned a default value. The recommend 00313 use is keyword arguments as this is more robust to future message 00314 changes. You cannot mix in-order arguments and keyword arguments. 00315 00316 The available fields are: 00317 success,status_message 00318 00319 @param args: complete set of field values, in .msg order 00320 @param kwds: use keyword arguments corresponding to message field names 00321 to set specific fields. 00322 """ 00323 if args or kwds: 00324 super(SetModelsJointsStatesResponse, self).__init__(*args, **kwds) 00325 #message fields cannot be None, assign default values for those that are 00326 if self.success is None: 00327 self.success = False 00328 if self.status_message is None: 00329 self.status_message = '' 00330 else: 00331 self.success = False 00332 self.status_message = '' 00333 00334 def _get_types(self): 00335 """ 00336 internal API method 00337 """ 00338 return self._slot_types 00339 00340 def serialize(self, buff): 00341 """ 00342 serialize message into buffer 00343 @param buff: buffer 00344 @type buff: StringIO 00345 """ 00346 try: 00347 buff.write(_struct_B.pack(self.success)) 00348 _x = self.status_message 00349 length = len(_x) 00350 buff.write(struct.pack('<I%ss'%length, length, _x)) 00351 except struct.error as se: self._check_types(se) 00352 except TypeError as te: self._check_types(te) 00353 00354 def deserialize(self, str): 00355 """ 00356 unpack serialized message in str into this message instance 00357 @param str: byte array of serialized message 00358 @type str: str 00359 """ 00360 try: 00361 end = 0 00362 start = end 00363 end += 1 00364 (self.success,) = _struct_B.unpack(str[start:end]) 00365 self.success = bool(self.success) 00366 start = end 00367 end += 4 00368 (length,) = _struct_I.unpack(str[start:end]) 00369 start = end 00370 end += length 00371 self.status_message = str[start:end] 00372 return self 00373 except struct.error as e: 00374 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00375 00376 00377 def serialize_numpy(self, buff, numpy): 00378 """ 00379 serialize message with numpy array types into buffer 00380 @param buff: buffer 00381 @type buff: StringIO 00382 @param numpy: numpy python module 00383 @type numpy module 00384 """ 00385 try: 00386 buff.write(_struct_B.pack(self.success)) 00387 _x = self.status_message 00388 length = len(_x) 00389 buff.write(struct.pack('<I%ss'%length, length, _x)) 00390 except struct.error as se: self._check_types(se) 00391 except TypeError as te: self._check_types(te) 00392 00393 def deserialize_numpy(self, str, numpy): 00394 """ 00395 unpack serialized message in str into this message instance using numpy for array types 00396 @param str: byte array of serialized message 00397 @type str: str 00398 @param numpy: numpy python module 00399 @type numpy: module 00400 """ 00401 try: 00402 end = 0 00403 start = end 00404 end += 1 00405 (self.success,) = _struct_B.unpack(str[start:end]) 00406 self.success = bool(self.success) 00407 start = end 00408 end += 4 00409 (length,) = _struct_I.unpack(str[start:end]) 00410 start = end 00411 end += length 00412 self.status_message = str[start:end] 00413 return self 00414 except struct.error as e: 00415 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00416 00417 _struct_I = roslib.message.struct_I 00418 _struct_B = struct.Struct("<B") 00419 class SetModelsJointsStates(roslib.message.ServiceDefinition): 00420 _type = 'pr2_gazebo_plugins/SetModelsJointsStates' 00421 _md5sum = 'b3f4760ee77e28f605915bcee447b72d' 00422 _request_class = SetModelsJointsStatesRequest 00423 _response_class = SetModelsJointsStatesResponse