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