Example #1
0
 def load_all(self, flight_dir="", image_dir=""):
     self.flight_dir = flight_dir
     self.image_dir = image_dir
     data, flight_format = flight_loader.load(flight_dir)
     #data = flight_data.load('aura', flight_dir)
     self.interp = flight_interp.FlightInterpolate()
     self.interp.build(data)
     #self.load_gps()
     #self.load_filter()
     self.load_events()
     self.load_images()
    loader = 'sentera1'
    path = args.sentera_flight
elif args.sentera2_flight:
    loader = 'sentera2'
    path = args.sentera2_flight
elif args.umn_flight:
    loader = 'umn1'
    path = args.umn_flight
else:
    loader = None
    path = None
if 'recalibrate' in args:
    recal_file = args.recalibrate
else:
    recal_file = None
data = flight_loader.load(loader, path, recal_file)
print "imu records:", len(data['imu'])
print "gps records:", len(data['gps'])
if 'air' in data:
    print "airdata records:", len(data['air'])
print "filter records:", len(data['filter'])
if 'pilot' in data:
    print "pilot records:", len(data['pilot'])
if 'act' in data:
    print "act records:", len(data['act'])
if len(data['imu']) == 0 and len(data['gps']) == 0:
    print "not enough data loaded to continue."
    quit()

interp = flight_interp.FlightInterpolate()
interp.build(data)
Example #3
0
                    help='resample rate (hz)')
parser.add_argument('--xmin', type=float, help='start time')
parser.add_argument('--xmax', type=float, help='end time')
parser.add_argument('--plot', action='store_true', help='plot results.')
args = parser.parse_args()

g = 9.81
r2d = 180.0 / math.pi

if 'recalibrate' in args:
    recal_file = args.recalibrate
else:
    recal_file = None

# load the flight data
data, flight_format = flight_loader.load(args.flight, recal_file)
print("imu records:", len(data['imu']))
print("gps records:", len(data['gps']))
print("filter records:", len(data['gps']))
if len(data['imu']) == 0:
    print("not enough data loaded to continue.")
    quit()

# build the interpolation tables
interp = flight_interp.FlightInterpolate()
interp.build(data)

# read the events-0.csv file to determine when aircraft becomes airborne
# (so we can ignore preflight values.)  Update: also to read the IMU
# serial number.
xmin = None
Example #4
0
                    help='Directory containing the images')
parser.add_argument('--hz', default=100, type=int, help='sample rate')
parser.add_argument('--shift-time', type=float, help='manual time shift')
parser.add_argument('--no-plot',
                    dest='plot',
                    action='store_false',
                    help='do not show correlation plots')
parser.add_argument('--write',
                    action='store_true',
                    help='update geotags on source images')
parser.set_defaults(plot=True)
args = parser.parse_args()

# load flight data
print 'Loading flight data:', args.flight
data, flight_format = flight_loader.load(args.flight)
interp = flight_interp.FlightInterpolate()
interp.build(data)

# load camera triggers (from the events file)
triggers = []
airborne = False
ap = False
event_file = os.path.join(args.flight, "event-0.csv")
if os.path.exists(event_file):
    with open(event_file, 'rb') as fevent:
        reader = csv.DictReader(fevent)
        for row in reader:
            tokens = row['message'].split()
            if len(tokens) == 2 and tokens[0] == 'mission:' and tokens[
                    1] == 'airborne':
Example #5
0
        # while loop.
        k += 1

    # proper cleanup
    filter.close()
    run_end = time.time()
    elapsed_sec = run_end - run_start
    return data_dict, elapsed_sec


path = args.flight
if 'recalibrate' in args:
    recal_file = args.recalibrate
else:
    recal_file = None
data, flight_format = flight_loader.load(path, recal_file)

print "imu records:", len(data['imu'])
print "gps records:", len(data['gps'])
if 'air' in data:
    print "airdata records:", len(data['air'])
if 'filter' in data:
    print "filter records:", len(data['filter'])
if 'pilot' in data:
    print "pilot records:", len(data['pilot'])
if 'act' in data:
    print "act records:", len(data['act'])
if len(data['imu']) == 0 and len(data['gps']) == 0:
    print "not enough data loaded to continue."
    quit()