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