_GraspAction.py
Go to the documentation of this file.
00001 """autogenerated by genpy from srs_knowledge/GraspAction.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import geometry_msgs.msg
00008 
00009 class GraspAction(genpy.Message):
00010   _md5sum = "a5b55b2bc3272273072fad2e424ffe38"
00011   _type = "srs_knowledge/GraspAction"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """bool ifGrasp
00014 
00015 geometry_msgs/Point32 rough_center
00016 float32 confidence_level
00017 float32 radius_region
00018 
00019 int32 object_id
00020 # geometry_msgs/Point32 grid_size
00021 # geometry_msgs
00022 string object_type
00023 int32 class_id
00024 
00025 ================================================================================
00026 MSG: geometry_msgs/Point32
00027 # This contains the position of a point in free space(with 32 bits of precision).
00028 # It is recommeded to use Point wherever possible instead of Point32.  
00029 # 
00030 # This recommendation is to promote interoperability.  
00031 #
00032 # This message is designed to take up less space when sending
00033 # lots of points at once, as in the case of a PointCloud.  
00034 
00035 float32 x
00036 float32 y
00037 float32 z
00038 """
00039   __slots__ = ['ifGrasp','rough_center','confidence_level','radius_region','object_id','object_type','class_id']
00040   _slot_types = ['bool','geometry_msgs/Point32','float32','float32','int32','string','int32']
00041 
00042   def __init__(self, *args, **kwds):
00043     """
00044     Constructor. Any message fields that are implicitly/explicitly
00045     set to None will be assigned a default value. The recommend
00046     use is keyword arguments as this is more robust to future message
00047     changes.  You cannot mix in-order arguments and keyword arguments.
00048 
00049     The available fields are:
00050        ifGrasp,rough_center,confidence_level,radius_region,object_id,object_type,class_id
00051 
00052     :param args: complete set of field values, in .msg order
00053     :param kwds: use keyword arguments corresponding to message field names
00054     to set specific fields.
00055     """
00056     if args or kwds:
00057       super(GraspAction, self).__init__(*args, **kwds)
00058       #message fields cannot be None, assign default values for those that are
00059       if self.ifGrasp is None:
00060         self.ifGrasp = False
00061       if self.rough_center is None:
00062         self.rough_center = geometry_msgs.msg.Point32()
00063       if self.confidence_level is None:
00064         self.confidence_level = 0.
00065       if self.radius_region is None:
00066         self.radius_region = 0.
00067       if self.object_id is None:
00068         self.object_id = 0
00069       if self.object_type is None:
00070         self.object_type = ''
00071       if self.class_id is None:
00072         self.class_id = 0
00073     else:
00074       self.ifGrasp = False
00075       self.rough_center = geometry_msgs.msg.Point32()
00076       self.confidence_level = 0.
00077       self.radius_region = 0.
00078       self.object_id = 0
00079       self.object_type = ''
00080       self.class_id = 0
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, ``StringIO``
00092     """
00093     try:
00094       _x = self
00095       buff.write(_struct_B5fi.pack(_x.ifGrasp, _x.rough_center.x, _x.rough_center.y, _x.rough_center.z, _x.confidence_level, _x.radius_region, _x.object_id))
00096       _x = self.object_type
00097       length = len(_x)
00098       if python3 or type(_x) == unicode:
00099         _x = _x.encode('utf-8')
00100         length = len(_x)
00101       buff.write(struct.pack('<I%ss'%length, length, _x))
00102       buff.write(_struct_i.pack(self.class_id))
00103     except struct.error as se: self._check_types(se)
00104     except TypeError as te: self._check_types(te)
00105 
00106   def deserialize(self, str):
00107     """
00108     unpack serialized message in str into this message instance
00109     :param str: byte array of serialized message, ``str``
00110     """
00111     try:
00112       if self.rough_center is None:
00113         self.rough_center = geometry_msgs.msg.Point32()
00114       end = 0
00115       _x = self
00116       start = end
00117       end += 25
00118       (_x.ifGrasp, _x.rough_center.x, _x.rough_center.y, _x.rough_center.z, _x.confidence_level, _x.radius_region, _x.object_id,) = _struct_B5fi.unpack(str[start:end])
00119       self.ifGrasp = bool(self.ifGrasp)
00120       start = end
00121       end += 4
00122       (length,) = _struct_I.unpack(str[start:end])
00123       start = end
00124       end += length
00125       if python3:
00126         self.object_type = str[start:end].decode('utf-8')
00127       else:
00128         self.object_type = str[start:end]
00129       start = end
00130       end += 4
00131       (self.class_id,) = _struct_i.unpack(str[start:end])
00132       return self
00133     except struct.error as e:
00134       raise genpy.DeserializationError(e) #most likely buffer underfill
00135 
00136 
00137   def serialize_numpy(self, buff, numpy):
00138     """
00139     serialize message with numpy array types into buffer
00140     :param buff: buffer, ``StringIO``
00141     :param numpy: numpy python module
00142     """
00143     try:
00144       _x = self
00145       buff.write(_struct_B5fi.pack(_x.ifGrasp, _x.rough_center.x, _x.rough_center.y, _x.rough_center.z, _x.confidence_level, _x.radius_region, _x.object_id))
00146       _x = self.object_type
00147       length = len(_x)
00148       if python3 or type(_x) == unicode:
00149         _x = _x.encode('utf-8')
00150         length = len(_x)
00151       buff.write(struct.pack('<I%ss'%length, length, _x))
00152       buff.write(_struct_i.pack(self.class_id))
00153     except struct.error as se: self._check_types(se)
00154     except TypeError as te: self._check_types(te)
00155 
00156   def deserialize_numpy(self, str, numpy):
00157     """
00158     unpack serialized message in str into this message instance using numpy for array types
00159     :param str: byte array of serialized message, ``str``
00160     :param numpy: numpy python module
00161     """
00162     try:
00163       if self.rough_center is None:
00164         self.rough_center = geometry_msgs.msg.Point32()
00165       end = 0
00166       _x = self
00167       start = end
00168       end += 25
00169       (_x.ifGrasp, _x.rough_center.x, _x.rough_center.y, _x.rough_center.z, _x.confidence_level, _x.radius_region, _x.object_id,) = _struct_B5fi.unpack(str[start:end])
00170       self.ifGrasp = bool(self.ifGrasp)
00171       start = end
00172       end += 4
00173       (length,) = _struct_I.unpack(str[start:end])
00174       start = end
00175       end += length
00176       if python3:
00177         self.object_type = str[start:end].decode('utf-8')
00178       else:
00179         self.object_type = str[start:end]
00180       start = end
00181       end += 4
00182       (self.class_id,) = _struct_i.unpack(str[start:end])
00183       return self
00184     except struct.error as e:
00185       raise genpy.DeserializationError(e) #most likely buffer underfill
00186 
00187 _struct_I = genpy.struct_I
00188 _struct_B5fi = struct.Struct("<B5fi")
00189 _struct_i = struct.Struct("<i")


srs_knowledge
Author(s): Ze Ji
autogenerated on Sun Jan 5 2014 12:03:26