4 show accel calibration for a set of logs 6 from __future__
import print_function
8 from argparse
import ArgumentParser
9 parser = ArgumentParser()
10 parser.add_argument(
"--no-timestamps", dest=
"notimestamps", action=
'store_true', help=
"Log doesn't have timestamps")
11 parser.add_argument(
"--planner", action=
'store_true', help=
"use planner file format")
12 parser.add_argument(
"--robust", action=
'store_true', help=
"Enable robust parsing (skip over bad data)")
13 parser.add_argument(
"logs", metavar=
"LOG", nargs=
"+")
15 args = parser.parse_args()
17 from pymavlink
import mavutil
21 '''display accel cal for a log file''' 22 mlog = mavutil.mavlink_connection(filename,
23 planner_format=args.planner,
24 notimestamps=args.notimestamps,
25 robust_parsing=args.robust)
27 m = mlog.recv_match(type=
'SENSOR_OFFSETS')
29 z_sensor = (m.accel_cal_z - 9.805) * (4096/9.81)
30 print(
"accel cal %5.2f %5.2f %5.2f %6u %s" % (
31 m.accel_cal_x, m.accel_cal_y, m.accel_cal_z,
37 for filename
in args.logs: