00001 """autogenerated by genpy from iri_common_drivers_msgs/leuze_status.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 std_msgs.msg
00008
00009 class leuze_status(genpy.Message):
00010 _md5sum = "ecaafc9afd030f4a97142645a5dcf81b"
00011 _type = "iri_common_drivers_msgs/leuze_status"
00012 _has_header = True
00013 _full_text = """Header header
00014 uint8 alarm1
00015 uint8 alarm2
00016 uint8 ossd1
00017 uint8 ossd2
00018 uint8 current_pair
00019
00020 ================================================================================
00021 MSG: std_msgs/Header
00022 # Standard metadata for higher-level stamped data types.
00023 # This is generally used to communicate timestamped data
00024 # in a particular coordinate frame.
00025 #
00026 # sequence ID: consecutively increasing ID
00027 uint32 seq
00028 #Two-integer timestamp that is expressed as:
00029 # * stamp.secs: seconds (stamp_secs) since epoch
00030 # * stamp.nsecs: nanoseconds since stamp_secs
00031 # time-handling sugar is provided by the client library
00032 time stamp
00033 #Frame this data is associated with
00034 # 0: no frame
00035 # 1: global frame
00036 string frame_id
00037
00038 """
00039 __slots__ = ['header','alarm1','alarm2','ossd1','ossd2','current_pair']
00040 _slot_types = ['std_msgs/Header','uint8','uint8','uint8','uint8','uint8']
00041
00042 def __init__(self, *args, **kwds):
00043 """
00044 Constructor. Any message fields that are implicitly/explicitly
00045 set to None will be assigned a default value. The recommend
00046 use is keyword arguments as this is more robust to future message
00047 changes. You cannot mix in-order arguments and keyword arguments.
00048
00049 The available fields are:
00050 header,alarm1,alarm2,ossd1,ossd2,current_pair
00051
00052 :param args: complete set of field values, in .msg order
00053 :param kwds: use keyword arguments corresponding to message field names
00054 to set specific fields.
00055 """
00056 if args or kwds:
00057 super(leuze_status, self).__init__(*args, **kwds)
00058
00059 if self.header is None:
00060 self.header = std_msgs.msg.Header()
00061 if self.alarm1 is None:
00062 self.alarm1 = 0
00063 if self.alarm2 is None:
00064 self.alarm2 = 0
00065 if self.ossd1 is None:
00066 self.ossd1 = 0
00067 if self.ossd2 is None:
00068 self.ossd2 = 0
00069 if self.current_pair is None:
00070 self.current_pair = 0
00071 else:
00072 self.header = std_msgs.msg.Header()
00073 self.alarm1 = 0
00074 self.alarm2 = 0
00075 self.ossd1 = 0
00076 self.ossd2 = 0
00077 self.current_pair = 0
00078
00079 def _get_types(self):
00080 """
00081 internal API method
00082 """
00083 return self._slot_types
00084
00085 def serialize(self, buff):
00086 """
00087 serialize message into buffer
00088 :param buff: buffer, ``StringIO``
00089 """
00090 try:
00091 _x = self
00092 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00093 _x = self.header.frame_id
00094 length = len(_x)
00095 if python3 or type(_x) == unicode:
00096 _x = _x.encode('utf-8')
00097 length = len(_x)
00098 buff.write(struct.pack('<I%ss'%length, length, _x))
00099 _x = self
00100 buff.write(_struct_5B.pack(_x.alarm1, _x.alarm2, _x.ossd1, _x.ossd2, _x.current_pair))
00101 except struct.error as se: self._check_types(se)
00102 except TypeError as te: self._check_types(te)
00103
00104 def deserialize(self, str):
00105 """
00106 unpack serialized message in str into this message instance
00107 :param str: byte array of serialized message, ``str``
00108 """
00109 try:
00110 if self.header is None:
00111 self.header = std_msgs.msg.Header()
00112 end = 0
00113 _x = self
00114 start = end
00115 end += 12
00116 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00117 start = end
00118 end += 4
00119 (length,) = _struct_I.unpack(str[start:end])
00120 start = end
00121 end += length
00122 if python3:
00123 self.header.frame_id = str[start:end].decode('utf-8')
00124 else:
00125 self.header.frame_id = str[start:end]
00126 _x = self
00127 start = end
00128 end += 5
00129 (_x.alarm1, _x.alarm2, _x.ossd1, _x.ossd2, _x.current_pair,) = _struct_5B.unpack(str[start:end])
00130 return self
00131 except struct.error as e:
00132 raise genpy.DeserializationError(e)
00133
00134
00135 def serialize_numpy(self, buff, numpy):
00136 """
00137 serialize message with numpy array types into buffer
00138 :param buff: buffer, ``StringIO``
00139 :param numpy: numpy python module
00140 """
00141 try:
00142 _x = self
00143 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00144 _x = self.header.frame_id
00145 length = len(_x)
00146 if python3 or type(_x) == unicode:
00147 _x = _x.encode('utf-8')
00148 length = len(_x)
00149 buff.write(struct.pack('<I%ss'%length, length, _x))
00150 _x = self
00151 buff.write(_struct_5B.pack(_x.alarm1, _x.alarm2, _x.ossd1, _x.ossd2, _x.current_pair))
00152 except struct.error as se: self._check_types(se)
00153 except TypeError as te: self._check_types(te)
00154
00155 def deserialize_numpy(self, str, numpy):
00156 """
00157 unpack serialized message in str into this message instance using numpy for array types
00158 :param str: byte array of serialized message, ``str``
00159 :param numpy: numpy python module
00160 """
00161 try:
00162 if self.header is None:
00163 self.header = std_msgs.msg.Header()
00164 end = 0
00165 _x = self
00166 start = end
00167 end += 12
00168 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00169 start = end
00170 end += 4
00171 (length,) = _struct_I.unpack(str[start:end])
00172 start = end
00173 end += length
00174 if python3:
00175 self.header.frame_id = str[start:end].decode('utf-8')
00176 else:
00177 self.header.frame_id = str[start:end]
00178 _x = self
00179 start = end
00180 end += 5
00181 (_x.alarm1, _x.alarm2, _x.ossd1, _x.ossd2, _x.current_pair,) = _struct_5B.unpack(str[start:end])
00182 return self
00183 except struct.error as e:
00184 raise genpy.DeserializationError(e)
00185
00186 _struct_I = genpy.struct_I
00187 _struct_3I = struct.Struct("<3I")
00188 _struct_5B = struct.Struct("<5B")