4 search a set of log files for a condition 6 from __future__
import print_function
8 from pymavlink
import mavutil
10 from argparse
import ArgumentParser
11 parser = ArgumentParser(description=__doc__)
12 parser.add_argument(
"--condition", default=
None, help=
"conditional check on log")
13 parser.add_argument(
"--types", default=
None, help=
"message types to look for (comma separated)")
14 parser.add_argument(
"--stop", action=
'store_true', help=
"stop when message type found")
15 parser.add_argument(
"--stopcondition", action=
'store_true', help=
"stop when condition met")
16 parser.add_argument(
"logs", metavar=
"LOG", nargs=
"+")
18 args = parser.parse_args()
21 print(
"Loading %s ..." % filename)
22 mlog = mavutil.mavlink_connection(filename)
23 if args.types
is not None:
24 types = args.types.split(
',')
28 m = mlog.recv_match(type=types)
31 if mlog.check_condition(args.condition):
33 if args.stopcondition: