def run_display(lidar_points_csv, flight_path_csv): """ This function is used to display each sweep one by one. This function first read_lidar_element() and read_flight_element() functions from CsvHelper class to read the lidar's point and flight path points from given csv file. After that it calls display_sweep function from DisplayUtil class to display each sweep one by one. @param lidar_points_csv: Given file name of lidar's point. @param flight_path_csv: Given file name of flight path points. """ csv_helper = CsvHelper(lidar_points_csv, flight_path_csv) lidar_points = csv_helper.read_lidar_element() flight_path = csv_helper.read_flight_path_element() display_helper = DisplayUtil(lidar_points, flight_path) display_helper.display_sweep()
def run_flight_optimization(lidar_points_csv, flight_path_csv, output_flight_path_csv): """ This function is used to optimize the flight path. This function first read_lidar_element() and read_flight_element() functions from CsvHelper class to read the lidar's point and flight path points from given csv file. After that it calls optimization function from Optimization class. Finally it calls write_flight_path functions from CsvHelper class to write optimized flight path in the given file name. @param lidar_points_csv: Given file name of lidar's point. @param flight_path_csv: Given file name of flight path points. @param output_flight_path_csv: Given file name to write optimized flight path. """ csv_helper = CsvHelper(lidar_points_csv, flight_path_csv) lidar_points = csv_helper.read_lidar_element() flight_path = csv_helper.read_flight_path_element() optimization = Optimization(lidar_points, flight_path) optimized_lidar_points, optimized_flight_path = optimization.optimization() csv_helper.write_flight_path(optimized_flight_path, output_flight_path_csv)
def test_optimization(lidar_points_file_name, flight_path_file_name): """ This function is used to display each sweep one by one of the optimized flight path. This function first read_lidar_element() and read_flight_element() functions from CsvHelper class to read the lidar's point and flight path points from given csv file. Then it calls optimization function from Optimization class to optimize the flight path. After that it calls display_sweep function from DisplayUtil class to display each sweep one by one of the optimized flight path. @param lidar_points_file_name: Given file name of lidar's point. @param flight_path_file_name: Given file name of flight path points. """ csv_helper = CsvHelper(lidar_points_file_name, flight_path_file_name) flight_path = csv_helper.read_flight_path_element() lidar_points = csv_helper.read_lidar_element() if len(flight_path) != len(lidar_points): print("Wrong given data! Number of sweep in booth file is not equal") else: optimization = Optimization(lidar_points, flight_path) optimized_lidar_points, optimized_flight_path = optimization.optimization( ) display_helper = DisplayUtil(optimized_lidar_points, optimized_flight_path) display_helper.display_sweep()