00001 """autogenerated by genmsg_py from ClearpathRobot.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class ClearpathRobot(roslib.message.Message):
00007 _md5sum = "1bdab2b789676c1b350ab6739da650c7"
00008 _type = "clearpath_base/ClearpathRobot"
00009 _has_header = False
00010 _full_text = """string name
00011 string model
00012 int32 platform_revision
00013 uint32 serial
00014 int32[2] horizon_version
00015 int32[2] firmware_version
00016 int32 firmware_revision
00017 string write_date
00018
00019 """
00020 __slots__ = ['name','model','platform_revision','serial','horizon_version','firmware_version','firmware_revision','write_date']
00021 _slot_types = ['string','string','int32','uint32','int32[2]','int32[2]','int32','string']
00022
00023 def __init__(self, *args, **kwds):
00024 """
00025 Constructor. Any message fields that are implicitly/explicitly
00026 set to None will be assigned a default value. The recommend
00027 use is keyword arguments as this is more robust to future message
00028 changes. You cannot mix in-order arguments and keyword arguments.
00029
00030 The available fields are:
00031 name,model,platform_revision,serial,horizon_version,firmware_version,firmware_revision,write_date
00032
00033 @param args: complete set of field values, in .msg order
00034 @param kwds: use keyword arguments corresponding to message field names
00035 to set specific fields.
00036 """
00037 if args or kwds:
00038 super(ClearpathRobot, self).__init__(*args, **kwds)
00039
00040 if self.name is None:
00041 self.name = ''
00042 if self.model is None:
00043 self.model = ''
00044 if self.platform_revision is None:
00045 self.platform_revision = 0
00046 if self.serial is None:
00047 self.serial = 0
00048 if self.horizon_version is None:
00049 self.horizon_version = [0,0]
00050 if self.firmware_version is None:
00051 self.firmware_version = [0,0]
00052 if self.firmware_revision is None:
00053 self.firmware_revision = 0
00054 if self.write_date is None:
00055 self.write_date = ''
00056 else:
00057 self.name = ''
00058 self.model = ''
00059 self.platform_revision = 0
00060 self.serial = 0
00061 self.horizon_version = [0,0]
00062 self.firmware_version = [0,0]
00063 self.firmware_revision = 0
00064 self.write_date = ''
00065
00066 def _get_types(self):
00067 """
00068 internal API method
00069 """
00070 return self._slot_types
00071
00072 def serialize(self, buff):
00073 """
00074 serialize message into buffer
00075 @param buff: buffer
00076 @type buff: StringIO
00077 """
00078 try:
00079 _x = self.name
00080 length = len(_x)
00081 buff.write(struct.pack('<I%ss'%length, length, _x))
00082 _x = self.model
00083 length = len(_x)
00084 buff.write(struct.pack('<I%ss'%length, length, _x))
00085 _x = self
00086 buff.write(_struct_iI.pack(_x.platform_revision, _x.serial))
00087 buff.write(_struct_2i.pack(*self.horizon_version))
00088 buff.write(_struct_2i.pack(*self.firmware_version))
00089 buff.write(_struct_i.pack(self.firmware_revision))
00090 _x = self.write_date
00091 length = len(_x)
00092 buff.write(struct.pack('<I%ss'%length, length, _x))
00093 except struct.error, se: self._check_types(se)
00094 except TypeError, te: self._check_types(te)
00095
00096 def deserialize(self, str):
00097 """
00098 unpack serialized message in str into this message instance
00099 @param str: byte array of serialized message
00100 @type str: str
00101 """
00102 try:
00103 end = 0
00104 start = end
00105 end += 4
00106 (length,) = _struct_I.unpack(str[start:end])
00107 start = end
00108 end += length
00109 self.name = str[start:end]
00110 start = end
00111 end += 4
00112 (length,) = _struct_I.unpack(str[start:end])
00113 start = end
00114 end += length
00115 self.model = str[start:end]
00116 _x = self
00117 start = end
00118 end += 8
00119 (_x.platform_revision, _x.serial,) = _struct_iI.unpack(str[start:end])
00120 start = end
00121 end += 8
00122 self.horizon_version = _struct_2i.unpack(str[start:end])
00123 start = end
00124 end += 8
00125 self.firmware_version = _struct_2i.unpack(str[start:end])
00126 start = end
00127 end += 4
00128 (self.firmware_revision,) = _struct_i.unpack(str[start:end])
00129 start = end
00130 end += 4
00131 (length,) = _struct_I.unpack(str[start:end])
00132 start = end
00133 end += length
00134 self.write_date = str[start:end]
00135 return self
00136 except struct.error, e:
00137 raise roslib.message.DeserializationError(e)
00138
00139
00140 def serialize_numpy(self, buff, numpy):
00141 """
00142 serialize message with numpy array types into buffer
00143 @param buff: buffer
00144 @type buff: StringIO
00145 @param numpy: numpy python module
00146 @type numpy module
00147 """
00148 try:
00149 _x = self.name
00150 length = len(_x)
00151 buff.write(struct.pack('<I%ss'%length, length, _x))
00152 _x = self.model
00153 length = len(_x)
00154 buff.write(struct.pack('<I%ss'%length, length, _x))
00155 _x = self
00156 buff.write(_struct_iI.pack(_x.platform_revision, _x.serial))
00157 buff.write(self.horizon_version.tostring())
00158 buff.write(self.firmware_version.tostring())
00159 buff.write(_struct_i.pack(self.firmware_revision))
00160 _x = self.write_date
00161 length = len(_x)
00162 buff.write(struct.pack('<I%ss'%length, length, _x))
00163 except struct.error, se: self._check_types(se)
00164 except TypeError, te: self._check_types(te)
00165
00166 def deserialize_numpy(self, str, numpy):
00167 """
00168 unpack serialized message in str into this message instance using numpy for array types
00169 @param str: byte array of serialized message
00170 @type str: str
00171 @param numpy: numpy python module
00172 @type numpy: module
00173 """
00174 try:
00175 end = 0
00176 start = end
00177 end += 4
00178 (length,) = _struct_I.unpack(str[start:end])
00179 start = end
00180 end += length
00181 self.name = str[start:end]
00182 start = end
00183 end += 4
00184 (length,) = _struct_I.unpack(str[start:end])
00185 start = end
00186 end += length
00187 self.model = str[start:end]
00188 _x = self
00189 start = end
00190 end += 8
00191 (_x.platform_revision, _x.serial,) = _struct_iI.unpack(str[start:end])
00192 start = end
00193 end += 8
00194 self.horizon_version = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=2)
00195 start = end
00196 end += 8
00197 self.firmware_version = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=2)
00198 start = end
00199 end += 4
00200 (self.firmware_revision,) = _struct_i.unpack(str[start:end])
00201 start = end
00202 end += 4
00203 (length,) = _struct_I.unpack(str[start:end])
00204 start = end
00205 end += length
00206 self.write_date = str[start:end]
00207 return self
00208 except struct.error, e:
00209 raise roslib.message.DeserializationError(e)
00210
00211 _struct_I = roslib.message.struct_I
00212 _struct_iI = struct.Struct("<iI")
00213 _struct_i = struct.Struct("<i")
00214 _struct_2i = struct.Struct("<2i")