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