$search
00001 """autogenerated by genmsg_py from BlockDetectionResult.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import std_msgs.msg 00007 00008 class BlockDetectionResult(roslib.message.Message): 00009 _md5sum = "fe4272fcc0cf26cf952b16d66c620bd4" 00010 _type = "turtlebot_block_manipulation/BlockDetectionResult" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00013 #result definition 00014 geometry_msgs/PoseArray blocks 00015 00016 ================================================================================ 00017 MSG: geometry_msgs/PoseArray 00018 # An array of poses with a header for global reference. 00019 00020 Header header 00021 00022 geometry_msgs/Pose[] poses 00023 00024 ================================================================================ 00025 MSG: std_msgs/Header 00026 # Standard metadata for higher-level stamped data types. 00027 # This is generally used to communicate timestamped data 00028 # in a particular coordinate frame. 00029 # 00030 # sequence ID: consecutively increasing ID 00031 uint32 seq 00032 #Two-integer timestamp that is expressed as: 00033 # * stamp.secs: seconds (stamp_secs) since epoch 00034 # * stamp.nsecs: nanoseconds since stamp_secs 00035 # time-handling sugar is provided by the client library 00036 time stamp 00037 #Frame this data is associated with 00038 # 0: no frame 00039 # 1: global frame 00040 string frame_id 00041 00042 ================================================================================ 00043 MSG: geometry_msgs/Pose 00044 # A representation of pose in free space, composed of postion and orientation. 00045 Point position 00046 Quaternion orientation 00047 00048 ================================================================================ 00049 MSG: geometry_msgs/Point 00050 # This contains the position of a point in free space 00051 float64 x 00052 float64 y 00053 float64 z 00054 00055 ================================================================================ 00056 MSG: geometry_msgs/Quaternion 00057 # This represents an orientation in free space in quaternion form. 00058 00059 float64 x 00060 float64 y 00061 float64 z 00062 float64 w 00063 00064 """ 00065 __slots__ = ['blocks'] 00066 _slot_types = ['geometry_msgs/PoseArray'] 00067 00068 def __init__(self, *args, **kwds): 00069 """ 00070 Constructor. Any message fields that are implicitly/explicitly 00071 set to None will be assigned a default value. The recommend 00072 use is keyword arguments as this is more robust to future message 00073 changes. You cannot mix in-order arguments and keyword arguments. 00074 00075 The available fields are: 00076 blocks 00077 00078 @param args: complete set of field values, in .msg order 00079 @param kwds: use keyword arguments corresponding to message field names 00080 to set specific fields. 00081 """ 00082 if args or kwds: 00083 super(BlockDetectionResult, self).__init__(*args, **kwds) 00084 #message fields cannot be None, assign default values for those that are 00085 if self.blocks is None: 00086 self.blocks = geometry_msgs.msg.PoseArray() 00087 else: 00088 self.blocks = geometry_msgs.msg.PoseArray() 00089 00090 def _get_types(self): 00091 """ 00092 internal API method 00093 """ 00094 return self._slot_types 00095 00096 def serialize(self, buff): 00097 """ 00098 serialize message into buffer 00099 @param buff: buffer 00100 @type buff: StringIO 00101 """ 00102 try: 00103 _x = self 00104 buff.write(_struct_3I.pack(_x.blocks.header.seq, _x.blocks.header.stamp.secs, _x.blocks.header.stamp.nsecs)) 00105 _x = self.blocks.header.frame_id 00106 length = len(_x) 00107 buff.write(struct.pack('<I%ss'%length, length, _x)) 00108 length = len(self.blocks.poses) 00109 buff.write(_struct_I.pack(length)) 00110 for val1 in self.blocks.poses: 00111 _v1 = val1.position 00112 _x = _v1 00113 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00114 _v2 = val1.orientation 00115 _x = _v2 00116 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00117 except struct.error as se: self._check_types(se) 00118 except TypeError as te: self._check_types(te) 00119 00120 def deserialize(self, str): 00121 """ 00122 unpack serialized message in str into this message instance 00123 @param str: byte array of serialized message 00124 @type str: str 00125 """ 00126 try: 00127 if self.blocks is None: 00128 self.blocks = geometry_msgs.msg.PoseArray() 00129 end = 0 00130 _x = self 00131 start = end 00132 end += 12 00133 (_x.blocks.header.seq, _x.blocks.header.stamp.secs, _x.blocks.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00134 start = end 00135 end += 4 00136 (length,) = _struct_I.unpack(str[start:end]) 00137 start = end 00138 end += length 00139 self.blocks.header.frame_id = str[start:end] 00140 start = end 00141 end += 4 00142 (length,) = _struct_I.unpack(str[start:end]) 00143 self.blocks.poses = [] 00144 for i in range(0, length): 00145 val1 = geometry_msgs.msg.Pose() 00146 _v3 = val1.position 00147 _x = _v3 00148 start = end 00149 end += 24 00150 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00151 _v4 = val1.orientation 00152 _x = _v4 00153 start = end 00154 end += 32 00155 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00156 self.blocks.poses.append(val1) 00157 return self 00158 except struct.error as e: 00159 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00160 00161 00162 def serialize_numpy(self, buff, numpy): 00163 """ 00164 serialize message with numpy array types into buffer 00165 @param buff: buffer 00166 @type buff: StringIO 00167 @param numpy: numpy python module 00168 @type numpy module 00169 """ 00170 try: 00171 _x = self 00172 buff.write(_struct_3I.pack(_x.blocks.header.seq, _x.blocks.header.stamp.secs, _x.blocks.header.stamp.nsecs)) 00173 _x = self.blocks.header.frame_id 00174 length = len(_x) 00175 buff.write(struct.pack('<I%ss'%length, length, _x)) 00176 length = len(self.blocks.poses) 00177 buff.write(_struct_I.pack(length)) 00178 for val1 in self.blocks.poses: 00179 _v5 = val1.position 00180 _x = _v5 00181 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00182 _v6 = val1.orientation 00183 _x = _v6 00184 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w)) 00185 except struct.error as se: self._check_types(se) 00186 except TypeError as te: self._check_types(te) 00187 00188 def deserialize_numpy(self, str, numpy): 00189 """ 00190 unpack serialized message in str into this message instance using numpy for array types 00191 @param str: byte array of serialized message 00192 @type str: str 00193 @param numpy: numpy python module 00194 @type numpy: module 00195 """ 00196 try: 00197 if self.blocks is None: 00198 self.blocks = geometry_msgs.msg.PoseArray() 00199 end = 0 00200 _x = self 00201 start = end 00202 end += 12 00203 (_x.blocks.header.seq, _x.blocks.header.stamp.secs, _x.blocks.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00204 start = end 00205 end += 4 00206 (length,) = _struct_I.unpack(str[start:end]) 00207 start = end 00208 end += length 00209 self.blocks.header.frame_id = str[start:end] 00210 start = end 00211 end += 4 00212 (length,) = _struct_I.unpack(str[start:end]) 00213 self.blocks.poses = [] 00214 for i in range(0, length): 00215 val1 = geometry_msgs.msg.Pose() 00216 _v7 = val1.position 00217 _x = _v7 00218 start = end 00219 end += 24 00220 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00221 _v8 = val1.orientation 00222 _x = _v8 00223 start = end 00224 end += 32 00225 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end]) 00226 self.blocks.poses.append(val1) 00227 return self 00228 except struct.error as e: 00229 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00230 00231 _struct_I = roslib.message.struct_I 00232 _struct_3I = struct.Struct("<3I") 00233 _struct_4d = struct.Struct("<4d") 00234 _struct_3d = struct.Struct("<3d")