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