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