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