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


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