Go to the documentation of this file.00001 """autogenerated by genpy from srs_msgs/GraspingErrorCodes.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 GraspingErrorCodes(genpy.Message):
00009 _md5sum = "fb4ddaa7ec6360421a2ce5489765a099"
00010 _type = "srs_msgs/GraspingErrorCodes"
00011 _has_header = False
00012 _full_text = """int32 val
00013
00014 int32 SUCCESS=1
00015 int32 SERVICE_DID_NOT_PROCESS_REQUEST=-1
00016 int32 UNKNOWN_OBJECT=-2
00017 int32 CORRUPTED_MESH_FILE=-3
00018 int32 CORRUPTED_ROBOT_MESH_FILE=-4
00019 int32 CORRUPTED_GRASP_FILE=-5
00020 int32 NON_GENERATED_INFO=-6
00021 int32 OBJECT_INFO_NOT_FOUND=-7
00022 int32 UNKNOWN_CATEGORY=-8
00023 int32 GOAL_UNREACHABLE=-9
00024
00025 """
00026
00027 SUCCESS = 1
00028 SERVICE_DID_NOT_PROCESS_REQUEST = -1
00029 UNKNOWN_OBJECT = -2
00030 CORRUPTED_MESH_FILE = -3
00031 CORRUPTED_ROBOT_MESH_FILE = -4
00032 CORRUPTED_GRASP_FILE = -5
00033 NON_GENERATED_INFO = -6
00034 OBJECT_INFO_NOT_FOUND = -7
00035 UNKNOWN_CATEGORY = -8
00036 GOAL_UNREACHABLE = -9
00037
00038 __slots__ = ['val']
00039 _slot_types = ['int32']
00040
00041 def __init__(self, *args, **kwds):
00042 """
00043 Constructor. Any message fields that are implicitly/explicitly
00044 set to None will be assigned a default value. The recommend
00045 use is keyword arguments as this is more robust to future message
00046 changes. You cannot mix in-order arguments and keyword arguments.
00047
00048 The available fields are:
00049 val
00050
00051 :param args: complete set of field values, in .msg order
00052 :param kwds: use keyword arguments corresponding to message field names
00053 to set specific fields.
00054 """
00055 if args or kwds:
00056 super(GraspingErrorCodes, self).__init__(*args, **kwds)
00057
00058 if self.val is None:
00059 self.val = 0
00060 else:
00061 self.val = 0
00062
00063 def _get_types(self):
00064 """
00065 internal API method
00066 """
00067 return self._slot_types
00068
00069 def serialize(self, buff):
00070 """
00071 serialize message into buffer
00072 :param buff: buffer, ``StringIO``
00073 """
00074 try:
00075 buff.write(_struct_i.pack(self.val))
00076 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00077 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00078
00079 def deserialize(self, str):
00080 """
00081 unpack serialized message in str into this message instance
00082 :param str: byte array of serialized message, ``str``
00083 """
00084 try:
00085 end = 0
00086 start = end
00087 end += 4
00088 (self.val,) = _struct_i.unpack(str[start:end])
00089 return self
00090 except struct.error as e:
00091 raise genpy.DeserializationError(e)
00092
00093
00094 def serialize_numpy(self, buff, numpy):
00095 """
00096 serialize message with numpy array types into buffer
00097 :param buff: buffer, ``StringIO``
00098 :param numpy: numpy python module
00099 """
00100 try:
00101 buff.write(_struct_i.pack(self.val))
00102 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00103 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00104
00105 def deserialize_numpy(self, str, numpy):
00106 """
00107 unpack serialized message in str into this message instance using numpy for array types
00108 :param str: byte array of serialized message, ``str``
00109 :param numpy: numpy python module
00110 """
00111 try:
00112 end = 0
00113 start = end
00114 end += 4
00115 (self.val,) = _struct_i.unpack(str[start:end])
00116 return self
00117 except struct.error as e:
00118 raise genpy.DeserializationError(e)
00119
00120 _struct_I = genpy.struct_I
00121 _struct_i = struct.Struct("<i")