00001 """autogenerated by genmsg_py from Pr2GripperCommandGoal.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import pr2_controllers_msgs.msg
00006
00007 class Pr2GripperCommandGoal(roslib.message.Message):
00008 _md5sum = "86fd82f4ddc48a4cb6856cfa69217e43"
00009 _type = "pr2_controllers_msgs/Pr2GripperCommandGoal"
00010 _has_header = False
00011 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00012 pr2_controllers_msgs/Pr2GripperCommand command
00013
00014 ================================================================================
00015 MSG: pr2_controllers_msgs/Pr2GripperCommand
00016 float64 position
00017 float64 max_effort
00018
00019 """
00020 __slots__ = ['command']
00021 _slot_types = ['pr2_controllers_msgs/Pr2GripperCommand']
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 command
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(Pr2GripperCommandGoal, self).__init__(*args, **kwds)
00039
00040 if self.command is None:
00041 self.command = pr2_controllers_msgs.msg.Pr2GripperCommand()
00042 else:
00043 self.command = pr2_controllers_msgs.msg.Pr2GripperCommand()
00044
00045 def _get_types(self):
00046 """
00047 internal API method
00048 """
00049 return self._slot_types
00050
00051 def serialize(self, buff):
00052 """
00053 serialize message into buffer
00054 @param buff: buffer
00055 @type buff: StringIO
00056 """
00057 try:
00058 _x = self
00059 buff.write(_struct_2d.pack(_x.command.position, _x.command.max_effort))
00060 except struct.error, se: self._check_types(se)
00061 except TypeError, te: self._check_types(te)
00062
00063 def deserialize(self, str):
00064 """
00065 unpack serialized message in str into this message instance
00066 @param str: byte array of serialized message
00067 @type str: str
00068 """
00069 try:
00070 if self.command is None:
00071 self.command = pr2_controllers_msgs.msg.Pr2GripperCommand()
00072 end = 0
00073 _x = self
00074 start = end
00075 end += 16
00076 (_x.command.position, _x.command.max_effort,) = _struct_2d.unpack(str[start:end])
00077 return self
00078 except struct.error, e:
00079 raise roslib.message.DeserializationError(e)
00080
00081
00082 def serialize_numpy(self, buff, numpy):
00083 """
00084 serialize message with numpy array types into buffer
00085 @param buff: buffer
00086 @type buff: StringIO
00087 @param numpy: numpy python module
00088 @type numpy module
00089 """
00090 try:
00091 _x = self
00092 buff.write(_struct_2d.pack(_x.command.position, _x.command.max_effort))
00093 except struct.error, se: self._check_types(se)
00094 except TypeError, te: self._check_types(te)
00095
00096 def deserialize_numpy(self, str, numpy):
00097 """
00098 unpack serialized message in str into this message instance using numpy for array types
00099 @param str: byte array of serialized message
00100 @type str: str
00101 @param numpy: numpy python module
00102 @type numpy: module
00103 """
00104 try:
00105 if self.command is None:
00106 self.command = pr2_controllers_msgs.msg.Pr2GripperCommand()
00107 end = 0
00108 _x = self
00109 start = end
00110 end += 16
00111 (_x.command.position, _x.command.max_effort,) = _struct_2d.unpack(str[start:end])
00112 return self
00113 except struct.error, e:
00114 raise roslib.message.DeserializationError(e)
00115
00116 _struct_I = roslib.message.struct_I
00117 _struct_2d = struct.Struct("<2d")