def test_values(values, job_id, value_names, output_dir, bag_file, map_file, image_topic, config_path, robot_config, world, use_image_features, groundtruth_bagfile, rmse_rel_start_time, rmse_rel_end_time): new_output_dir = os.path.join(output_dir, str(job_id)) os.mkdir(new_output_dir) graph_config_filepath = os.path.join(config_path, "config", "graph_localizer.config") new_graph_config_filepath = os.path.join(new_output_dir, "graph_localizer.config") config_creator.make_config(values, value_names, graph_config_filepath, new_graph_config_filepath) output_bag = os.path.join(new_output_dir, "results.bag") output_stats_file = os.path.join(new_output_dir, "graph_stats.csv") graph_config_prefix = new_output_dir + '/' run_command = 'rosrun graph_bag run_graph_bag ' + bag_file + ' ' + map_file + ' ' + config_path + ' -o ' + output_bag + ' -s ' + output_stats_file + ' -r ' + robot_config + ' -w ' + world + ' -g ' + graph_config_prefix + ' -f ' + str( use_image_features) if image_topic is not None: run_command += ' -i ' + image_topic os.system(run_command) output_pdf_file = os.path.join(new_output_dir, str(job_id) + '_output.pdf') output_csv_file = os.path.join(new_output_dir, 'graph_stats.csv') plot_command = 'rosrun graph_bag plot_results_main.py ' + output_bag + ' --output-file ' + output_pdf_file + ' --output-csv-file ' + output_csv_file + ' -g ' + groundtruth_bagfile + ' --rmse-rel-start-time ' + str( rmse_rel_start_time) + ' --rmse-rel-end-time ' + str(rmse_rel_end_time) os.system(plot_command)
def test_values( values, job_id, value_names, output_dir, bag_file, map_file, image_topic, config_path, robot_config, world, use_image_features, groundtruth_bagfile, rmse_rel_start_time, rmse_rel_end_time, ): new_output_dir = os.path.join(output_dir, str(job_id)) os.mkdir(new_output_dir) graph_config_filepath = os.path.join(config_path, "config", "graph_localizer.config") new_graph_config_filepath = os.path.join(new_output_dir, "graph_localizer.config") config_creator.make_config(values, value_names, graph_config_filepath, new_graph_config_filepath) output_bag = os.path.join(new_output_dir, "results.bag") output_stats_file = os.path.join(new_output_dir, "graph_stats.csv") graph_config_prefix = new_output_dir + "/" run_command = ("rosrun graph_bag run_graph_bag " + bag_file + " " + map_file + " " + config_path + " -o " + output_bag + " -s " + output_stats_file + " -r " + robot_config + " -w " + world + " -g " + graph_config_prefix + " -f " + str(use_image_features)) if image_topic is not None: run_command += " -i " + image_topic os.system(run_command) output_pdf_file = os.path.join(new_output_dir, str(job_id) + "_output.pdf") output_csv_file = os.path.join(new_output_dir, "graph_stats.csv") plot_command = ("rosrun graph_bag plot_results_main.py " + output_bag + " --output-file " + output_pdf_file + " --output-csv-file " + output_csv_file + " -g " + groundtruth_bagfile + " --rmse-rel-start-time " + str(rmse_rel_start_time) + " --rmse-rel-end-time " + str(rmse_rel_end_time)) os.system(plot_command)
def test_values(values, job_id, value_names, output_dir, bag_file, map_file, image_topic, gnc_config): new_gnc_config_filepath = os.path.join(output_dir, str(job_id) + "_gnc.config") config_creator.make_config(values, value_names, gnc_config, new_gnc_config_filepath) ekf_output_file = os.path.join(output_dir, str(job_id) + "_ekf_results.txt") pdf_output_file = os.path.join(output_dir, str(job_id) + "_plots.pdf") results_csv_output_file = os.path.join(output_dir, str(job_id) + "_results.csv") values_file_name = str(job_id) + '_values.csv' with open(os.path.join(output_dir, values_file_name), 'w') as values_file: id_and_values = (job_id,) + values id_name_and_value_names = ['job_id'] + value_names writer = csv.writer(values_file) writer.writerow(id_name_and_value_names) writer.writerow(id_and_values) options = ekf_graph.RunEKFOptions(bag_file, map_file, ekf_output_file, pdf_output_file, results_csv_output_file) options.set_param_sweep_params(image_topic, job_id, new_gnc_config_filepath) ekf_graph.run_ekf_and_save_stats(options)
def test_values( values, job_id, value_names, output_dir, bag_file, config_path, robot_config, world, groundtruth_bagfile, rmse_rel_start_time, rmse_rel_end_time, ): new_output_dir = os.path.join(output_dir, str(job_id)) os.mkdir(new_output_dir) depth_odometry_config_filepath = os.path.join( config_path, "config", "localization/depth_odometry.config") new_depth_odometry_config_filepath = os.path.join(new_output_dir, "depth_odometry.config") config_creator.make_config( values, value_names, depth_odometry_config_filepath, new_depth_odometry_config_filepath, ) output_bag = os.path.join(new_output_dir, "results.bag") output_stats_file = os.path.join(new_output_dir, "depth_odom_stats.csv") depth_odometry_config_prefix = new_output_dir + "/" run_command = ("rosrun localization_analysis run_depth_odometry_adder " + bag_file + " " + config_path + " -r " + robot_config + " -o " + output_bag + " -w " + world + " -p " + depth_odometry_config_prefix) os.system(run_command) output_pdf_file = os.path.join(new_output_dir, str(job_id) + "_output.pdf") output_csv_file = os.path.join(new_output_dir, "depth_odom_stats.csv") plot_command = ("rosrun localization_analysis plot_results.py " + output_bag + " --output-file " + output_pdf_file + " --output-csv-file " + output_csv_file + " -g " + groundtruth_bagfile + " --rmse-rel-start-time " + str(rmse_rel_start_time) + " --rmse-rel-end-time " + str(rmse_rel_end_time)) os.system(plot_command)