_BlockDetectionActionResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from turtlebot_block_manipulation/BlockDetectionActionResult.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 turtlebot_block_manipulation.msg
00008 import geometry_msgs.msg
00009 import genpy
00010 import actionlib_msgs.msg
00011 import std_msgs.msg
00012 
00013 class BlockDetectionActionResult(genpy.Message):
00014   _md5sum = "8a8cf0cf1fe541495dc3aa68c42af4c2"
00015   _type = "turtlebot_block_manipulation/BlockDetectionActionResult"
00016   _has_header = True #flag to mark the presence of a Header object
00017   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00018 
00019 Header header
00020 actionlib_msgs/GoalStatus status
00021 BlockDetectionResult result
00022 
00023 ================================================================================
00024 MSG: std_msgs/Header
00025 # Standard metadata for higher-level stamped data types.
00026 # This is generally used to communicate timestamped data 
00027 # in a particular coordinate frame.
00028 # 
00029 # sequence ID: consecutively increasing ID 
00030 uint32 seq
00031 #Two-integer timestamp that is expressed as:
00032 # * stamp.secs: seconds (stamp_secs) since epoch
00033 # * stamp.nsecs: nanoseconds since stamp_secs
00034 # time-handling sugar is provided by the client library
00035 time stamp
00036 #Frame this data is associated with
00037 # 0: no frame
00038 # 1: global frame
00039 string frame_id
00040 
00041 ================================================================================
00042 MSG: actionlib_msgs/GoalStatus
00043 GoalID goal_id
00044 uint8 status
00045 uint8 PENDING         = 0   # The goal has yet to be processed by the action server
00046 uint8 ACTIVE          = 1   # The goal is currently being processed by the action server
00047 uint8 PREEMPTED       = 2   # The goal received a cancel request after it started executing
00048                             #   and has since completed its execution (Terminal State)
00049 uint8 SUCCEEDED       = 3   # The goal was achieved successfully by the action server (Terminal State)
00050 uint8 ABORTED         = 4   # The goal was aborted during execution by the action server due
00051                             #    to some failure (Terminal State)
00052 uint8 REJECTED        = 5   # The goal was rejected by the action server without being processed,
00053                             #    because the goal was unattainable or invalid (Terminal State)
00054 uint8 PREEMPTING      = 6   # The goal received a cancel request after it started executing
00055                             #    and has not yet completed execution
00056 uint8 RECALLING       = 7   # The goal received a cancel request before it started executing,
00057                             #    but the action server has not yet confirmed that the goal is canceled
00058 uint8 RECALLED        = 8   # The goal received a cancel request before it started executing
00059                             #    and was successfully cancelled (Terminal State)
00060 uint8 LOST            = 9   # An action client can determine that a goal is LOST. This should not be
00061                             #    sent over the wire by an action server
00062 
00063 #Allow for the user to associate a string with GoalStatus for debugging
00064 string text
00065 
00066 
00067 ================================================================================
00068 MSG: actionlib_msgs/GoalID
00069 # The stamp should store the time at which this goal was requested.
00070 # It is used by an action server when it tries to preempt all
00071 # goals that were requested before a certain time
00072 time stamp
00073 
00074 # The id provides a way to associate feedback and
00075 # result message with specific goal requests. The id
00076 # specified must be unique.
00077 string id
00078 
00079 
00080 ================================================================================
00081 MSG: turtlebot_block_manipulation/BlockDetectionResult
00082 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00083 #result definition
00084 geometry_msgs/PoseArray blocks
00085 
00086 ================================================================================
00087 MSG: geometry_msgs/PoseArray
00088 # An array of poses with a header for global reference.
00089 
00090 Header header
00091 
00092 Pose[] poses
00093 
00094 ================================================================================
00095 MSG: geometry_msgs/Pose
00096 # A representation of pose in free space, composed of postion and orientation. 
00097 Point position
00098 Quaternion orientation
00099 
00100 ================================================================================
00101 MSG: geometry_msgs/Point
00102 # This contains the position of a point in free space
00103 float64 x
00104 float64 y
00105 float64 z
00106 
00107 ================================================================================
00108 MSG: geometry_msgs/Quaternion
00109 # This represents an orientation in free space in quaternion form.
00110 
00111 float64 x
00112 float64 y
00113 float64 z
00114 float64 w
00115 
00116 """
00117   __slots__ = ['header','status','result']
00118   _slot_types = ['std_msgs/Header','actionlib_msgs/GoalStatus','turtlebot_block_manipulation/BlockDetectionResult']
00119 
00120   def __init__(self, *args, **kwds):
00121     """
00122     Constructor. Any message fields that are implicitly/explicitly
00123     set to None will be assigned a default value. The recommend
00124     use is keyword arguments as this is more robust to future message
00125     changes.  You cannot mix in-order arguments and keyword arguments.
00126 
00127     The available fields are:
00128        header,status,result
00129 
00130     :param args: complete set of field values, in .msg order
00131     :param kwds: use keyword arguments corresponding to message field names
00132     to set specific fields.
00133     """
00134     if args or kwds:
00135       super(BlockDetectionActionResult, self).__init__(*args, **kwds)
00136       #message fields cannot be None, assign default values for those that are
00137       if self.header is None:
00138         self.header = std_msgs.msg.Header()
00139       if self.status is None:
00140         self.status = actionlib_msgs.msg.GoalStatus()
00141       if self.result is None:
00142         self.result = turtlebot_block_manipulation.msg.BlockDetectionResult()
00143     else:
00144       self.header = std_msgs.msg.Header()
00145       self.status = actionlib_msgs.msg.GoalStatus()
00146       self.result = turtlebot_block_manipulation.msg.BlockDetectionResult()
00147 
00148   def _get_types(self):
00149     """
00150     internal API method
00151     """
00152     return self._slot_types
00153 
00154   def serialize(self, buff):
00155     """
00156     serialize message into buffer
00157     :param buff: buffer, ``StringIO``
00158     """
00159     try:
00160       _x = self
00161       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00162       _x = self.header.frame_id
00163       length = len(_x)
00164       if python3 or type(_x) == unicode:
00165         _x = _x.encode('utf-8')
00166         length = len(_x)
00167       buff.write(struct.pack('<I%ss'%length, length, _x))
00168       _x = self
00169       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00170       _x = self.status.goal_id.id
00171       length = len(_x)
00172       if python3 or type(_x) == unicode:
00173         _x = _x.encode('utf-8')
00174         length = len(_x)
00175       buff.write(struct.pack('<I%ss'%length, length, _x))
00176       buff.write(_struct_B.pack(self.status.status))
00177       _x = self.status.text
00178       length = len(_x)
00179       if python3 or type(_x) == unicode:
00180         _x = _x.encode('utf-8')
00181         length = len(_x)
00182       buff.write(struct.pack('<I%ss'%length, length, _x))
00183       _x = self
00184       buff.write(_struct_3I.pack(_x.result.blocks.header.seq, _x.result.blocks.header.stamp.secs, _x.result.blocks.header.stamp.nsecs))
00185       _x = self.result.blocks.header.frame_id
00186       length = len(_x)
00187       if python3 or type(_x) == unicode:
00188         _x = _x.encode('utf-8')
00189         length = len(_x)
00190       buff.write(struct.pack('<I%ss'%length, length, _x))
00191       length = len(self.result.blocks.poses)
00192       buff.write(_struct_I.pack(length))
00193       for val1 in self.result.blocks.poses:
00194         _v1 = val1.position
00195         _x = _v1
00196         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00197         _v2 = val1.orientation
00198         _x = _v2
00199         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00200     except struct.error as se: self._check_types(se)
00201     except TypeError as te: self._check_types(te)
00202 
00203   def deserialize(self, str):
00204     """
00205     unpack serialized message in str into this message instance
00206     :param str: byte array of serialized message, ``str``
00207     """
00208     try:
00209       if self.header is None:
00210         self.header = std_msgs.msg.Header()
00211       if self.status is None:
00212         self.status = actionlib_msgs.msg.GoalStatus()
00213       if self.result is None:
00214         self.result = turtlebot_block_manipulation.msg.BlockDetectionResult()
00215       end = 0
00216       _x = self
00217       start = end
00218       end += 12
00219       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00220       start = end
00221       end += 4
00222       (length,) = _struct_I.unpack(str[start:end])
00223       start = end
00224       end += length
00225       if python3:
00226         self.header.frame_id = str[start:end].decode('utf-8')
00227       else:
00228         self.header.frame_id = str[start:end]
00229       _x = self
00230       start = end
00231       end += 8
00232       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00233       start = end
00234       end += 4
00235       (length,) = _struct_I.unpack(str[start:end])
00236       start = end
00237       end += length
00238       if python3:
00239         self.status.goal_id.id = str[start:end].decode('utf-8')
00240       else:
00241         self.status.goal_id.id = str[start:end]
00242       start = end
00243       end += 1
00244       (self.status.status,) = _struct_B.unpack(str[start:end])
00245       start = end
00246       end += 4
00247       (length,) = _struct_I.unpack(str[start:end])
00248       start = end
00249       end += length
00250       if python3:
00251         self.status.text = str[start:end].decode('utf-8')
00252       else:
00253         self.status.text = str[start:end]
00254       _x = self
00255       start = end
00256       end += 12
00257       (_x.result.blocks.header.seq, _x.result.blocks.header.stamp.secs, _x.result.blocks.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00258       start = end
00259       end += 4
00260       (length,) = _struct_I.unpack(str[start:end])
00261       start = end
00262       end += length
00263       if python3:
00264         self.result.blocks.header.frame_id = str[start:end].decode('utf-8')
00265       else:
00266         self.result.blocks.header.frame_id = str[start:end]
00267       start = end
00268       end += 4
00269       (length,) = _struct_I.unpack(str[start:end])
00270       self.result.blocks.poses = []
00271       for i in range(0, length):
00272         val1 = geometry_msgs.msg.Pose()
00273         _v3 = val1.position
00274         _x = _v3
00275         start = end
00276         end += 24
00277         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00278         _v4 = val1.orientation
00279         _x = _v4
00280         start = end
00281         end += 32
00282         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00283         self.result.blocks.poses.append(val1)
00284       return self
00285     except struct.error as e:
00286       raise genpy.DeserializationError(e) #most likely buffer underfill
00287 
00288 
00289   def serialize_numpy(self, buff, numpy):
00290     """
00291     serialize message with numpy array types into buffer
00292     :param buff: buffer, ``StringIO``
00293     :param numpy: numpy python module
00294     """
00295     try:
00296       _x = self
00297       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00298       _x = self.header.frame_id
00299       length = len(_x)
00300       if python3 or type(_x) == unicode:
00301         _x = _x.encode('utf-8')
00302         length = len(_x)
00303       buff.write(struct.pack('<I%ss'%length, length, _x))
00304       _x = self
00305       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00306       _x = self.status.goal_id.id
00307       length = len(_x)
00308       if python3 or type(_x) == unicode:
00309         _x = _x.encode('utf-8')
00310         length = len(_x)
00311       buff.write(struct.pack('<I%ss'%length, length, _x))
00312       buff.write(_struct_B.pack(self.status.status))
00313       _x = self.status.text
00314       length = len(_x)
00315       if python3 or type(_x) == unicode:
00316         _x = _x.encode('utf-8')
00317         length = len(_x)
00318       buff.write(struct.pack('<I%ss'%length, length, _x))
00319       _x = self
00320       buff.write(_struct_3I.pack(_x.result.blocks.header.seq, _x.result.blocks.header.stamp.secs, _x.result.blocks.header.stamp.nsecs))
00321       _x = self.result.blocks.header.frame_id
00322       length = len(_x)
00323       if python3 or type(_x) == unicode:
00324         _x = _x.encode('utf-8')
00325         length = len(_x)
00326       buff.write(struct.pack('<I%ss'%length, length, _x))
00327       length = len(self.result.blocks.poses)
00328       buff.write(_struct_I.pack(length))
00329       for val1 in self.result.blocks.poses:
00330         _v5 = val1.position
00331         _x = _v5
00332         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00333         _v6 = val1.orientation
00334         _x = _v6
00335         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00336     except struct.error as se: self._check_types(se)
00337     except TypeError as te: self._check_types(te)
00338 
00339   def deserialize_numpy(self, str, numpy):
00340     """
00341     unpack serialized message in str into this message instance using numpy for array types
00342     :param str: byte array of serialized message, ``str``
00343     :param numpy: numpy python module
00344     """
00345     try:
00346       if self.header is None:
00347         self.header = std_msgs.msg.Header()
00348       if self.status is None:
00349         self.status = actionlib_msgs.msg.GoalStatus()
00350       if self.result is None:
00351         self.result = turtlebot_block_manipulation.msg.BlockDetectionResult()
00352       end = 0
00353       _x = self
00354       start = end
00355       end += 12
00356       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00357       start = end
00358       end += 4
00359       (length,) = _struct_I.unpack(str[start:end])
00360       start = end
00361       end += length
00362       if python3:
00363         self.header.frame_id = str[start:end].decode('utf-8')
00364       else:
00365         self.header.frame_id = str[start:end]
00366       _x = self
00367       start = end
00368       end += 8
00369       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00370       start = end
00371       end += 4
00372       (length,) = _struct_I.unpack(str[start:end])
00373       start = end
00374       end += length
00375       if python3:
00376         self.status.goal_id.id = str[start:end].decode('utf-8')
00377       else:
00378         self.status.goal_id.id = str[start:end]
00379       start = end
00380       end += 1
00381       (self.status.status,) = _struct_B.unpack(str[start:end])
00382       start = end
00383       end += 4
00384       (length,) = _struct_I.unpack(str[start:end])
00385       start = end
00386       end += length
00387       if python3:
00388         self.status.text = str[start:end].decode('utf-8')
00389       else:
00390         self.status.text = str[start:end]
00391       _x = self
00392       start = end
00393       end += 12
00394       (_x.result.blocks.header.seq, _x.result.blocks.header.stamp.secs, _x.result.blocks.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00395       start = end
00396       end += 4
00397       (length,) = _struct_I.unpack(str[start:end])
00398       start = end
00399       end += length
00400       if python3:
00401         self.result.blocks.header.frame_id = str[start:end].decode('utf-8')
00402       else:
00403         self.result.blocks.header.frame_id = str[start:end]
00404       start = end
00405       end += 4
00406       (length,) = _struct_I.unpack(str[start:end])
00407       self.result.blocks.poses = []
00408       for i in range(0, length):
00409         val1 = geometry_msgs.msg.Pose()
00410         _v7 = val1.position
00411         _x = _v7
00412         start = end
00413         end += 24
00414         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00415         _v8 = val1.orientation
00416         _x = _v8
00417         start = end
00418         end += 32
00419         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00420         self.result.blocks.poses.append(val1)
00421       return self
00422     except struct.error as e:
00423       raise genpy.DeserializationError(e) #most likely buffer underfill
00424 
00425 _struct_I = genpy.struct_I
00426 _struct_4d = struct.Struct("<4d")
00427 _struct_3I = struct.Struct("<3I")
00428 _struct_B = struct.Struct("<B")
00429 _struct_2I = struct.Struct("<2I")
00430 _struct_3d = struct.Struct("<3d")


turtlebot_block_manipulation
Author(s): Helen Oleynikova
autogenerated on Thu Dec 12 2013 12:33:52