Exemple #1
0
    def __init__(self):
        #create sub driectory for logs and videos
        self.location = VN_config.get_string('logging', 'location',
                                             '../../visnav/')

        path = self.location + 'logs'
        if not os.path.exists(path):
            os.makedirs(path)
        path = self.location + 'vids'
        if not os.path.exists(path):
            os.makedirs(path)

        #set default startegy name
        self.strat_name = 'Smart_Camera'

        # get image resolution
        self.img_width = VN_config.get_integer('camera', 'width', 640)
        self.img_height = VN_config.get_integer('camera', 'height', 480)

        #####TEXT LOGGING######
        #levels = 'debug' , 'general' , 'aircraft' , 'algorithm' , ' performance'
        #multiple message levels can be selected by concatination strings i.e. 'debug, aircraft'
        #what type of messages we print to the terminal
        self.print_level = VN_config.get_string('logging', 'print_level',
                                                'debug, general')
        #what type of messages we log to a file
        self.log_level = VN_config.get_string('logging', 'log_level',
                                              'aircraft , algorithm, general')

        #####VIDEO RECORDING######
        #levels = 'frame' , 'gui'
        #multiple message levels can be selected at once by concatination strings i.e. 'frame, gui'
        #what type of images we display on the screen
        self.display_level = VN_config.get_string('logging', 'display_level',
                                                  'raw, gui')
        #what type of images we record
        self.record_level = VN_config.get_string('logging', 'record_level',
                                                 'raw')

        #Note about useful logging practices:
        #Inorder to replay a flight through the program log_level must include 'aircraft' and 'algorithm'
        #record level must include 'frame'
        #all other logging levels are for user diagnostics

        #a list of video writers and their tag
        self.video_writers = []

        #text logger
        self.logger = None
Exemple #2
0
    def __init__(self):

        # load config file
        VN_config.get_file("Smart_Camera")

        # get camera specs
        self.camera_index = VN_config.get_integer("camera", "camera_index", 0)
        self.camera_width = VN_config.get_integer("camera", "camera_width", 640)
        self.camera_height = VN_config.get_integer("camera", "camera_height", 480)
        self.camera_hfov = VN_config.get_float("camera", "horizontal-fov", 72.42)
        self.camera_vfov = VN_config.get_float("camera", "vertical-fov", 43.3)

        # simulator
        self.simulator = VN_config.get_boolean("simulator", "use_simulator", True)
        self.target_file = VN_config.get_string(
            "simulator", "target_location", os.environ["HOME"] + "/visnav/target.jpg"
        )
        self.target_size = VN_config.get_float("algorithm", "outer_ring", 1.0)

        # Run the program no matter what mode or location; Useful for debug purposes
        self.always_run = VN_config.get_boolean("general", "always_run", True)

        # how many frames have been captured
        self.frames_captured = 0

        # debugging:
        self.kill_camera = False
Exemple #3
0
    def __init__(self):

        #load config file
        VN_config.get_file('Smart_Camera')

        #get camera specs
        self.camera_index = VN_config.get_integer('camera', 'camera_index', 0)
        self.camera_width = VN_config.get_integer('camera', 'camera_width',
                                                  640)
        self.camera_height = VN_config.get_integer('camera', 'camera_height',
                                                   480)
        self.camera_hfov = VN_config.get_float('camera', 'horizontal-fov',
                                               72.42)
        self.camera_vfov = VN_config.get_float('camera', 'vertical-fov', 43.3)

        #simulator
        self.simulator = VN_config.get_boolean('simulator', 'use_simulator',
                                               True)
        self.target_file = VN_config.get_string(
            'simulator', 'target_location',
            os.environ['HOME'] + '/visnav/target.jpg')
        self.target_size = VN_config.get_float('algorithm', 'outer_ring', 1.0)

        #Run the program no matter what mode or location; Useful for debug purposes
        self.always_run = VN_config.get_boolean('general', 'always_run', True)

        #how many frames have been captured
        self.frames_captured = 0

        #debugging:
        self.kill_camera = False
Exemple #4
0
	def __init__(self):
		#create sub driectory for logs and videos
		self.location = VN_config.get_string('logging','location','../../visnav/')

		path = self.location + 'logs'
		if not os.path.exists(path):
		    os.makedirs(path)
		path = self.location + 'vids'
		if not os.path.exists(path):
		    os.makedirs(path)

		#set default startegy name
		self.strat_name = 'Smart_Camera'
		
		# get image resolution
		self.img_width = VN_config.get_integer('camera','width',640)
		self.img_height = VN_config.get_integer('camera','height',480)

		#####TEXT LOGGING######
		#levels = 'debug' , 'general' , 'aircraft' , 'algorithm' , ' performance'
		#multiple message levels can be selected by concatination strings i.e. 'debug, aircraft' 
		#what type of messages we print to the terminal
		self.print_level = VN_config.get_string('logging','print_level','debug, general')
		#what type of messages we log to a file
		self.log_level = VN_config.get_string('logging','log_level','aircraft , algorithm, general')


		#####VIDEO RECORDING######
		#levels = 'frame' , 'gui'
		#multiple message levels can be selected at once by concatination strings i.e. 'frame, gui' 
		#what type of images we display on the screen
		self.display_level = VN_config.get_string('logging', 'display_level', 'raw, gui')
		#what type of images we record
		self.record_level = VN_config.get_string('logging', 'record_level', 'raw')

		#Note about useful logging practices:
			#Inorder to replay a flight through the program log_level must include 'aircraft' and 'algorithm'
			#record level must include 'frame'
			#all other logging levels are for user diagnostics

		#a list of video writers and their tag
		self.video_writers = []

		#text logger
		self.logger = None
Exemple #5
0
	def __init__(self):
		self.targetLocation = PositionVector()
		self.vehicleLocation = PositionVector()

		self.backgroundColor = (74,88,109)


		#load target
		filename = VN_config.get_string('simulator', 'target_location', '../../visnav/target.jpg')
		target_size = VN_config.get_float('algorithm', 'outer_ring', 1.0)
		self.load_target(filename,target_size)


		#define camera
		self.camera_width = VN_config.get_integer('camera', 'width', 640)
		self.camera_height = VN_config.get_integer('camera', 'height', 640)
		self.camera_vfov = VN_config.get_float('camera', 'vertical-fov',72.42 )
		self.camera_hfov = VN_config.get_float('camera', 'horizontal-fov', 72.42)
		self.camera_fov = math.sqrt(self.camera_vfov**2 + self.camera_hfov**2)
		self.camera_frameRate = 30
Exemple #6
0
    def __init__(self):
        self.targetLocation = PositionVector()
        self.vehicleLocation = PositionVector()

        self.backgroundColor = (74, 88, 109)

        #load target
        filename = VN_config.get_string('simulator', 'target_location',
                                        '../../visnav/target.jpg')
        target_size = VN_config.get_float('algorithm', 'outer_ring', 1.0)
        self.load_target(filename, target_size)

        #define camera
        self.camera_width = VN_config.get_integer('camera', 'width', 640)
        self.camera_height = VN_config.get_integer('camera', 'height', 640)
        self.camera_vfov = VN_config.get_float('camera', 'vertical-fov', 72.42)
        self.camera_hfov = VN_config.get_float('camera', 'horizontal-fov',
                                               72.42)
        self.camera_fov = math.sqrt(self.camera_vfov**2 + self.camera_hfov**2)
        self.camera_frameRate = 30
Exemple #7
0
    def __init__(self):
        # create sub driectory for logs and videos
        self.location = VN_config.get_string("logging", "location", os.environ["HOME"] + "/visnav/")

        path = self.location + "logs"
        if not os.path.exists(path):
            os.makedirs(path)
        path = self.location + "vids"
        if not os.path.exists(path):
            os.makedirs(path)

            # set default startegy name
        self.strat_name = "Smart_Camera"

        # get image resolution
        self.img_width = VN_config.get_integer("camera", "width", 640)
        self.img_height = VN_config.get_integer("camera", "height", 480)

        #####TEXT LOGGING######
        # levels = 'debug' , 'general' , 'aircraft' , 'algorithm' , ' performance'
        # multiple message levels can be selected by concatination strings i.e. 'debug, aircraft'
        # what type of messages we print to the terminal
        self.print_level = VN_config.get_string("logging", "print_level", "debug, general")
        # what type of messages we log to a file
        self.log_level = VN_config.get_string("logging", "log_level", "aircraft, algorithm, general")

        #####VIDEO RECORDING######
        # levels = 'frame' , 'gui'
        # multiple message levels can be selected at once by concatination strings i.e. 'frame, gui'
        # what type of images we display on the screen
        self.display_level = VN_config.get_string("logging", "display_level", "raw, gui")
        # what type of images we record
        self.record_level = VN_config.get_string("logging", "record_level", "raw")
        # Write a video or individual images
        self.record_type = VN_config.get_string("logging", "record_type", "image")

        # Note about useful logging practices:
        # Inorder to replay a flight through the program log_level must include 'aircraft' and 'algorithm'
        # record level must include 'frame'
        # all other logging levels are for user diagnostics

        # a list of video writers and their tag
        self.video_writers = []

        # text logger
        self.logger = None