$search
00001 """autogenerated by genmsg_py from BlockDetectionGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class BlockDetectionGoal(roslib.message.Message): 00007 _md5sum = "55e74460cfe309311425690ecb457a45" 00008 _type = "turtlebot_block_manipulation/BlockDetectionGoal" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00011 #goal definition 00012 string frame 00013 float32 table_height 00014 float32 block_size 00015 00016 """ 00017 __slots__ = ['frame','table_height','block_size'] 00018 _slot_types = ['string','float32','float32'] 00019 00020 def __init__(self, *args, **kwds): 00021 """ 00022 Constructor. Any message fields that are implicitly/explicitly 00023 set to None will be assigned a default value. The recommend 00024 use is keyword arguments as this is more robust to future message 00025 changes. You cannot mix in-order arguments and keyword arguments. 00026 00027 The available fields are: 00028 frame,table_height,block_size 00029 00030 @param args: complete set of field values, in .msg order 00031 @param kwds: use keyword arguments corresponding to message field names 00032 to set specific fields. 00033 """ 00034 if args or kwds: 00035 super(BlockDetectionGoal, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.frame is None: 00038 self.frame = '' 00039 if self.table_height is None: 00040 self.table_height = 0. 00041 if self.block_size is None: 00042 self.block_size = 0. 00043 else: 00044 self.frame = '' 00045 self.table_height = 0. 00046 self.block_size = 0. 00047 00048 def _get_types(self): 00049 """ 00050 internal API method 00051 """ 00052 return self._slot_types 00053 00054 def serialize(self, buff): 00055 """ 00056 serialize message into buffer 00057 @param buff: buffer 00058 @type buff: StringIO 00059 """ 00060 try: 00061 _x = self.frame 00062 length = len(_x) 00063 buff.write(struct.pack('<I%ss'%length, length, _x)) 00064 _x = self 00065 buff.write(_struct_2f.pack(_x.table_height, _x.block_size)) 00066 except struct.error as se: self._check_types(se) 00067 except TypeError as te: self._check_types(te) 00068 00069 def deserialize(self, str): 00070 """ 00071 unpack serialized message in str into this message instance 00072 @param str: byte array of serialized message 00073 @type str: str 00074 """ 00075 try: 00076 end = 0 00077 start = end 00078 end += 4 00079 (length,) = _struct_I.unpack(str[start:end]) 00080 start = end 00081 end += length 00082 self.frame = str[start:end] 00083 _x = self 00084 start = end 00085 end += 8 00086 (_x.table_height, _x.block_size,) = _struct_2f.unpack(str[start:end]) 00087 return self 00088 except struct.error as e: 00089 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00090 00091 00092 def serialize_numpy(self, buff, numpy): 00093 """ 00094 serialize message with numpy array types into buffer 00095 @param buff: buffer 00096 @type buff: StringIO 00097 @param numpy: numpy python module 00098 @type numpy module 00099 """ 00100 try: 00101 _x = self.frame 00102 length = len(_x) 00103 buff.write(struct.pack('<I%ss'%length, length, _x)) 00104 _x = self 00105 buff.write(_struct_2f.pack(_x.table_height, _x.block_size)) 00106 except struct.error as se: self._check_types(se) 00107 except TypeError as te: self._check_types(te) 00108 00109 def deserialize_numpy(self, str, numpy): 00110 """ 00111 unpack serialized message in str into this message instance using numpy for array types 00112 @param str: byte array of serialized message 00113 @type str: str 00114 @param numpy: numpy python module 00115 @type numpy: module 00116 """ 00117 try: 00118 end = 0 00119 start = end 00120 end += 4 00121 (length,) = _struct_I.unpack(str[start:end]) 00122 start = end 00123 end += length 00124 self.frame = str[start:end] 00125 _x = self 00126 start = end 00127 end += 8 00128 (_x.table_height, _x.block_size,) = _struct_2f.unpack(str[start:end]) 00129 return self 00130 except struct.error as e: 00131 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00132 00133 _struct_I = roslib.message.struct_I 00134 _struct_2f = struct.Struct("<2f")