_SetModelConfiguration.py
Go to the documentation of this file.
00001 """autogenerated by genpy from gazebo_msgs/SetModelConfigurationRequest.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class SetModelConfigurationRequest(genpy.Message):
00009   _md5sum = "160eae60f51fabff255480c70afa289f"
00010   _type = "gazebo_msgs/SetModelConfigurationRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 string model_name
00014 string urdf_param_name
00015 
00016 string[] joint_names
00017 float64[] joint_positions
00018 
00019 """
00020   __slots__ = ['model_name','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,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.urdf_param_name is None:
00043         self.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.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, ``StringIO``
00064     """
00065     try:
00066       _x = self.model_name
00067       length = len(_x)
00068       if python3 or type(_x) == unicode:
00069         _x = _x.encode('utf-8')
00070         length = len(_x)
00071       buff.write(struct.pack('<I%ss'%length, length, _x))
00072       _x = self.urdf_param_name
00073       length = len(_x)
00074       if python3 or type(_x) == unicode:
00075         _x = _x.encode('utf-8')
00076         length = len(_x)
00077       buff.write(struct.pack('<I%ss'%length, length, _x))
00078       length = len(self.joint_names)
00079       buff.write(_struct_I.pack(length))
00080       for val1 in self.joint_names:
00081         length = len(val1)
00082         if python3 or type(val1) == unicode:
00083           val1 = val1.encode('utf-8')
00084           length = len(val1)
00085         buff.write(struct.pack('<I%ss'%length, length, val1))
00086       length = len(self.joint_positions)
00087       buff.write(_struct_I.pack(length))
00088       pattern = '<%sd'%length
00089       buff.write(struct.pack(pattern, *self.joint_positions))
00090     except struct.error as se: self._check_types(se)
00091     except TypeError as te: self._check_types(te)
00092 
00093   def deserialize(self, str):
00094     """
00095     unpack serialized message in str into this message instance
00096     :param str: byte array of serialized message, ``str``
00097     """
00098     try:
00099       end = 0
00100       start = end
00101       end += 4
00102       (length,) = _struct_I.unpack(str[start:end])
00103       start = end
00104       end += length
00105       if python3:
00106         self.model_name = str[start:end].decode('utf-8')
00107       else:
00108         self.model_name = str[start:end]
00109       start = end
00110       end += 4
00111       (length,) = _struct_I.unpack(str[start:end])
00112       start = end
00113       end += length
00114       if python3:
00115         self.urdf_param_name = str[start:end].decode('utf-8')
00116       else:
00117         self.urdf_param_name = str[start:end]
00118       start = end
00119       end += 4
00120       (length,) = _struct_I.unpack(str[start:end])
00121       self.joint_names = []
00122       for i in range(0, length):
00123         start = end
00124         end += 4
00125         (length,) = _struct_I.unpack(str[start:end])
00126         start = end
00127         end += length
00128         if python3:
00129           val1 = str[start:end].decode('utf-8')
00130         else:
00131           val1 = str[start:end]
00132         self.joint_names.append(val1)
00133       start = end
00134       end += 4
00135       (length,) = _struct_I.unpack(str[start:end])
00136       pattern = '<%sd'%length
00137       start = end
00138       end += struct.calcsize(pattern)
00139       self.joint_positions = struct.unpack(pattern, str[start:end])
00140       return self
00141     except struct.error as e:
00142       raise genpy.DeserializationError(e) #most likely buffer underfill
00143 
00144 
00145   def serialize_numpy(self, buff, numpy):
00146     """
00147     serialize message with numpy array types into buffer
00148     :param buff: buffer, ``StringIO``
00149     :param numpy: numpy python module
00150     """
00151     try:
00152       _x = self.model_name
00153       length = len(_x)
00154       if python3 or type(_x) == unicode:
00155         _x = _x.encode('utf-8')
00156         length = len(_x)
00157       buff.write(struct.pack('<I%ss'%length, length, _x))
00158       _x = self.urdf_param_name
00159       length = len(_x)
00160       if python3 or type(_x) == unicode:
00161         _x = _x.encode('utf-8')
00162         length = len(_x)
00163       buff.write(struct.pack('<I%ss'%length, length, _x))
00164       length = len(self.joint_names)
00165       buff.write(_struct_I.pack(length))
00166       for val1 in self.joint_names:
00167         length = len(val1)
00168         if python3 or type(val1) == unicode:
00169           val1 = val1.encode('utf-8')
00170           length = len(val1)
00171         buff.write(struct.pack('<I%ss'%length, length, val1))
00172       length = len(self.joint_positions)
00173       buff.write(_struct_I.pack(length))
00174       pattern = '<%sd'%length
00175       buff.write(self.joint_positions.tostring())
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, ``str``
00183     :param numpy: numpy python module
00184     """
00185     try:
00186       end = 0
00187       start = end
00188       end += 4
00189       (length,) = _struct_I.unpack(str[start:end])
00190       start = end
00191       end += length
00192       if python3:
00193         self.model_name = str[start:end].decode('utf-8')
00194       else:
00195         self.model_name = str[start:end]
00196       start = end
00197       end += 4
00198       (length,) = _struct_I.unpack(str[start:end])
00199       start = end
00200       end += length
00201       if python3:
00202         self.urdf_param_name = str[start:end].decode('utf-8')
00203       else:
00204         self.urdf_param_name = str[start:end]
00205       start = end
00206       end += 4
00207       (length,) = _struct_I.unpack(str[start:end])
00208       self.joint_names = []
00209       for i in range(0, length):
00210         start = end
00211         end += 4
00212         (length,) = _struct_I.unpack(str[start:end])
00213         start = end
00214         end += length
00215         if python3:
00216           val1 = str[start:end].decode('utf-8')
00217         else:
00218           val1 = str[start:end]
00219         self.joint_names.append(val1)
00220       start = end
00221       end += 4
00222       (length,) = _struct_I.unpack(str[start:end])
00223       pattern = '<%sd'%length
00224       start = end
00225       end += struct.calcsize(pattern)
00226       self.joint_positions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
00227       return self
00228     except struct.error as e:
00229       raise genpy.DeserializationError(e) #most likely buffer underfill
00230 
00231 _struct_I = genpy.struct_I
00232 """autogenerated by genpy from gazebo_msgs/SetModelConfigurationResponse.msg. Do not edit."""
00233 import sys
00234 python3 = True if sys.hexversion > 0x03000000 else False
00235 import genpy
00236 import struct
00237 
00238 
00239 class SetModelConfigurationResponse(genpy.Message):
00240   _md5sum = "2ec6f3eff0161f4257b808b12bc830c2"
00241   _type = "gazebo_msgs/SetModelConfigurationResponse"
00242   _has_header = False #flag to mark the presence of a Header object
00243   _full_text = """bool success
00244 string status_message
00245 
00246 
00247 """
00248   __slots__ = ['success','status_message']
00249   _slot_types = ['bool','string']
00250 
00251   def __init__(self, *args, **kwds):
00252     """
00253     Constructor. Any message fields that are implicitly/explicitly
00254     set to None will be assigned a default value. The recommend
00255     use is keyword arguments as this is more robust to future message
00256     changes.  You cannot mix in-order arguments and keyword arguments.
00257 
00258     The available fields are:
00259        success,status_message
00260 
00261     :param args: complete set of field values, in .msg order
00262     :param kwds: use keyword arguments corresponding to message field names
00263     to set specific fields.
00264     """
00265     if args or kwds:
00266       super(SetModelConfigurationResponse, self).__init__(*args, **kwds)
00267       #message fields cannot be None, assign default values for those that are
00268       if self.success is None:
00269         self.success = False
00270       if self.status_message is None:
00271         self.status_message = ''
00272     else:
00273       self.success = False
00274       self.status_message = ''
00275 
00276   def _get_types(self):
00277     """
00278     internal API method
00279     """
00280     return self._slot_types
00281 
00282   def serialize(self, buff):
00283     """
00284     serialize message into buffer
00285     :param buff: buffer, ``StringIO``
00286     """
00287     try:
00288       buff.write(_struct_B.pack(self.success))
00289       _x = self.status_message
00290       length = len(_x)
00291       if python3 or type(_x) == unicode:
00292         _x = _x.encode('utf-8')
00293         length = len(_x)
00294       buff.write(struct.pack('<I%ss'%length, length, _x))
00295     except struct.error as se: self._check_types(se)
00296     except TypeError as te: self._check_types(te)
00297 
00298   def deserialize(self, str):
00299     """
00300     unpack serialized message in str into this message instance
00301     :param str: byte array of serialized message, ``str``
00302     """
00303     try:
00304       end = 0
00305       start = end
00306       end += 1
00307       (self.success,) = _struct_B.unpack(str[start:end])
00308       self.success = bool(self.success)
00309       start = end
00310       end += 4
00311       (length,) = _struct_I.unpack(str[start:end])
00312       start = end
00313       end += length
00314       if python3:
00315         self.status_message = str[start:end].decode('utf-8')
00316       else:
00317         self.status_message = str[start:end]
00318       return self
00319     except struct.error as e:
00320       raise genpy.DeserializationError(e) #most likely buffer underfill
00321 
00322 
00323   def serialize_numpy(self, buff, numpy):
00324     """
00325     serialize message with numpy array types into buffer
00326     :param buff: buffer, ``StringIO``
00327     :param numpy: numpy python module
00328     """
00329     try:
00330       buff.write(_struct_B.pack(self.success))
00331       _x = self.status_message
00332       length = len(_x)
00333       if python3 or type(_x) == unicode:
00334         _x = _x.encode('utf-8')
00335         length = len(_x)
00336       buff.write(struct.pack('<I%ss'%length, length, _x))
00337     except struct.error as se: self._check_types(se)
00338     except TypeError as te: self._check_types(te)
00339 
00340   def deserialize_numpy(self, str, numpy):
00341     """
00342     unpack serialized message in str into this message instance using numpy for array types
00343     :param str: byte array of serialized message, ``str``
00344     :param numpy: numpy python module
00345     """
00346     try:
00347       end = 0
00348       start = end
00349       end += 1
00350       (self.success,) = _struct_B.unpack(str[start:end])
00351       self.success = bool(self.success)
00352       start = end
00353       end += 4
00354       (length,) = _struct_I.unpack(str[start:end])
00355       start = end
00356       end += length
00357       if python3:
00358         self.status_message = str[start:end].decode('utf-8')
00359       else:
00360         self.status_message = str[start:end]
00361       return self
00362     except struct.error as e:
00363       raise genpy.DeserializationError(e) #most likely buffer underfill
00364 
00365 _struct_I = genpy.struct_I
00366 _struct_B = struct.Struct("<B")
00367 class SetModelConfiguration(object):
00368   _type          = 'gazebo_msgs/SetModelConfiguration'
00369   _md5sum = '10e3139d3b669c40afc057d38956fff7'
00370   _request_class  = SetModelConfigurationRequest
00371   _response_class = SetModelConfigurationResponse


gazebo_msgs
Author(s): John Hsu
autogenerated on Sun Jan 5 2014 11:34:32