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


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