_DeviceInfo.py
Go to the documentation of this file.
00001 """autogenerated by genpy from corobot_teleop/DeviceInfo.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 DeviceInfo(genpy.Message):
00009   _md5sum = "39b0e51aefc19552062fedb9c5674b52"
00010   _type = "corobot_teleop/DeviceInfo"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """bool Hokuyo_attached
00013 bool PTZcam_attached
00014 bool REARcam_attached
00015 bool SSC32board_attached
00016 bool frontBumper_attached
00017 bool backBumper_attached
00018 bool Encoder_left_attached
00019 bool Encoder_right_attached
00020 bool Voltage_attached
00021 bool IR_attached
00022 
00023 
00024 """
00025   __slots__ = ['Hokuyo_attached','PTZcam_attached','REARcam_attached','SSC32board_attached','frontBumper_attached','backBumper_attached','Encoder_left_attached','Encoder_right_attached','Voltage_attached','IR_attached']
00026   _slot_types = ['bool','bool','bool','bool','bool','bool','bool','bool','bool','bool']
00027 
00028   def __init__(self, *args, **kwds):
00029     """
00030     Constructor. Any message fields that are implicitly/explicitly
00031     set to None will be assigned a default value. The recommend
00032     use is keyword arguments as this is more robust to future message
00033     changes.  You cannot mix in-order arguments and keyword arguments.
00034 
00035     The available fields are:
00036        Hokuyo_attached,PTZcam_attached,REARcam_attached,SSC32board_attached,frontBumper_attached,backBumper_attached,Encoder_left_attached,Encoder_right_attached,Voltage_attached,IR_attached
00037 
00038     :param args: complete set of field values, in .msg order
00039     :param kwds: use keyword arguments corresponding to message field names
00040     to set specific fields.
00041     """
00042     if args or kwds:
00043       super(DeviceInfo, self).__init__(*args, **kwds)
00044       #message fields cannot be None, assign default values for those that are
00045       if self.Hokuyo_attached is None:
00046         self.Hokuyo_attached = False
00047       if self.PTZcam_attached is None:
00048         self.PTZcam_attached = False
00049       if self.REARcam_attached is None:
00050         self.REARcam_attached = False
00051       if self.SSC32board_attached is None:
00052         self.SSC32board_attached = False
00053       if self.frontBumper_attached is None:
00054         self.frontBumper_attached = False
00055       if self.backBumper_attached is None:
00056         self.backBumper_attached = False
00057       if self.Encoder_left_attached is None:
00058         self.Encoder_left_attached = False
00059       if self.Encoder_right_attached is None:
00060         self.Encoder_right_attached = False
00061       if self.Voltage_attached is None:
00062         self.Voltage_attached = False
00063       if self.IR_attached is None:
00064         self.IR_attached = False
00065     else:
00066       self.Hokuyo_attached = False
00067       self.PTZcam_attached = False
00068       self.REARcam_attached = False
00069       self.SSC32board_attached = False
00070       self.frontBumper_attached = False
00071       self.backBumper_attached = False
00072       self.Encoder_left_attached = False
00073       self.Encoder_right_attached = False
00074       self.Voltage_attached = False
00075       self.IR_attached = False
00076 
00077   def _get_types(self):
00078     """
00079     internal API method
00080     """
00081     return self._slot_types
00082 
00083   def serialize(self, buff):
00084     """
00085     serialize message into buffer
00086     :param buff: buffer, ``StringIO``
00087     """
00088     try:
00089       _x = self
00090       buff.write(_struct_10B.pack(_x.Hokuyo_attached, _x.PTZcam_attached, _x.REARcam_attached, _x.SSC32board_attached, _x.frontBumper_attached, _x.backBumper_attached, _x.Encoder_left_attached, _x.Encoder_right_attached, _x.Voltage_attached, _x.IR_attached))
00091     except struct.error as se: self._check_types(se)
00092     except TypeError as te: self._check_types(te)
00093 
00094   def deserialize(self, str):
00095     """
00096     unpack serialized message in str into this message instance
00097     :param str: byte array of serialized message, ``str``
00098     """
00099     try:
00100       end = 0
00101       _x = self
00102       start = end
00103       end += 10
00104       (_x.Hokuyo_attached, _x.PTZcam_attached, _x.REARcam_attached, _x.SSC32board_attached, _x.frontBumper_attached, _x.backBumper_attached, _x.Encoder_left_attached, _x.Encoder_right_attached, _x.Voltage_attached, _x.IR_attached,) = _struct_10B.unpack(str[start:end])
00105       self.Hokuyo_attached = bool(self.Hokuyo_attached)
00106       self.PTZcam_attached = bool(self.PTZcam_attached)
00107       self.REARcam_attached = bool(self.REARcam_attached)
00108       self.SSC32board_attached = bool(self.SSC32board_attached)
00109       self.frontBumper_attached = bool(self.frontBumper_attached)
00110       self.backBumper_attached = bool(self.backBumper_attached)
00111       self.Encoder_left_attached = bool(self.Encoder_left_attached)
00112       self.Encoder_right_attached = bool(self.Encoder_right_attached)
00113       self.Voltage_attached = bool(self.Voltage_attached)
00114       self.IR_attached = bool(self.IR_attached)
00115       return self
00116     except struct.error as e:
00117       raise genpy.DeserializationError(e) #most likely buffer underfill
00118 
00119 
00120   def serialize_numpy(self, buff, numpy):
00121     """
00122     serialize message with numpy array types into buffer
00123     :param buff: buffer, ``StringIO``
00124     :param numpy: numpy python module
00125     """
00126     try:
00127       _x = self
00128       buff.write(_struct_10B.pack(_x.Hokuyo_attached, _x.PTZcam_attached, _x.REARcam_attached, _x.SSC32board_attached, _x.frontBumper_attached, _x.backBumper_attached, _x.Encoder_left_attached, _x.Encoder_right_attached, _x.Voltage_attached, _x.IR_attached))
00129     except struct.error as se: self._check_types(se)
00130     except TypeError as te: self._check_types(te)
00131 
00132   def deserialize_numpy(self, str, numpy):
00133     """
00134     unpack serialized message in str into this message instance using numpy for array types
00135     :param str: byte array of serialized message, ``str``
00136     :param numpy: numpy python module
00137     """
00138     try:
00139       end = 0
00140       _x = self
00141       start = end
00142       end += 10
00143       (_x.Hokuyo_attached, _x.PTZcam_attached, _x.REARcam_attached, _x.SSC32board_attached, _x.frontBumper_attached, _x.backBumper_attached, _x.Encoder_left_attached, _x.Encoder_right_attached, _x.Voltage_attached, _x.IR_attached,) = _struct_10B.unpack(str[start:end])
00144       self.Hokuyo_attached = bool(self.Hokuyo_attached)
00145       self.PTZcam_attached = bool(self.PTZcam_attached)
00146       self.REARcam_attached = bool(self.REARcam_attached)
00147       self.SSC32board_attached = bool(self.SSC32board_attached)
00148       self.frontBumper_attached = bool(self.frontBumper_attached)
00149       self.backBumper_attached = bool(self.backBumper_attached)
00150       self.Encoder_left_attached = bool(self.Encoder_left_attached)
00151       self.Encoder_right_attached = bool(self.Encoder_right_attached)
00152       self.Voltage_attached = bool(self.Voltage_attached)
00153       self.IR_attached = bool(self.IR_attached)
00154       return self
00155     except struct.error as e:
00156       raise genpy.DeserializationError(e) #most likely buffer underfill
00157 
00158 _struct_I = genpy.struct_I
00159 _struct_10B = struct.Struct("<10B")


corobot_teleop
Author(s):
autogenerated on Sun Oct 5 2014 23:18:16