_ArmHandActionResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from cogman_msgs/ArmHandActionResult.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 cogman_msgs.msg
00008 import genpy
00009 import actionlib_msgs.msg
00010 import vision_msgs.msg
00011 import std_msgs.msg
00012 
00013 class ArmHandActionResult(genpy.Message):
00014   _md5sum = "26b3a465a08de176dd678232ecbf4c1e"
00015   _type = "cogman_msgs/ArmHandActionResult"
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 ArmHandResult 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: cogman_msgs/ArmHandResult
00082 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00083 
00084 #result
00085 float32 distance_to_goal
00086 string situation            #Allowed: grasped slipped released unreachable ik_deadlock need_to_move_base
00087 vision_msgs/system_error error   #Description of error
00088 uint64[] better_base_ids    #List of lo_id's where we could grasp better
00089 
00090 ================================================================================
00091 MSG: vision_msgs/system_error
00092 uint64 MANIPULATION_POSE_UNREACHABLE = 64
00093 uint64 GRASP_FAILED = 128  # Grasp into the void
00094 uint64 OBJECT_NOT_FOUND = 256
00095 uint64 VISION_PRIMITIVE_FAILED = 512
00096 uint64 CONTRADICTING_TACTILE_FEEDBACK = 1024  # Collide without expecting it
00097 uint64 CONTRADICTING_VISION_RESULTS = 2048
00098 uint64 GRASP_FAILED_AND_CRASHED = 4096  # Throwing something out of the way
00099 uint64 JLO_ERROR = 8192  # Could not get position
00100 uint64 VECTOR_FIELD_CANT_REACH = 16384  # The arm got stuck along the way, did not reach the final grasping pose
00101 
00102 uint64  error_id                # One of the error constants defined above
00103 string  node_name               # The node causing this error
00104 string  error_description       # Further information about the error
00105 
00106 """
00107   __slots__ = ['header','status','result']
00108   _slot_types = ['std_msgs/Header','actionlib_msgs/GoalStatus','cogman_msgs/ArmHandResult']
00109 
00110   def __init__(self, *args, **kwds):
00111     """
00112     Constructor. Any message fields that are implicitly/explicitly
00113     set to None will be assigned a default value. The recommend
00114     use is keyword arguments as this is more robust to future message
00115     changes.  You cannot mix in-order arguments and keyword arguments.
00116 
00117     The available fields are:
00118        header,status,result
00119 
00120     :param args: complete set of field values, in .msg order
00121     :param kwds: use keyword arguments corresponding to message field names
00122     to set specific fields.
00123     """
00124     if args or kwds:
00125       super(ArmHandActionResult, self).__init__(*args, **kwds)
00126       #message fields cannot be None, assign default values for those that are
00127       if self.header is None:
00128         self.header = std_msgs.msg.Header()
00129       if self.status is None:
00130         self.status = actionlib_msgs.msg.GoalStatus()
00131       if self.result is None:
00132         self.result = cogman_msgs.msg.ArmHandResult()
00133     else:
00134       self.header = std_msgs.msg.Header()
00135       self.status = actionlib_msgs.msg.GoalStatus()
00136       self.result = cogman_msgs.msg.ArmHandResult()
00137 
00138   def _get_types(self):
00139     """
00140     internal API method
00141     """
00142     return self._slot_types
00143 
00144   def serialize(self, buff):
00145     """
00146     serialize message into buffer
00147     :param buff: buffer, ``StringIO``
00148     """
00149     try:
00150       _x = self
00151       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00152       _x = self.header.frame_id
00153       length = len(_x)
00154       if python3 or type(_x) == unicode:
00155         _x = _x.encode('utf-8')
00156         length = len(_x)
00157       buff.write(struct.pack('<I%ss'%length, length, _x))
00158       _x = self
00159       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00160       _x = self.status.goal_id.id
00161       length = len(_x)
00162       if python3 or type(_x) == unicode:
00163         _x = _x.encode('utf-8')
00164         length = len(_x)
00165       buff.write(struct.pack('<I%ss'%length, length, _x))
00166       buff.write(_struct_B.pack(self.status.status))
00167       _x = self.status.text
00168       length = len(_x)
00169       if python3 or type(_x) == unicode:
00170         _x = _x.encode('utf-8')
00171         length = len(_x)
00172       buff.write(struct.pack('<I%ss'%length, length, _x))
00173       buff.write(_struct_f.pack(self.result.distance_to_goal))
00174       _x = self.result.situation
00175       length = len(_x)
00176       if python3 or type(_x) == unicode:
00177         _x = _x.encode('utf-8')
00178         length = len(_x)
00179       buff.write(struct.pack('<I%ss'%length, length, _x))
00180       buff.write(_struct_Q.pack(self.result.error.error_id))
00181       _x = self.result.error.node_name
00182       length = len(_x)
00183       if python3 or type(_x) == unicode:
00184         _x = _x.encode('utf-8')
00185         length = len(_x)
00186       buff.write(struct.pack('<I%ss'%length, length, _x))
00187       _x = self.result.error.error_description
00188       length = len(_x)
00189       if python3 or type(_x) == unicode:
00190         _x = _x.encode('utf-8')
00191         length = len(_x)
00192       buff.write(struct.pack('<I%ss'%length, length, _x))
00193       length = len(self.result.better_base_ids)
00194       buff.write(_struct_I.pack(length))
00195       pattern = '<%sQ'%length
00196       buff.write(struct.pack(pattern, *self.result.better_base_ids))
00197     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00198     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00199 
00200   def deserialize(self, str):
00201     """
00202     unpack serialized message in str into this message instance
00203     :param str: byte array of serialized message, ``str``
00204     """
00205     try:
00206       if self.header is None:
00207         self.header = std_msgs.msg.Header()
00208       if self.status is None:
00209         self.status = actionlib_msgs.msg.GoalStatus()
00210       if self.result is None:
00211         self.result = cogman_msgs.msg.ArmHandResult()
00212       end = 0
00213       _x = self
00214       start = end
00215       end += 12
00216       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00217       start = end
00218       end += 4
00219       (length,) = _struct_I.unpack(str[start:end])
00220       start = end
00221       end += length
00222       if python3:
00223         self.header.frame_id = str[start:end].decode('utf-8')
00224       else:
00225         self.header.frame_id = str[start:end]
00226       _x = self
00227       start = end
00228       end += 8
00229       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00230       start = end
00231       end += 4
00232       (length,) = _struct_I.unpack(str[start:end])
00233       start = end
00234       end += length
00235       if python3:
00236         self.status.goal_id.id = str[start:end].decode('utf-8')
00237       else:
00238         self.status.goal_id.id = str[start:end]
00239       start = end
00240       end += 1
00241       (self.status.status,) = _struct_B.unpack(str[start:end])
00242       start = end
00243       end += 4
00244       (length,) = _struct_I.unpack(str[start:end])
00245       start = end
00246       end += length
00247       if python3:
00248         self.status.text = str[start:end].decode('utf-8')
00249       else:
00250         self.status.text = str[start:end]
00251       start = end
00252       end += 4
00253       (self.result.distance_to_goal,) = _struct_f.unpack(str[start:end])
00254       start = end
00255       end += 4
00256       (length,) = _struct_I.unpack(str[start:end])
00257       start = end
00258       end += length
00259       if python3:
00260         self.result.situation = str[start:end].decode('utf-8')
00261       else:
00262         self.result.situation = str[start:end]
00263       start = end
00264       end += 8
00265       (self.result.error.error_id,) = _struct_Q.unpack(str[start:end])
00266       start = end
00267       end += 4
00268       (length,) = _struct_I.unpack(str[start:end])
00269       start = end
00270       end += length
00271       if python3:
00272         self.result.error.node_name = str[start:end].decode('utf-8')
00273       else:
00274         self.result.error.node_name = str[start:end]
00275       start = end
00276       end += 4
00277       (length,) = _struct_I.unpack(str[start:end])
00278       start = end
00279       end += length
00280       if python3:
00281         self.result.error.error_description = str[start:end].decode('utf-8')
00282       else:
00283         self.result.error.error_description = str[start:end]
00284       start = end
00285       end += 4
00286       (length,) = _struct_I.unpack(str[start:end])
00287       pattern = '<%sQ'%length
00288       start = end
00289       end += struct.calcsize(pattern)
00290       self.result.better_base_ids = struct.unpack(pattern, str[start:end])
00291       return self
00292     except struct.error as e:
00293       raise genpy.DeserializationError(e) #most likely buffer underfill
00294 
00295 
00296   def serialize_numpy(self, buff, numpy):
00297     """
00298     serialize message with numpy array types into buffer
00299     :param buff: buffer, ``StringIO``
00300     :param numpy: numpy python module
00301     """
00302     try:
00303       _x = self
00304       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00305       _x = self.header.frame_id
00306       length = len(_x)
00307       if python3 or type(_x) == unicode:
00308         _x = _x.encode('utf-8')
00309         length = len(_x)
00310       buff.write(struct.pack('<I%ss'%length, length, _x))
00311       _x = self
00312       buff.write(_struct_2I.pack(_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs))
00313       _x = self.status.goal_id.id
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       buff.write(_struct_B.pack(self.status.status))
00320       _x = self.status.text
00321       length = len(_x)
00322       if python3 or type(_x) == unicode:
00323         _x = _x.encode('utf-8')
00324         length = len(_x)
00325       buff.write(struct.pack('<I%ss'%length, length, _x))
00326       buff.write(_struct_f.pack(self.result.distance_to_goal))
00327       _x = self.result.situation
00328       length = len(_x)
00329       if python3 or type(_x) == unicode:
00330         _x = _x.encode('utf-8')
00331         length = len(_x)
00332       buff.write(struct.pack('<I%ss'%length, length, _x))
00333       buff.write(_struct_Q.pack(self.result.error.error_id))
00334       _x = self.result.error.node_name
00335       length = len(_x)
00336       if python3 or type(_x) == unicode:
00337         _x = _x.encode('utf-8')
00338         length = len(_x)
00339       buff.write(struct.pack('<I%ss'%length, length, _x))
00340       _x = self.result.error.error_description
00341       length = len(_x)
00342       if python3 or type(_x) == unicode:
00343         _x = _x.encode('utf-8')
00344         length = len(_x)
00345       buff.write(struct.pack('<I%ss'%length, length, _x))
00346       length = len(self.result.better_base_ids)
00347       buff.write(_struct_I.pack(length))
00348       pattern = '<%sQ'%length
00349       buff.write(self.result.better_base_ids.tostring())
00350     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00351     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00352 
00353   def deserialize_numpy(self, str, numpy):
00354     """
00355     unpack serialized message in str into this message instance using numpy for array types
00356     :param str: byte array of serialized message, ``str``
00357     :param numpy: numpy python module
00358     """
00359     try:
00360       if self.header is None:
00361         self.header = std_msgs.msg.Header()
00362       if self.status is None:
00363         self.status = actionlib_msgs.msg.GoalStatus()
00364       if self.result is None:
00365         self.result = cogman_msgs.msg.ArmHandResult()
00366       end = 0
00367       _x = self
00368       start = end
00369       end += 12
00370       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00371       start = end
00372       end += 4
00373       (length,) = _struct_I.unpack(str[start:end])
00374       start = end
00375       end += length
00376       if python3:
00377         self.header.frame_id = str[start:end].decode('utf-8')
00378       else:
00379         self.header.frame_id = str[start:end]
00380       _x = self
00381       start = end
00382       end += 8
00383       (_x.status.goal_id.stamp.secs, _x.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00384       start = end
00385       end += 4
00386       (length,) = _struct_I.unpack(str[start:end])
00387       start = end
00388       end += length
00389       if python3:
00390         self.status.goal_id.id = str[start:end].decode('utf-8')
00391       else:
00392         self.status.goal_id.id = str[start:end]
00393       start = end
00394       end += 1
00395       (self.status.status,) = _struct_B.unpack(str[start:end])
00396       start = end
00397       end += 4
00398       (length,) = _struct_I.unpack(str[start:end])
00399       start = end
00400       end += length
00401       if python3:
00402         self.status.text = str[start:end].decode('utf-8')
00403       else:
00404         self.status.text = str[start:end]
00405       start = end
00406       end += 4
00407       (self.result.distance_to_goal,) = _struct_f.unpack(str[start:end])
00408       start = end
00409       end += 4
00410       (length,) = _struct_I.unpack(str[start:end])
00411       start = end
00412       end += length
00413       if python3:
00414         self.result.situation = str[start:end].decode('utf-8')
00415       else:
00416         self.result.situation = str[start:end]
00417       start = end
00418       end += 8
00419       (self.result.error.error_id,) = _struct_Q.unpack(str[start:end])
00420       start = end
00421       end += 4
00422       (length,) = _struct_I.unpack(str[start:end])
00423       start = end
00424       end += length
00425       if python3:
00426         self.result.error.node_name = str[start:end].decode('utf-8')
00427       else:
00428         self.result.error.node_name = str[start:end]
00429       start = end
00430       end += 4
00431       (length,) = _struct_I.unpack(str[start:end])
00432       start = end
00433       end += length
00434       if python3:
00435         self.result.error.error_description = str[start:end].decode('utf-8')
00436       else:
00437         self.result.error.error_description = str[start:end]
00438       start = end
00439       end += 4
00440       (length,) = _struct_I.unpack(str[start:end])
00441       pattern = '<%sQ'%length
00442       start = end
00443       end += struct.calcsize(pattern)
00444       self.result.better_base_ids = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=length)
00445       return self
00446     except struct.error as e:
00447       raise genpy.DeserializationError(e) #most likely buffer underfill
00448 
00449 _struct_I = genpy.struct_I
00450 _struct_Q = struct.Struct("<Q")
00451 _struct_3I = struct.Struct("<3I")
00452 _struct_B = struct.Struct("<B")
00453 _struct_2I = struct.Struct("<2I")
00454 _struct_f = struct.Struct("<f")


cogman_msgs
Author(s): Alexis Maldonado
autogenerated on Mon Oct 6 2014 00:48:49