4 extract mavlink parameter values 6 from __future__
import print_function
11 from argparse
import ArgumentParser
12 parser = ArgumentParser(description=__doc__)
13 parser.add_argument(
"-c",
"--changes", dest=
"changesOnly", default=
False, action=
"store_true", help=
"Show only changes to parameters.")
14 parser.add_argument(
"logs", metavar=
"LOG", nargs=
"+")
16 args = parser.parse_args()
18 from pymavlink
import mavutil
23 '''extract mavlink parameters''' 24 mlog = mavutil.mavlink_connection(filename)
28 m = mlog.recv_match(type=[
'PARAM_VALUE',
'PARM'])
33 if m.get_type() ==
'PARAM_VALUE':
34 pname =
str(m.param_id).strip()
40 if args.changesOnly
is True and pname
in parms
and parms[pname] != value:
41 print(
"%s %-15s %.6f -> %.6f" % (time.asctime(time.localtime(m._timestamp)), pname, parms[pname], value))
46 for filename
in args.logs:
49 if (args.changesOnly
is False):
50 keys = list(parms.keys())
53 print(
"%-15s %.6f" % (p, parms[p]))