_GraspResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from object_manipulation_msgs/GraspResult.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class GraspResult(genpy.Message):
00009   _md5sum = "c8a909da895cdddc0630aafd59848191"
00010   _type = "object_manipulation_msgs/GraspResult"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """int32 SUCCESS = 1
00013 int32 GRASP_OUT_OF_REACH = 2
00014 int32 GRASP_IN_COLLISION = 3
00015 int32 GRASP_UNFEASIBLE = 4
00016 int32 PREGRASP_OUT_OF_REACH = 5
00017 int32 PREGRASP_IN_COLLISION = 6
00018 int32 PREGRASP_UNFEASIBLE = 7
00019 int32 LIFT_OUT_OF_REACH = 8
00020 int32 LIFT_IN_COLLISION = 9
00021 int32 LIFT_UNFEASIBLE = 10
00022 int32 MOVE_ARM_FAILED = 11
00023 int32 GRASP_FAILED = 12
00024 int32 LIFT_FAILED = 13
00025 int32 RETREAT_FAILED = 14
00026 int32 result_code
00027 
00028 # whether the state of the world was disturbed by this attempt. generally, this flag
00029 # shows if another task can be attempted, or a new sensed world model is recommeded
00030 # before proceeding
00031 bool continuation_possible
00032 
00033 """
00034   # Pseudo-constants
00035   SUCCESS = 1
00036   GRASP_OUT_OF_REACH = 2
00037   GRASP_IN_COLLISION = 3
00038   GRASP_UNFEASIBLE = 4
00039   PREGRASP_OUT_OF_REACH = 5
00040   PREGRASP_IN_COLLISION = 6
00041   PREGRASP_UNFEASIBLE = 7
00042   LIFT_OUT_OF_REACH = 8
00043   LIFT_IN_COLLISION = 9
00044   LIFT_UNFEASIBLE = 10
00045   MOVE_ARM_FAILED = 11
00046   GRASP_FAILED = 12
00047   LIFT_FAILED = 13
00048   RETREAT_FAILED = 14
00049 
00050   __slots__ = ['result_code','continuation_possible']
00051   _slot_types = ['int32','bool']
00052 
00053   def __init__(self, *args, **kwds):
00054     """
00055     Constructor. Any message fields that are implicitly/explicitly
00056     set to None will be assigned a default value. The recommend
00057     use is keyword arguments as this is more robust to future message
00058     changes.  You cannot mix in-order arguments and keyword arguments.
00059 
00060     The available fields are:
00061        result_code,continuation_possible
00062 
00063     :param args: complete set of field values, in .msg order
00064     :param kwds: use keyword arguments corresponding to message field names
00065     to set specific fields.
00066     """
00067     if args or kwds:
00068       super(GraspResult, self).__init__(*args, **kwds)
00069       #message fields cannot be None, assign default values for those that are
00070       if self.result_code is None:
00071         self.result_code = 0
00072       if self.continuation_possible is None:
00073         self.continuation_possible = False
00074     else:
00075       self.result_code = 0
00076       self.continuation_possible = False
00077 
00078   def _get_types(self):
00079     """
00080     internal API method
00081     """
00082     return self._slot_types
00083 
00084   def serialize(self, buff):
00085     """
00086     serialize message into buffer
00087     :param buff: buffer, ``StringIO``
00088     """
00089     try:
00090       _x = self
00091       buff.write(_struct_iB.pack(_x.result_code, _x.continuation_possible))
00092     except struct.error as se: self._check_types(se)
00093     except TypeError as te: self._check_types(te)
00094 
00095   def deserialize(self, str):
00096     """
00097     unpack serialized message in str into this message instance
00098     :param str: byte array of serialized message, ``str``
00099     """
00100     try:
00101       end = 0
00102       _x = self
00103       start = end
00104       end += 5
00105       (_x.result_code, _x.continuation_possible,) = _struct_iB.unpack(str[start:end])
00106       self.continuation_possible = bool(self.continuation_possible)
00107       return self
00108     except struct.error as e:
00109       raise genpy.DeserializationError(e) #most likely buffer underfill
00110 
00111 
00112   def serialize_numpy(self, buff, numpy):
00113     """
00114     serialize message with numpy array types into buffer
00115     :param buff: buffer, ``StringIO``
00116     :param numpy: numpy python module
00117     """
00118     try:
00119       _x = self
00120       buff.write(_struct_iB.pack(_x.result_code, _x.continuation_possible))
00121     except struct.error as se: self._check_types(se)
00122     except TypeError as te: self._check_types(te)
00123 
00124   def deserialize_numpy(self, str, numpy):
00125     """
00126     unpack serialized message in str into this message instance using numpy for array types
00127     :param str: byte array of serialized message, ``str``
00128     :param numpy: numpy python module
00129     """
00130     try:
00131       end = 0
00132       _x = self
00133       start = end
00134       end += 5
00135       (_x.result_code, _x.continuation_possible,) = _struct_iB.unpack(str[start:end])
00136       self.continuation_possible = bool(self.continuation_possible)
00137       return self
00138     except struct.error as e:
00139       raise genpy.DeserializationError(e) #most likely buffer underfill
00140 
00141 _struct_I = genpy.struct_I
00142 _struct_iB = struct.Struct("<iB")


object_manipulation_msgs
Author(s): Matei Ciocarlie
autogenerated on Thu Jan 2 2014 11:38:11