def Run(run_name, cars, the_arena, bair_car_data_location): D = {} D['Purpose'] = d2s(inspect.stack()[0][3], ':', 'Run object.') D['run_name'] = run_name D['cars'] = cars D['our_car_name'] = car_name_from_run_name(run_name) our_car_name = D['our_car_name'] D['our_car'] = cars[our_car_name] our_car = D['our_car'] D['the_arena'] = the_arena if len(gg(opjD(bair_car_data_location, 'meta', run_name, '*'))) < 5: print_stars() print("len(gg(opjD(bair_car_data_location,'meta',run_name,'*'))) < 5") print_stars() return False traj = our_car['runs'][run_name]['traj'] D['T0'] = traj['ts'][0] D['Tn'] = traj['ts'][-1] D['list_of_other_car_trajectories'] = our_car['runs'][run_name][ 'list_of_other_car_trajectories'] def _rewind(): for c in C['car_names']: D['cars'][c]['rewind']() D['rewind'] = _rewind car_spatial_dic, marker_spatial_dic = Spatial_Relations.setup_spatial_dics( D) D['car_spatial_dic'] = car_spatial_dic D['marker_spatial_dic'] = marker_spatial_dic D['rewind']() return D
def Run(run_name, cars, the_arena, bair_car_data_location): D = {} D['Purpose'] = d2s(inspect.stack()[0][3], ':', 'Run object.') D['run_name'] = run_name D['cars'] = cars D['our_car_name'] = car_name_from_run_name(run_name) our_car_name = D['our_car_name'] D['our_car'] = cars[our_car_name] our_car = D['our_car'] D['the_arena'] = the_arena if len( gg(opjD(bair_car_data_location, 'meta', run_name, '*')) ) < 5: #'caffe2_z2_color_direct_local_01Jan13_00h01m07s_Mr_Yellow' in run_name: print("len(gg(opjD(bair_car_data_location,'meta',run_name,'*'))) < 5") return False traj = our_car['runs'][run_name]['trajectory'] D['T0'] = traj['ts'][0] D['Tn'] = traj['ts'][-1] D['list_of_other_car_trajectories'] = our_car['runs'][run_name][ 'list_of_other_car_trajectories'] def _rewind(): for c in C['car_names']: D['cars'][c]['rewind']() D['rewind'] = _rewind try: our_car['load_image_and_meta_data'](run_name, bair_car_data_location) except Exception as e: print( "********** Exception *** cars[our_car]['load_image_and_meta_data'](run_name,bair_car_data_location) ********************" ) print(our_car_name, run_name) print(e.message, e.args) return False car_spatial_dic, marker_spatial_dic = Spatial_Relations.setup_spatial_dics( D) D['car_spatial_dic'] = car_spatial_dic D['marker_spatial_dic'] = marker_spatial_dic D['rewind']() return D