_PR2GripperFindContactFeedback.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperFindContactFeedback.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 genpy
00008 import pr2_gripper_sensor_msgs.msg
00009 
00010 class PR2GripperFindContactFeedback(genpy.Message):
00011   _md5sum = "a1cc8c2fc9268b550e6167f268f97574"
00012   _type = "pr2_gripper_sensor_msgs/PR2GripperFindContactFeedback"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00015 # feedback
00016 PR2GripperFindContactData data
00017 
00018 
00019 
00020 ================================================================================
00021 MSG: pr2_gripper_sensor_msgs/PR2GripperFindContactData
00022 # Time the data was recorded at
00023 time stamp
00024 
00025 # true when our contact conditions have been met
00026 # (see PR2GripperFindContact command)
00027 bool contact_conditions_met
00028 
00029 # the finger contact conditions 
00030 # true if the finger experienced a contact event
00031 #
00032 # contact events are defined as contact with the fingerpads
00033 # as either steady-state or high-freq force events
00034 bool left_fingertip_pad_contact
00035 bool right_fingertip_pad_contact
00036 
00037 # the force experinced by the finger Pads  (N)
00038 # NOTE:this ignores data from the edges of the finger pressure
00039 float64 left_fingertip_pad_force
00040 float64 right_fingertip_pad_force
00041 
00042 # the current joint position (m)
00043 float64 joint_position
00044 
00045 # the virtual (parallel) joint effort (N)
00046 float64 joint_effort
00047 
00048 # the control state of our realtime controller
00049 PR2GripperSensorRTState rtstate
00050 ================================================================================
00051 MSG: pr2_gripper_sensor_msgs/PR2GripperSensorRTState
00052 # the control state of our realtime controller
00053 int8 realtime_controller_state
00054 
00055 # predefined values to indicate our realtime_controller_state
00056 int8 DISABLED = 0
00057 int8 POSITION_SERVO = 3
00058 int8 FORCE_SERVO = 4
00059 int8 FIND_CONTACT = 5
00060 int8 SLIP_SERVO = 6
00061 """
00062   __slots__ = ['data']
00063   _slot_types = ['pr2_gripper_sensor_msgs/PR2GripperFindContactData']
00064 
00065   def __init__(self, *args, **kwds):
00066     """
00067     Constructor. Any message fields that are implicitly/explicitly
00068     set to None will be assigned a default value. The recommend
00069     use is keyword arguments as this is more robust to future message
00070     changes.  You cannot mix in-order arguments and keyword arguments.
00071 
00072     The available fields are:
00073        data
00074 
00075     :param args: complete set of field values, in .msg order
00076     :param kwds: use keyword arguments corresponding to message field names
00077     to set specific fields.
00078     """
00079     if args or kwds:
00080       super(PR2GripperFindContactFeedback, self).__init__(*args, **kwds)
00081       #message fields cannot be None, assign default values for those that are
00082       if self.data is None:
00083         self.data = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactData()
00084     else:
00085       self.data = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactData()
00086 
00087   def _get_types(self):
00088     """
00089     internal API method
00090     """
00091     return self._slot_types
00092 
00093   def serialize(self, buff):
00094     """
00095     serialize message into buffer
00096     :param buff: buffer, ``StringIO``
00097     """
00098     try:
00099       _x = self
00100       buff.write(_struct_2I3B4db.pack(_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.contact_conditions_met, _x.data.left_fingertip_pad_contact, _x.data.right_fingertip_pad_contact, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_position, _x.data.joint_effort, _x.data.rtstate.realtime_controller_state))
00101     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00102     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00103 
00104   def deserialize(self, str):
00105     """
00106     unpack serialized message in str into this message instance
00107     :param str: byte array of serialized message, ``str``
00108     """
00109     try:
00110       if self.data is None:
00111         self.data = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactData()
00112       end = 0
00113       _x = self
00114       start = end
00115       end += 44
00116       (_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.contact_conditions_met, _x.data.left_fingertip_pad_contact, _x.data.right_fingertip_pad_contact, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_position, _x.data.joint_effort, _x.data.rtstate.realtime_controller_state,) = _struct_2I3B4db.unpack(str[start:end])
00117       self.data.contact_conditions_met = bool(self.data.contact_conditions_met)
00118       self.data.left_fingertip_pad_contact = bool(self.data.left_fingertip_pad_contact)
00119       self.data.right_fingertip_pad_contact = bool(self.data.right_fingertip_pad_contact)
00120       return self
00121     except struct.error as e:
00122       raise genpy.DeserializationError(e) #most likely buffer underfill
00123 
00124 
00125   def serialize_numpy(self, buff, numpy):
00126     """
00127     serialize message with numpy array types into buffer
00128     :param buff: buffer, ``StringIO``
00129     :param numpy: numpy python module
00130     """
00131     try:
00132       _x = self
00133       buff.write(_struct_2I3B4db.pack(_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.contact_conditions_met, _x.data.left_fingertip_pad_contact, _x.data.right_fingertip_pad_contact, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_position, _x.data.joint_effort, _x.data.rtstate.realtime_controller_state))
00134     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00135     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00136 
00137   def deserialize_numpy(self, str, numpy):
00138     """
00139     unpack serialized message in str into this message instance using numpy for array types
00140     :param str: byte array of serialized message, ``str``
00141     :param numpy: numpy python module
00142     """
00143     try:
00144       if self.data is None:
00145         self.data = pr2_gripper_sensor_msgs.msg.PR2GripperFindContactData()
00146       end = 0
00147       _x = self
00148       start = end
00149       end += 44
00150       (_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.contact_conditions_met, _x.data.left_fingertip_pad_contact, _x.data.right_fingertip_pad_contact, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_position, _x.data.joint_effort, _x.data.rtstate.realtime_controller_state,) = _struct_2I3B4db.unpack(str[start:end])
00151       self.data.contact_conditions_met = bool(self.data.contact_conditions_met)
00152       self.data.left_fingertip_pad_contact = bool(self.data.left_fingertip_pad_contact)
00153       self.data.right_fingertip_pad_contact = bool(self.data.right_fingertip_pad_contact)
00154       return self
00155     except struct.error as e:
00156       raise genpy.DeserializationError(e) #most likely buffer underfill
00157 
00158 _struct_I = genpy.struct_I
00159 _struct_2I3B4db = struct.Struct("<2I3B4db")


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