00001 """autogenerated by genmsg_py from PR2GripperGrabResult.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import pr2_gripper_sensor_msgs.msg
00006
00007 class PR2GripperGrabResult(roslib.message.Message):
00008 _md5sum = "b4b68d48ac7d07bdb11b7f3badfa9266"
00009 _type = "pr2_gripper_sensor_msgs/PR2GripperGrabResult"
00010 _has_header = False
00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00012 #result
00013 PR2GripperGrabData data
00014
00015 ================================================================================
00016 MSG: pr2_gripper_sensor_msgs/PR2GripperGrabData
00017 # the control state of our realtime controller
00018 PR2GripperSensorRTState rtstate
00019 ================================================================================
00020 MSG: pr2_gripper_sensor_msgs/PR2GripperSensorRTState
00021 # the control state of our realtime controller
00022 int8 realtime_controller_state
00023
00024 # predefined values to indicate our realtime_controller_state
00025 int8 DISABLED = 0
00026 int8 POSITION_SERVO = 3
00027 int8 FORCE_SERVO = 4
00028 int8 FIND_CONTACT = 5
00029 int8 SLIP_SERVO = 6
00030 """
00031 __slots__ = ['data']
00032 _slot_types = ['pr2_gripper_sensor_msgs/PR2GripperGrabData']
00033
00034 def __init__(self, *args, **kwds):
00035 """
00036 Constructor. Any message fields that are implicitly/explicitly
00037 set to None will be assigned a default value. The recommend
00038 use is keyword arguments as this is more robust to future message
00039 changes. You cannot mix in-order arguments and keyword arguments.
00040
00041 The available fields are:
00042 data
00043
00044 @param args: complete set of field values, in .msg order
00045 @param kwds: use keyword arguments corresponding to message field names
00046 to set specific fields.
00047 """
00048 if args or kwds:
00049 super(PR2GripperGrabResult, self).__init__(*args, **kwds)
00050
00051 if self.data is None:
00052 self.data = pr2_gripper_sensor_msgs.msg.PR2GripperGrabData()
00053 else:
00054 self.data = pr2_gripper_sensor_msgs.msg.PR2GripperGrabData()
00055
00056 def _get_types(self):
00057 """
00058 internal API method
00059 """
00060 return self._slot_types
00061
00062 def serialize(self, buff):
00063 """
00064 serialize message into buffer
00065 @param buff: buffer
00066 @type buff: StringIO
00067 """
00068 try:
00069 buff.write(_struct_b.pack(self.data.rtstate.realtime_controller_state))
00070 except struct.error, se: self._check_types(se)
00071 except TypeError, te: self._check_types(te)
00072
00073 def deserialize(self, str):
00074 """
00075 unpack serialized message in str into this message instance
00076 @param str: byte array of serialized message
00077 @type str: str
00078 """
00079 try:
00080 if self.data is None:
00081 self.data = pr2_gripper_sensor_msgs.msg.PR2GripperGrabData()
00082 end = 0
00083 start = end
00084 end += 1
00085 (self.data.rtstate.realtime_controller_state,) = _struct_b.unpack(str[start:end])
00086 return self
00087 except struct.error, e:
00088 raise roslib.message.DeserializationError(e)
00089
00090
00091 def serialize_numpy(self, buff, numpy):
00092 """
00093 serialize message with numpy array types into buffer
00094 @param buff: buffer
00095 @type buff: StringIO
00096 @param numpy: numpy python module
00097 @type numpy module
00098 """
00099 try:
00100 buff.write(_struct_b.pack(self.data.rtstate.realtime_controller_state))
00101 except struct.error, se: self._check_types(se)
00102 except TypeError, te: self._check_types(te)
00103
00104 def deserialize_numpy(self, str, numpy):
00105 """
00106 unpack serialized message in str into this message instance using numpy for array types
00107 @param str: byte array of serialized message
00108 @type str: str
00109 @param numpy: numpy python module
00110 @type numpy: module
00111 """
00112 try:
00113 if self.data is None:
00114 self.data = pr2_gripper_sensor_msgs.msg.PR2GripperGrabData()
00115 end = 0
00116 start = end
00117 end += 1
00118 (self.data.rtstate.realtime_controller_state,) = _struct_b.unpack(str[start:end])
00119 return self
00120 except struct.error, e:
00121 raise roslib.message.DeserializationError(e)
00122
00123 _struct_I = roslib.message.struct_I
00124 _struct_b = struct.Struct("<b")