_Pr2GripperCommandGoal.py
Go to the documentation of this file.
00001 """autogenerated by genpy from pr2_controllers_msgs/Pr2GripperCommandGoal.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 pr2_controllers_msgs.msg
00008 
00009 class Pr2GripperCommandGoal(genpy.Message):
00010   _md5sum = "86fd82f4ddc48a4cb6856cfa69217e43"
00011   _type = "pr2_controllers_msgs/Pr2GripperCommandGoal"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00014 pr2_controllers_msgs/Pr2GripperCommand command
00015 
00016 ================================================================================
00017 MSG: pr2_controllers_msgs/Pr2GripperCommand
00018 float64 position
00019 float64 max_effort
00020 
00021 """
00022   __slots__ = ['command']
00023   _slot_types = ['pr2_controllers_msgs/Pr2GripperCommand']
00024 
00025   def __init__(self, *args, **kwds):
00026     """
00027     Constructor. Any message fields that are implicitly/explicitly
00028     set to None will be assigned a default value. The recommend
00029     use is keyword arguments as this is more robust to future message
00030     changes.  You cannot mix in-order arguments and keyword arguments.
00031 
00032     The available fields are:
00033        command
00034 
00035     :param args: complete set of field values, in .msg order
00036     :param kwds: use keyword arguments corresponding to message field names
00037     to set specific fields.
00038     """
00039     if args or kwds:
00040       super(Pr2GripperCommandGoal, self).__init__(*args, **kwds)
00041       #message fields cannot be None, assign default values for those that are
00042       if self.command is None:
00043         self.command = pr2_controllers_msgs.msg.Pr2GripperCommand()
00044     else:
00045       self.command = pr2_controllers_msgs.msg.Pr2GripperCommand()
00046 
00047   def _get_types(self):
00048     """
00049     internal API method
00050     """
00051     return self._slot_types
00052 
00053   def serialize(self, buff):
00054     """
00055     serialize message into buffer
00056     :param buff: buffer, ``StringIO``
00057     """
00058     try:
00059       _x = self
00060       buff.write(_struct_2d.pack(_x.command.position, _x.command.max_effort))
00061     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00062     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00063 
00064   def deserialize(self, str):
00065     """
00066     unpack serialized message in str into this message instance
00067     :param str: byte array of serialized message, ``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 as e:
00079       raise genpy.DeserializationError(e) #most likely buffer underfill
00080 
00081 
00082   def serialize_numpy(self, buff, numpy):
00083     """
00084     serialize message with numpy array types into buffer
00085     :param buff: buffer, ``StringIO``
00086     :param numpy: numpy python module
00087     """
00088     try:
00089       _x = self
00090       buff.write(_struct_2d.pack(_x.command.position, _x.command.max_effort))
00091     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00092     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00093 
00094   def deserialize_numpy(self, str, numpy):
00095     """
00096     unpack serialized message in str into this message instance using numpy for array types
00097     :param str: byte array of serialized message, ``str``
00098     :param numpy: numpy python module
00099     """
00100     try:
00101       if self.command is None:
00102         self.command = pr2_controllers_msgs.msg.Pr2GripperCommand()
00103       end = 0
00104       _x = self
00105       start = end
00106       end += 16
00107       (_x.command.position, _x.command.max_effort,) = _struct_2d.unpack(str[start:end])
00108       return self
00109     except struct.error as e:
00110       raise genpy.DeserializationError(e) #most likely buffer underfill
00111 
00112 _struct_I = genpy.struct_I
00113 _struct_2d = struct.Struct("<2d")


pr2_controllers_msgs
Author(s): Stuart Glaser
autogenerated on Thu Apr 24 2014 15:44:12