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


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