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