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


gazebo_msgs
Author(s): John Hsu
autogenerated on Mon Oct 6 2014 12:14:33