Go to the documentation of this file.00001
00002 import camera_setup_lib as csl
00003 import camera_config as cc
00004
00005
00006
00007 def camera_ids():
00008 uidIndexDict = {}
00009 numCameras = csl.init_bus1394()
00010 for i in range(numCameras):
00011 uidIndexDict[csl.getCameraUID(i)] = i
00012 csl.endCameraSetup()
00013 return uidIndexDict
00014
00015
00016
00017
00018 def camera_names():
00019 ids = camera_ids()
00020 all_ids = {}
00021
00022 for k in cc.camera_parameters.keys():
00023 all_ids[cc.camera_parameters[k]['uid']] = k
00024
00025 name_camera_map = {}
00026 for k in ids.keys():
00027 name_camera_map[all_ids[k]] = ids[k]
00028 return name_camera_map
00029
00030
00031
00032
00033 def lookup_by_name(camera_name):
00034 ids = camera_ids()
00035 print 'ids:', ids
00036 return ids[cc.camera_parameters[camera_name]['uid']]
00037
00038 if __name__ == '__main__':
00039 print 'Camera UUIDs', camera_ids()
00040 print 'Available cameras:', camera_names()