_PR2GripperSlipServoFeedback.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_gripper_sensor_msgs/PR2GripperSlipServoFeedback.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 PR2GripperSlipServoFeedback(genpy.Message):
00011   _md5sum = "1b10af616c7e94f609790b12cde04c6d"
00012   _type = "pr2_gripper_sensor_msgs/PR2GripperSlipServoFeedback"
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 
00016 #feedback
00017 PR2GripperSlipServoData data
00018 
00019 ================================================================================
00020 MSG: pr2_gripper_sensor_msgs/PR2GripperSlipServoData
00021 # time the data was recorded at
00022 time stamp
00023 
00024 # the amount of deformation from action start (in meters)
00025 float64 deformation
00026 
00027 # the force experinced by the finger Pads  (N)
00028 # NOTE:this ignores data from the edges of the finger pressure
00029 float64 left_fingertip_pad_force
00030 float64 right_fingertip_pad_force
00031 
00032 # the current virtual parallel joint effort of the gripper (in N)
00033 float64 joint_effort
00034 
00035 # true if the object recently slipped
00036 bool slip_detected
00037 
00038 # true if we are at or exceeding the deformation limit
00039 # (see wiki page and param server for more info)
00040 bool deformation_limit_reached
00041 
00042 # true if we are at or exceeding our force 
00043 # (see wiki page and param server for more info)
00044 bool fingertip_force_limit_reached
00045 
00046 # true if the controller thinks the gripper is empty
00047 # (see wiki page for more info)
00048 bool gripper_empty
00049 
00050 # the control state of our realtime controller
00051 PR2GripperSensorRTState rtstate
00052 ================================================================================
00053 MSG: pr2_gripper_sensor_msgs/PR2GripperSensorRTState
00054 # the control state of our realtime controller
00055 int8 realtime_controller_state
00056 
00057 # predefined values to indicate our realtime_controller_state
00058 int8 DISABLED = 0
00059 int8 POSITION_SERVO = 3
00060 int8 FORCE_SERVO = 4
00061 int8 FIND_CONTACT = 5
00062 int8 SLIP_SERVO = 6
00063 """
00064   __slots__ = ['data']
00065   _slot_types = ['pr2_gripper_sensor_msgs/PR2GripperSlipServoData']
00066 
00067   def __init__(self, *args, **kwds):
00068     """
00069     Constructor. Any message fields that are implicitly/explicitly
00070     set to None will be assigned a default value. The recommend
00071     use is keyword arguments as this is more robust to future message
00072     changes.  You cannot mix in-order arguments and keyword arguments.
00073 
00074     The available fields are:
00075        data
00076 
00077     :param args: complete set of field values, in .msg order
00078     :param kwds: use keyword arguments corresponding to message field names
00079     to set specific fields.
00080     """
00081     if args or kwds:
00082       super(PR2GripperSlipServoFeedback, self).__init__(*args, **kwds)
00083       #message fields cannot be None, assign default values for those that are
00084       if self.data is None:
00085         self.data = pr2_gripper_sensor_msgs.msg.PR2GripperSlipServoData()
00086     else:
00087       self.data = pr2_gripper_sensor_msgs.msg.PR2GripperSlipServoData()
00088 
00089   def _get_types(self):
00090     """
00091     internal API method
00092     """
00093     return self._slot_types
00094 
00095   def serialize(self, buff):
00096     """
00097     serialize message into buffer
00098     :param buff: buffer, ``StringIO``
00099     """
00100     try:
00101       _x = self
00102       buff.write(_struct_2I4d4Bb.pack(_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.deformation, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_effort, _x.data.slip_detected, _x.data.deformation_limit_reached, _x.data.fingertip_force_limit_reached, _x.data.gripper_empty, _x.data.rtstate.realtime_controller_state))
00103     except struct.error as se: self._check_types(se)
00104     except TypeError as te: self._check_types(te)
00105 
00106   def deserialize(self, str):
00107     """
00108     unpack serialized message in str into this message instance
00109     :param str: byte array of serialized message, ``str``
00110     """
00111     try:
00112       if self.data is None:
00113         self.data = pr2_gripper_sensor_msgs.msg.PR2GripperSlipServoData()
00114       end = 0
00115       _x = self
00116       start = end
00117       end += 45
00118       (_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.deformation, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_effort, _x.data.slip_detected, _x.data.deformation_limit_reached, _x.data.fingertip_force_limit_reached, _x.data.gripper_empty, _x.data.rtstate.realtime_controller_state,) = _struct_2I4d4Bb.unpack(str[start:end])
00119       self.data.slip_detected = bool(self.data.slip_detected)
00120       self.data.deformation_limit_reached = bool(self.data.deformation_limit_reached)
00121       self.data.fingertip_force_limit_reached = bool(self.data.fingertip_force_limit_reached)
00122       self.data.gripper_empty = bool(self.data.gripper_empty)
00123       return self
00124     except struct.error as e:
00125       raise genpy.DeserializationError(e) #most likely buffer underfill
00126 
00127 
00128   def serialize_numpy(self, buff, numpy):
00129     """
00130     serialize message with numpy array types into buffer
00131     :param buff: buffer, ``StringIO``
00132     :param numpy: numpy python module
00133     """
00134     try:
00135       _x = self
00136       buff.write(_struct_2I4d4Bb.pack(_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.deformation, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_effort, _x.data.slip_detected, _x.data.deformation_limit_reached, _x.data.fingertip_force_limit_reached, _x.data.gripper_empty, _x.data.rtstate.realtime_controller_state))
00137     except struct.error as se: self._check_types(se)
00138     except TypeError as te: self._check_types(te)
00139 
00140   def deserialize_numpy(self, str, numpy):
00141     """
00142     unpack serialized message in str into this message instance using numpy for array types
00143     :param str: byte array of serialized message, ``str``
00144     :param numpy: numpy python module
00145     """
00146     try:
00147       if self.data is None:
00148         self.data = pr2_gripper_sensor_msgs.msg.PR2GripperSlipServoData()
00149       end = 0
00150       _x = self
00151       start = end
00152       end += 45
00153       (_x.data.stamp.secs, _x.data.stamp.nsecs, _x.data.deformation, _x.data.left_fingertip_pad_force, _x.data.right_fingertip_pad_force, _x.data.joint_effort, _x.data.slip_detected, _x.data.deformation_limit_reached, _x.data.fingertip_force_limit_reached, _x.data.gripper_empty, _x.data.rtstate.realtime_controller_state,) = _struct_2I4d4Bb.unpack(str[start:end])
00154       self.data.slip_detected = bool(self.data.slip_detected)
00155       self.data.deformation_limit_reached = bool(self.data.deformation_limit_reached)
00156       self.data.fingertip_force_limit_reached = bool(self.data.fingertip_force_limit_reached)
00157       self.data.gripper_empty = bool(self.data.gripper_empty)
00158       return self
00159     except struct.error as e:
00160       raise genpy.DeserializationError(e) #most likely buffer underfill
00161 
00162 _struct_I = genpy.struct_I
00163 _struct_2I4d4Bb = struct.Struct("<2I4d4Bb")


pr2_gripper_sensor_msgs
Author(s): Joe Romano
autogenerated on Fri Jan 3 2014 11:52:59