_PanTilt.py
Go to the documentation of this file.
00001 """autogenerated by genpy from corobot_teleop/PanTilt.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 PanTilt(genpy.Message):
00009   _md5sum = "0b5a18079de4fe44248582bbf0247b62"
00010   _type = "corobot_teleop/PanTilt"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """int32 pan
00013 int32 tilt
00014 bool reset
00015 
00016 """
00017   __slots__ = ['pan','tilt','reset']
00018   _slot_types = ['int32','int32','bool']
00019 
00020   def __init__(self, *args, **kwds):
00021     """
00022     Constructor. Any message fields that are implicitly/explicitly
00023     set to None will be assigned a default value. The recommend
00024     use is keyword arguments as this is more robust to future message
00025     changes.  You cannot mix in-order arguments and keyword arguments.
00026 
00027     The available fields are:
00028        pan,tilt,reset
00029 
00030     :param args: complete set of field values, in .msg order
00031     :param kwds: use keyword arguments corresponding to message field names
00032     to set specific fields.
00033     """
00034     if args or kwds:
00035       super(PanTilt, self).__init__(*args, **kwds)
00036       #message fields cannot be None, assign default values for those that are
00037       if self.pan is None:
00038         self.pan = 0
00039       if self.tilt is None:
00040         self.tilt = 0
00041       if self.reset is None:
00042         self.reset = False
00043     else:
00044       self.pan = 0
00045       self.tilt = 0
00046       self.reset = False
00047 
00048   def _get_types(self):
00049     """
00050     internal API method
00051     """
00052     return self._slot_types
00053 
00054   def serialize(self, buff):
00055     """
00056     serialize message into buffer
00057     :param buff: buffer, ``StringIO``
00058     """
00059     try:
00060       _x = self
00061       buff.write(_struct_2iB.pack(_x.pan, _x.tilt, _x.reset))
00062     except struct.error as se: self._check_types(se)
00063     except TypeError as te: self._check_types(te)
00064 
00065   def deserialize(self, str):
00066     """
00067     unpack serialized message in str into this message instance
00068     :param str: byte array of serialized message, ``str``
00069     """
00070     try:
00071       end = 0
00072       _x = self
00073       start = end
00074       end += 9
00075       (_x.pan, _x.tilt, _x.reset,) = _struct_2iB.unpack(str[start:end])
00076       self.reset = bool(self.reset)
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_2iB.pack(_x.pan, _x.tilt, _x.reset))
00091     except struct.error as se: self._check_types(se)
00092     except TypeError as te: self._check_types(te)
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       end = 0
00102       _x = self
00103       start = end
00104       end += 9
00105       (_x.pan, _x.tilt, _x.reset,) = _struct_2iB.unpack(str[start:end])
00106       self.reset = bool(self.reset)
00107       return self
00108     except struct.error as e:
00109       raise genpy.DeserializationError(e) #most likely buffer underfill
00110 
00111 _struct_I = genpy.struct_I
00112 _struct_2iB = struct.Struct("<2iB")


corobot_teleop
Author(s):
autogenerated on Wed Aug 26 2015 11:09:59