00001 """autogenerated by genmsg_py from Log.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import std_msgs.msg
00006
00007 class Log(roslib.message.Message):
00008 _md5sum = "acffd30cd6b6de30f120938c17c593fb"
00009 _type = "rosgraph_msgs/Log"
00010 _has_header = True
00011 _full_text = """##
00012 ## Severity level constants
00013 ##
00014 byte DEBUG=1 #debug level
00015 byte INFO=2 #general level
00016 byte WARN=4 #warning level
00017 byte ERROR=8 #error level
00018 byte FATAL=16 #fatal/critical level
00019 ##
00020 ## Fields
00021 ##
00022 Header header
00023 byte level
00024 string name # name of the node
00025 string msg # message
00026 string file # file the message came from
00027 string function # function the message came from
00028 uint32 line # line the message came from
00029 string[] topics # topic names that the node publishes
00030
00031 ================================================================================
00032 MSG: std_msgs/Header
00033 # Standard metadata for higher-level stamped data types.
00034 # This is generally used to communicate timestamped data
00035 # in a particular coordinate frame.
00036 #
00037 # sequence ID: consecutively increasing ID
00038 uint32 seq
00039 #Two-integer timestamp that is expressed as:
00040 # * stamp.secs: seconds (stamp_secs) since epoch
00041 # * stamp.nsecs: nanoseconds since stamp_secs
00042 # time-handling sugar is provided by the client library
00043 time stamp
00044 #Frame this data is associated with
00045 # 0: no frame
00046 # 1: global frame
00047 string frame_id
00048
00049 """
00050
00051 DEBUG = 1
00052 INFO = 2
00053 WARN = 4
00054 ERROR = 8
00055 FATAL = 16
00056
00057 __slots__ = ['header','level','name','msg','file','function','line','topics']
00058 _slot_types = ['Header','byte','string','string','string','string','uint32','string[]']
00059
00060 def __init__(self, *args, **kwds):
00061 """
00062 Constructor. Any message fields that are implicitly/explicitly
00063 set to None will be assigned a default value. The recommend
00064 use is keyword arguments as this is more robust to future message
00065 changes. You cannot mix in-order arguments and keyword arguments.
00066
00067 The available fields are:
00068 header,level,name,msg,file,function,line,topics
00069
00070 @param args: complete set of field values, in .msg order
00071 @param kwds: use keyword arguments corresponding to message field names
00072 to set specific fields.
00073 """
00074 if args or kwds:
00075 super(Log, self).__init__(*args, **kwds)
00076
00077 if self.header is None:
00078 self.header = std_msgs.msg._Header.Header()
00079 if self.level is None:
00080 self.level = 0
00081 if self.name is None:
00082 self.name = ''
00083 if self.msg is None:
00084 self.msg = ''
00085 if self.file is None:
00086 self.file = ''
00087 if self.function is None:
00088 self.function = ''
00089 if self.line is None:
00090 self.line = 0
00091 if self.topics is None:
00092 self.topics = []
00093 else:
00094 self.header = std_msgs.msg._Header.Header()
00095 self.level = 0
00096 self.name = ''
00097 self.msg = ''
00098 self.file = ''
00099 self.function = ''
00100 self.line = 0
00101 self.topics = []
00102
00103 def _get_types(self):
00104 """
00105 internal API method
00106 """
00107 return self._slot_types
00108
00109 def serialize(self, buff):
00110 """
00111 serialize message into buffer
00112 @param buff: buffer
00113 @type buff: StringIO
00114 """
00115 try:
00116 _x = self
00117 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00118 _x = self.header.frame_id
00119 length = len(_x)
00120 buff.write(struct.pack('<I%ss'%length, length, _x))
00121 buff.write(_struct_b.pack(self.level))
00122 _x = self.name
00123 length = len(_x)
00124 buff.write(struct.pack('<I%ss'%length, length, _x))
00125 _x = self.msg
00126 length = len(_x)
00127 buff.write(struct.pack('<I%ss'%length, length, _x))
00128 _x = self.file
00129 length = len(_x)
00130 buff.write(struct.pack('<I%ss'%length, length, _x))
00131 _x = self.function
00132 length = len(_x)
00133 buff.write(struct.pack('<I%ss'%length, length, _x))
00134 buff.write(_struct_I.pack(self.line))
00135 length = len(self.topics)
00136 buff.write(_struct_I.pack(length))
00137 for val1 in self.topics:
00138 length = len(val1)
00139 buff.write(struct.pack('<I%ss'%length, length, val1))
00140 except struct.error, se: self._check_types(se)
00141 except TypeError, te: self._check_types(te)
00142
00143 def deserialize(self, str):
00144 """
00145 unpack serialized message in str into this message instance
00146 @param str: byte array of serialized message
00147 @type str: str
00148 """
00149 try:
00150 if self.header is None:
00151 self.header = std_msgs.msg._Header.Header()
00152 end = 0
00153 _x = self
00154 start = end
00155 end += 12
00156 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00157 start = end
00158 end += 4
00159 (length,) = _struct_I.unpack(str[start:end])
00160 start = end
00161 end += length
00162 self.header.frame_id = str[start:end]
00163 start = end
00164 end += 1
00165 (self.level,) = _struct_b.unpack(str[start:end])
00166 start = end
00167 end += 4
00168 (length,) = _struct_I.unpack(str[start:end])
00169 start = end
00170 end += length
00171 self.name = str[start:end]
00172 start = end
00173 end += 4
00174 (length,) = _struct_I.unpack(str[start:end])
00175 start = end
00176 end += length
00177 self.msg = str[start:end]
00178 start = end
00179 end += 4
00180 (length,) = _struct_I.unpack(str[start:end])
00181 start = end
00182 end += length
00183 self.file = str[start:end]
00184 start = end
00185 end += 4
00186 (length,) = _struct_I.unpack(str[start:end])
00187 start = end
00188 end += length
00189 self.function = str[start:end]
00190 start = end
00191 end += 4
00192 (self.line,) = _struct_I.unpack(str[start:end])
00193 start = end
00194 end += 4
00195 (length,) = _struct_I.unpack(str[start:end])
00196 self.topics = []
00197 for i in xrange(0, length):
00198 start = end
00199 end += 4
00200 (length,) = _struct_I.unpack(str[start:end])
00201 start = end
00202 end += length
00203 val1 = str[start:end]
00204 self.topics.append(val1)
00205 return self
00206 except struct.error, e:
00207 raise roslib.message.DeserializationError(e)
00208
00209
00210 def serialize_numpy(self, buff, numpy):
00211 """
00212 serialize message with numpy array types into buffer
00213 @param buff: buffer
00214 @type buff: StringIO
00215 @param numpy: numpy python module
00216 @type numpy module
00217 """
00218 try:
00219 _x = self
00220 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00221 _x = self.header.frame_id
00222 length = len(_x)
00223 buff.write(struct.pack('<I%ss'%length, length, _x))
00224 buff.write(_struct_b.pack(self.level))
00225 _x = self.name
00226 length = len(_x)
00227 buff.write(struct.pack('<I%ss'%length, length, _x))
00228 _x = self.msg
00229 length = len(_x)
00230 buff.write(struct.pack('<I%ss'%length, length, _x))
00231 _x = self.file
00232 length = len(_x)
00233 buff.write(struct.pack('<I%ss'%length, length, _x))
00234 _x = self.function
00235 length = len(_x)
00236 buff.write(struct.pack('<I%ss'%length, length, _x))
00237 buff.write(_struct_I.pack(self.line))
00238 length = len(self.topics)
00239 buff.write(_struct_I.pack(length))
00240 for val1 in self.topics:
00241 length = len(val1)
00242 buff.write(struct.pack('<I%ss'%length, length, val1))
00243 except struct.error, se: self._check_types(se)
00244 except TypeError, te: self._check_types(te)
00245
00246 def deserialize_numpy(self, str, numpy):
00247 """
00248 unpack serialized message in str into this message instance using numpy for array types
00249 @param str: byte array of serialized message
00250 @type str: str
00251 @param numpy: numpy python module
00252 @type numpy: module
00253 """
00254 try:
00255 if self.header is None:
00256 self.header = std_msgs.msg._Header.Header()
00257 end = 0
00258 _x = self
00259 start = end
00260 end += 12
00261 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00262 start = end
00263 end += 4
00264 (length,) = _struct_I.unpack(str[start:end])
00265 start = end
00266 end += length
00267 self.header.frame_id = str[start:end]
00268 start = end
00269 end += 1
00270 (self.level,) = _struct_b.unpack(str[start:end])
00271 start = end
00272 end += 4
00273 (length,) = _struct_I.unpack(str[start:end])
00274 start = end
00275 end += length
00276 self.name = str[start:end]
00277 start = end
00278 end += 4
00279 (length,) = _struct_I.unpack(str[start:end])
00280 start = end
00281 end += length
00282 self.msg = str[start:end]
00283 start = end
00284 end += 4
00285 (length,) = _struct_I.unpack(str[start:end])
00286 start = end
00287 end += length
00288 self.file = str[start:end]
00289 start = end
00290 end += 4
00291 (length,) = _struct_I.unpack(str[start:end])
00292 start = end
00293 end += length
00294 self.function = str[start:end]
00295 start = end
00296 end += 4
00297 (self.line,) = _struct_I.unpack(str[start:end])
00298 start = end
00299 end += 4
00300 (length,) = _struct_I.unpack(str[start:end])
00301 self.topics = []
00302 for i in xrange(0, length):
00303 start = end
00304 end += 4
00305 (length,) = _struct_I.unpack(str[start:end])
00306 start = end
00307 end += length
00308 val1 = str[start:end]
00309 self.topics.append(val1)
00310 return self
00311 except struct.error, e:
00312 raise roslib.message.DeserializationError(e)
00313
00314 _struct_I = roslib.message.struct_I
00315 _struct_3I = struct.Struct("<3I")
00316 _struct_b = struct.Struct("<b")