00001 """autogenerated by genmsg_py from Pr2GripperCommandFeedback.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class Pr2GripperCommandFeedback(roslib.message.Message):
00007 _md5sum = "e4cbff56d3562bcf113da5a5adeef91f"
00008 _type = "pr2_controllers_msgs/Pr2GripperCommandFeedback"
00009 _has_header = False
00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00011 float64 position # The current gripper gap size (in meters)
00012 float64 effort # The current effort exerted (in Newtons)
00013 bool stalled # True iff the gripper is exerting max effort and not moving
00014 bool reached_goal # True iff the gripper position has reached the commanded setpoint
00015
00016
00017 """
00018 __slots__ = ['position','effort','stalled','reached_goal']
00019 _slot_types = ['float64','float64','bool','bool']
00020
00021 def __init__(self, *args, **kwds):
00022 """
00023 Constructor. Any message fields that are implicitly/explicitly
00024 set to None will be assigned a default value. The recommend
00025 use is keyword arguments as this is more robust to future message
00026 changes. You cannot mix in-order arguments and keyword arguments.
00027
00028 The available fields are:
00029 position,effort,stalled,reached_goal
00030
00031 @param args: complete set of field values, in .msg order
00032 @param kwds: use keyword arguments corresponding to message field names
00033 to set specific fields.
00034 """
00035 if args or kwds:
00036 super(Pr2GripperCommandFeedback, self).__init__(*args, **kwds)
00037
00038 if self.position is None:
00039 self.position = 0.
00040 if self.effort is None:
00041 self.effort = 0.
00042 if self.stalled is None:
00043 self.stalled = False
00044 if self.reached_goal is None:
00045 self.reached_goal = False
00046 else:
00047 self.position = 0.
00048 self.effort = 0.
00049 self.stalled = False
00050 self.reached_goal = False
00051
00052 def _get_types(self):
00053 """
00054 internal API method
00055 """
00056 return self._slot_types
00057
00058 def serialize(self, buff):
00059 """
00060 serialize message into buffer
00061 @param buff: buffer
00062 @type buff: StringIO
00063 """
00064 try:
00065 _x = self
00066 buff.write(_struct_2d2B.pack(_x.position, _x.effort, _x.stalled, _x.reached_goal))
00067 except struct.error, se: self._check_types(se)
00068 except TypeError, te: self._check_types(te)
00069
00070 def deserialize(self, str):
00071 """
00072 unpack serialized message in str into this message instance
00073 @param str: byte array of serialized message
00074 @type str: str
00075 """
00076 try:
00077 end = 0
00078 _x = self
00079 start = end
00080 end += 18
00081 (_x.position, _x.effort, _x.stalled, _x.reached_goal,) = _struct_2d2B.unpack(str[start:end])
00082 self.stalled = bool(self.stalled)
00083 self.reached_goal = bool(self.reached_goal)
00084 return self
00085 except struct.error, e:
00086 raise roslib.message.DeserializationError(e)
00087
00088
00089 def serialize_numpy(self, buff, numpy):
00090 """
00091 serialize message with numpy array types into buffer
00092 @param buff: buffer
00093 @type buff: StringIO
00094 @param numpy: numpy python module
00095 @type numpy module
00096 """
00097 try:
00098 _x = self
00099 buff.write(_struct_2d2B.pack(_x.position, _x.effort, _x.stalled, _x.reached_goal))
00100 except struct.error, se: self._check_types(se)
00101 except TypeError, te: self._check_types(te)
00102
00103 def deserialize_numpy(self, str, numpy):
00104 """
00105 unpack serialized message in str into this message instance using numpy for array types
00106 @param str: byte array of serialized message
00107 @type str: str
00108 @param numpy: numpy python module
00109 @type numpy: module
00110 """
00111 try:
00112 end = 0
00113 _x = self
00114 start = end
00115 end += 18
00116 (_x.position, _x.effort, _x.stalled, _x.reached_goal,) = _struct_2d2B.unpack(str[start:end])
00117 self.stalled = bool(self.stalled)
00118 self.reached_goal = bool(self.reached_goal)
00119 return self
00120 except struct.error, e:
00121 raise roslib.message.DeserializationError(e)
00122
00123 _struct_I = roslib.message.struct_I
00124 _struct_2d2B = struct.Struct("<2d2B")