39 PKG =
'diagnostic_analysis' 40 import roslib; roslib.load_manifest(PKG)
41 import diagnostic_msgs.msg
43 import operator, tempfile, subprocess
45 from optparse
import OptionParser
49 if __name__ ==
'__main__':
51 parser = OptionParser()
52 parser.add_option(
"-d",
"--directory", dest=
"directory",
53 help=
"Write output to DIR/output. Default: %s" % PKG, metavar=
"DIR",
54 default=roslib.packages.get_pkg_dir(PKG), action=
"store")
55 options, args = parser.parse_args()
59 print 'Output directory: %s/output' % options.directory
62 for i, f
in enumerate(args):
63 filepath =
'output/%s_csv' % os.path.basename(f)[0:os.path.basename(f).find(
'.')]
65 output_dir = os.path.join(options.directory, filepath)
66 print "Processing file %s. File %d of %d." % (os.path.basename(f), i + 1, len(args))
73 print 'Finished processing files.' 76 print "Caught exception processing log file"
Converts and processes diagnostics logs to CSV format.