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