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