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


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