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