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