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