$search
00001 """autogenerated by genmsg_py from PR2GripperFindContactGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import pr2_gripper_sensor_msgs.msg 00006 00007 class PR2GripperFindContactGoal(roslib.message.Message): 00008 _md5sum = "f0ae570e217e7429eba0f205341933a0" 00009 _type = "pr2_gripper_sensor_msgs/PR2GripperFindContactGoal" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00012 # Contact action used to close fingers and find object contacts 00013 # quickly while still stopping fast in real-time to not damage 00014 # objects 00015 00016 #goal 00017 PR2GripperFindContactCommand command 00018 00019 ================================================================================ 00020 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactCommand 00021 # set true if you want to calibrate the fingertip sensors on the start 00022 # of the find_contact action. While this is not necessary (and 00023 # the default value will not calibrate the sensors) for best 00024 # performance it is recommended that you set this to true each time 00025 # you are calling find_contact and are confident the fingertips are 00026 # not touching anything 00027 # NOTE: SHOULD ONLY BE TRUE WHEN BOTH FINGERS ARE TOUCHING NOTHING 00028 bool zero_fingertip_sensors 00029 00030 # the finger contact conditions that determine what our goal is 00031 # Leaving this field blank will result in the robot closing until 00032 # contact on BOTH fingers is achieved 00033 int8 contact_conditions 00034 00035 # predefined values for the above contact_conditions variable 00036 int8 BOTH = 0 # both fingers must make contact 00037 int8 LEFT = 1 # just the left finger 00038 int8 RIGHT = 2 # just the right finger 00039 int8 EITHER = 3 # either finger, we don't care which 00040 00041 """ 00042 __slots__ = ['command'] 00043 _slot_types = ['pr2_gripper_sensor_msgs/PR2GripperFindContactCommand'] 00044 00045 def __init__(self, *args, **kwds): 00046 """ 00047 Constructor. Any message fields that are implicitly/explicitly 00048 set to None will be assigned a default value. The recommend 00049 use is keyword arguments as this is more robust to future message 00050 changes. You cannot mix in-order arguments and keyword arguments. 00051 00052 The available fields are: 00053 command 00054 00055 @param args: complete set of field values, in .msg order 00056 @param kwds: use keyword arguments corresponding to message field names 00057 to set specific fields. 00058 """ 00059 if args or kwds: 00060 super(PR2GripperFindContactGoal, self).__init__(*args, **kwds) 00061 #message fields cannot be None, assign default values for those that are 00062 if self.command is None: 00063 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactCommand() 00064 else: 00065 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactCommand() 00066 00067 def _get_types(self): 00068 """ 00069 internal API method 00070 """ 00071 return self._slot_types 00072 00073 def serialize(self, buff): 00074 """ 00075 serialize message into buffer 00076 @param buff: buffer 00077 @type buff: StringIO 00078 """ 00079 try: 00080 _x = self 00081 buff.write(_struct_Bb.pack(_x.command.zero_fingertip_sensors, _x.command.contact_conditions)) 00082 except struct.error as se: self._check_types(se) 00083 except TypeError as te: self._check_types(te) 00084 00085 def deserialize(self, str): 00086 """ 00087 unpack serialized message in str into this message instance 00088 @param str: byte array of serialized message 00089 @type str: str 00090 """ 00091 try: 00092 if self.command is None: 00093 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactCommand() 00094 end = 0 00095 _x = self 00096 start = end 00097 end += 2 00098 (_x.command.zero_fingertip_sensors, _x.command.contact_conditions,) = _struct_Bb.unpack(str[start:end]) 00099 self.command.zero_fingertip_sensors = bool(self.command.zero_fingertip_sensors) 00100 return self 00101 except struct.error as e: 00102 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00103 00104 00105 def serialize_numpy(self, buff, numpy): 00106 """ 00107 serialize message with numpy array types into buffer 00108 @param buff: buffer 00109 @type buff: StringIO 00110 @param numpy: numpy python module 00111 @type numpy module 00112 """ 00113 try: 00114 _x = self 00115 buff.write(_struct_Bb.pack(_x.command.zero_fingertip_sensors, _x.command.contact_conditions)) 00116 except struct.error as se: self._check_types(se) 00117 except TypeError as te: self._check_types(te) 00118 00119 def deserialize_numpy(self, str, numpy): 00120 """ 00121 unpack serialized message in str into this message instance using numpy for array types 00122 @param str: byte array of serialized message 00123 @type str: str 00124 @param numpy: numpy python module 00125 @type numpy: module 00126 """ 00127 try: 00128 if self.command is None: 00129 self.command = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactCommand() 00130 end = 0 00131 _x = self 00132 start = end 00133 end += 2 00134 (_x.command.zero_fingertip_sensors, _x.command.contact_conditions,) = _struct_Bb.unpack(str[start:end]) 00135 self.command.zero_fingertip_sensors = bool(self.command.zero_fingertip_sensors) 00136 return self 00137 except struct.error as e: 00138 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00139 00140 _struct_I = roslib.message.struct_I 00141 _struct_Bb = struct.Struct("<Bb")