def bag_and_parameter_sweep(bag_files, output_dir, map_file, image_topic, gnc_config):
    for bag_file in bag_files:
        # Save parameter sweep output in different directory for each bagfile, name directory using bagfile
        bag_name_prefix = os.path.splitext(os.path.basename(bag_file))[0]
        bag_output_dir = os.path.join(output_dir, bag_name_prefix)
        parameter_sweep.make_values_and_parameter_sweep(
            bag_output_dir, bag_file, map_file, image_topic, gnc_config
        )
Example #2
0
def bag_and_parameter_sweep(graph_bag_params_list, output_dir):
    combined_results_csv_files = []
    param_range_directory = None
    for graph_bag_params in graph_bag_params_list:
        # Save parameter sweep output in different directory for each bagfile, name directory using bagfile
        bag_name_prefix = os.path.splitext(
            os.path.basename(graph_bag_params.bagfile))[0]
        bag_output_dir = os.path.join(output_dir, bag_name_prefix)
        param_range_directory_for_bag = parameter_sweep.make_values_and_parameter_sweep(
            bag_output_dir,
            graph_bag_params.bagfile,
            graph_bag_params.map_file,
            graph_bag_params.image_topic,
            graph_bag_params.config_path,
            graph_bag_params.robot_config_file,
            graph_bag_params.world,
            graph_bag_params.use_image_features,
            graph_bag_params.groundtruth_bagfile,
            graph_bag_params.rmse_rel_start_time,
            graph_bag_params.rmse_rel_end_time,
        )
        if not param_range_directory:
            param_range_directory = param_range_directory_for_bag
        combined_results_csv_files.append(
            os.path.join(bag_output_dir, "param_sweep_combined_results.csv"))
    average_parameter_sweep_results(combined_results_csv_files, output_dir)
    save_ranges(param_range_directory, output_dir)