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