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


pr2_gripper_sensor_msgs
Author(s): Joe Romano
autogenerated on Mon Oct 6 2014 12:17:32