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