00001 """autogenerated by genmsg_py from ManipulationPhase.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class ManipulationPhase(roslib.message.Message):
00007 _md5sum = "2c824c847a35d8fd9277d324a3723378"
00008 _type = "object_manipulation_msgs/ManipulationPhase"
00009 _has_header = False
00010 _full_text = """int32 CHECKING_FEASIBILITY = 0
00011 int32 MOVING_TO_PREGRASP = 1
00012 int32 MOVING_TO_GRASP = 2
00013 int32 CLOSING = 3
00014 int32 ADJUSTING_GRASP = 4
00015 int32 LIFTING = 5
00016 int32 MOVING_WITH_OBJECT = 6
00017 int32 MOVING_TO_PLACE = 7
00018 int32 PLACING = 8
00019 int32 OPENING = 9
00020 int32 RETREATING = 10
00021 int32 MOVING_WITHOUT_OBJECT = 11
00022 int32 SHAKING = 12
00023 int32 SUCCEEDED = 13
00024 int32 FAILED = 14
00025 int32 ABORTED = 15
00026 int32 HOLDING_OBJECT = 16
00027
00028 int32 phase
00029 """
00030
00031 CHECKING_FEASIBILITY = 0
00032 MOVING_TO_PREGRASP = 1
00033 MOVING_TO_GRASP = 2
00034 CLOSING = 3
00035 ADJUSTING_GRASP = 4
00036 LIFTING = 5
00037 MOVING_WITH_OBJECT = 6
00038 MOVING_TO_PLACE = 7
00039 PLACING = 8
00040 OPENING = 9
00041 RETREATING = 10
00042 MOVING_WITHOUT_OBJECT = 11
00043 SHAKING = 12
00044 SUCCEEDED = 13
00045 FAILED = 14
00046 ABORTED = 15
00047 HOLDING_OBJECT = 16
00048
00049 __slots__ = ['phase']
00050 _slot_types = ['int32']
00051
00052 def __init__(self, *args, **kwds):
00053 """
00054 Constructor. Any message fields that are implicitly/explicitly
00055 set to None will be assigned a default value. The recommend
00056 use is keyword arguments as this is more robust to future message
00057 changes. You cannot mix in-order arguments and keyword arguments.
00058
00059 The available fields are:
00060 phase
00061
00062 @param args: complete set of field values, in .msg order
00063 @param kwds: use keyword arguments corresponding to message field names
00064 to set specific fields.
00065 """
00066 if args or kwds:
00067 super(ManipulationPhase, self).__init__(*args, **kwds)
00068
00069 if self.phase is None:
00070 self.phase = 0
00071 else:
00072 self.phase = 0
00073
00074 def _get_types(self):
00075 """
00076 internal API method
00077 """
00078 return self._slot_types
00079
00080 def serialize(self, buff):
00081 """
00082 serialize message into buffer
00083 @param buff: buffer
00084 @type buff: StringIO
00085 """
00086 try:
00087 buff.write(_struct_i.pack(self.phase))
00088 except struct.error, se: self._check_types(se)
00089 except TypeError, te: self._check_types(te)
00090
00091 def deserialize(self, str):
00092 """
00093 unpack serialized message in str into this message instance
00094 @param str: byte array of serialized message
00095 @type str: str
00096 """
00097 try:
00098 end = 0
00099 start = end
00100 end += 4
00101 (self.phase,) = _struct_i.unpack(str[start:end])
00102 return self
00103 except struct.error, e:
00104 raise roslib.message.DeserializationError(e)
00105
00106
00107 def serialize_numpy(self, buff, numpy):
00108 """
00109 serialize message with numpy array types into buffer
00110 @param buff: buffer
00111 @type buff: StringIO
00112 @param numpy: numpy python module
00113 @type numpy module
00114 """
00115 try:
00116 buff.write(_struct_i.pack(self.phase))
00117 except struct.error, se: self._check_types(se)
00118 except TypeError, te: self._check_types(te)
00119
00120 def deserialize_numpy(self, str, numpy):
00121 """
00122 unpack serialized message in str into this message instance using numpy for array types
00123 @param str: byte array of serialized message
00124 @type str: str
00125 @param numpy: numpy python module
00126 @type numpy: module
00127 """
00128 try:
00129 end = 0
00130 start = end
00131 end += 4
00132 (self.phase,) = _struct_i.unpack(str[start:end])
00133 return self
00134 except struct.error, e:
00135 raise roslib.message.DeserializationError(e)
00136
00137 _struct_I = roslib.message.struct_I
00138 _struct_i = struct.Struct("<i")