From 3718abf2c8d52c61c610da711fd06470de095fb3 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Fri, 3 Mar 2017 12:54:28 +0100 Subject: [PATCH 01/26] versucht... --- .../html/js/atf_tools/test_comparison.js | 344 +++++++++++------- atf_presenter/html/js/atf_tools/test_list.js | 9 +- 2 files changed, 219 insertions(+), 134 deletions(-) diff --git a/atf_presenter/html/js/atf_tools/test_comparison.js b/atf_presenter/html/js/atf_tools/test_comparison.js index 5ab6c392..cbbaa3b3 100644 --- a/atf_presenter/html/js/atf_tools/test_comparison.js +++ b/atf_presenter/html/js/atf_tools/test_comparison.js @@ -16,57 +16,57 @@ var TestComparison = { efficiency: 100 }, getMaximum: function (files) { - var max = {}; - $.each(files, function (index, test_name) { - var test_results = FileStorage.readData(test_name); - - $.each(test_results, function (testblock_name, testblock_data) { - $.each(testblock_data, function (level_2, level_2_data) { - if (level_2_data.hasOwnProperty('max')) { - // Time - if (!max.hasOwnProperty(level_2)) max[level_2] = 0; - if (level_2_data['max'] > max[level_2]) { - max[level_2] = level_2_data['max']; - } - } else { - $.each(level_2_data, function (level_3, level_3_data) { - if (level_3_data.hasOwnProperty('max')) { - // Path length & obstacle distance - if (!max.hasOwnProperty(level_2)) max[level_2] = 0; - if (level_3_data['max'] > max[level_2]) { - max[level_2] = level_3_data['max']; - } - } else { - $.each(level_3_data, function (level_4, level_4_data) { - // Resources - if (typeof level_4_data['max'][0] === 'undefined') { - // CPU & Mem - if (!max.hasOwnProperty(level_4)) max[level_4] = 0; - if (level_4_data['max'] > max[level_4]) { - max[level_4] = level_4_data['max']; - } - } else { - // IO & Network - if (!max.hasOwnProperty(level_4)) { - max[level_4] = []; - for (var i = 0; i < level_4_data['max'].length; i++) { - max[level_4].push(0); - } - } - $.each(level_4_data['max'], function (index, value) { - if (value > max[level_4][index]) { - max[level_4][index] = value; - } - }); - } - }); - } - }); - } - }); - }); - }); - return max; + //var max = {}; + //$.each(files, function (index, test_name) { + // var test_results = FileStorage.readData(test_name); + // + // $.each(test_results, function (testblock_name, testblock_data) { + // $.each(testblock_data, function (level_2, level_2_data) { + // if (level_2_data.hasOwnProperty('max')) { + // // Time + // if (!max.hasOwnProperty(level_2)) max[level_2] = 0; + // if (level_2_data['max'] > max[level_2]) { + // max[level_2] = level_2_data['max']; + // } + // } else { + // $.each(level_2_data, function (level_3, level_3_data) { + // if (level_3_data.hasOwnProperty('max')) { + // // Path length & obstacle distance + // if (!max.hasOwnProperty(level_2)) max[level_2] = 0; + // if (level_3_data['max'] > max[level_2]) { + // max[level_2] = level_3_data['max']; + // } + // } else { + // $.each(level_3_data, function (level_4, level_4_data) { + // // Resources + // if (typeof level_4_data['max'][0] === 'undefined') { + // // CPU & Mem + // if (!max.hasOwnProperty(level_4)) max[level_4] = 0; + // if (level_4_data['max'] > max[level_4]) { + // max[level_4] = level_4_data['max']; + // } + // } else { + // // IO & Network + // if (!max.hasOwnProperty(level_4)) { + // max[level_4] = []; + // for (var i = 0; i < level_4_data['max'].length; i++) { + // max[level_4].push(0); + // } + // } + // $.each(level_4_data['max'], function (index, value) { + // if (value > max[level_4][index]) { + // max[level_4][index] = value; + // } + // }); + // } + // }); + // } + // }); + // } + // }); + // }); + //}); + return 10; }, compareTests: function (files) { var test_list = FileStorage.readData('test_list'); @@ -146,98 +146,148 @@ var TestComparison = { var temp_testblock = {}; var this_class = this; + var data_per_testblock = {}; + var data_per_test = {}; + number_of_testblocks = Object.keys(test_results).length; + testblock_number = 0; // Iterate through all testblocks $.each(test_results, function (testblock_name, testblock_data) { - $.each(testblock_data, function (level_2, level_2_data) { - if (level_2_data.hasOwnProperty('max')) { - // Time - if (!temp_testblock.hasOwnProperty(level_2)) { - temp_testblock[level_2] = { - total: max_values[level_2], - min: [], - max: [], - average: [] - }; - } - if (temp_testblock[level_2]['total'] != 0) { - temp_testblock[level_2]['average'].push((temp_testblock[level_2]['total'] - level_2_data['average']) / temp_testblock[level_2]['total']); - temp_testblock[level_2]['max'].push((temp_testblock[level_2]['total'] - level_2_data['min']) / temp_testblock[level_2]['total']); - temp_testblock[level_2]['min'].push((temp_testblock[level_2]['total'] - level_2_data['max']) / temp_testblock[level_2]['total']); - } - } else { - $.each(level_2_data, function (level_3, level_3_data) { - if (level_3_data.hasOwnProperty('max')) { - // Path length & obstacle distance - if (!temp_testblock.hasOwnProperty(level_2)) { - temp_testblock[level_2] = { - total: max_values[level_2], - min: [], - max: [], - average: [] - }; - } - if (temp_testblock[level_2]['total'] != 0) { - if (level_2 === 'obstacle_distance') { - temp_testblock[level_2]['average'].push(level_3_data['average'] / temp_testblock[level_2]['total']); - temp_testblock[level_2]['min'].push(level_3_data['min'] / temp_testblock[level_2]['total']); - temp_testblock[level_2]['max'].push(level_3_data['max'] / temp_testblock[level_2]['total']); - } else { - temp_testblock[level_2]['average'].push((temp_testblock[level_2]['total'] - level_3_data['average']) / temp_testblock[level_2]['total']); - temp_testblock[level_2]['max'].push((temp_testblock[level_2]['total'] - level_3_data['min']) / temp_testblock[level_2]['total']); - temp_testblock[level_2]['min'].push((temp_testblock[level_2]['total'] - level_3_data['max']) / temp_testblock[level_2]['total']); - } - } - } else { - $.each(level_3_data, function (level_4, level_4_data) { - // Resources - if (!temp_testblock.hasOwnProperty(level_2)) { - temp_testblock[level_2] = {}; - } - if (typeof level_4_data['max'][0] === 'undefined') { + + $.each(testblock_data, function (metric_name, metric_list) { + //console.log("metric_name=", metric_name); + //console.log("metric_list=", metric_list); + if ((metric_name == 'time') || (metric_name == 'path_length') || (metric_name == 'publish_rate') || (metric_name == 'interface')) + { + number_of_entries = Object.keys(metric_list).length; + //console.log("number_of_entries=", number_of_entries) + $.each(metric_list, function(entry_number, metric_data) { + //console.log("entry_number=", entry_number) + //console.log("metric_data=", metric_data) + metric_key_data = metric_data['data']; + + // individual settings per metric + chart_legend_name = testblock_name + if (metric_name == 'path_length') chart_legend_name = testblock_name + "
(" + metric_data['details']['root_frame'] + " to " + metric_data['details']['measured_frame'] + ")" + if (metric_name == 'publish_rate') chart_legend_name = testblock_name + "
(" + metric_data['details']['topic'] + ")"; + if (metric_name == 'interface') chart_legend_name = testblock_name + "
(" + metric_data['details'] + ")"; + + if (!data_per_test.hasOwnProperty(metric_name)) data_per_test[metric_name] = []; + + if (number_of_testblocks <= 1) {color_testblock = 0} + else {color_testblock = (testblock_number/(number_of_testblocks-1)*255).round(0)} + + if (number_of_entries <= 1) {color_entry = 0} + else {color_entry = (entry_number/(number_of_entries-1)*255).round(0)} + + rgb = [255-color_testblock, color_testblock, color_entry] + color = "rgb(" + rgb[0].toString() + ", " + rgb[1].toString() + ", " + rgb[2].toString() + ")" + //console.log("color=", color) + //DATEN SCHREIBEN!!! + data_per_test[metric_name].push({ + name: chart_legend_name, + data: [{ + x: testblock_number, + y: metric_key_data['average'].round(3), + min: metric_key_data['min'].round(3), + max: metric_key_data['max'].round(3) + }], + color: color + }, { + name: chart_legend_name + '_variation', + type: 'errorbar', + data: [{ + x: testblock_number, + low: metric_key_data['min'].round(3), + high: metric_key_data['max'].round(3) + }, + { + x: testblock_number, + low: metric_data['groundtruth'] - metric_data['groundtruth_epsilon'], + high: metric_data['groundtruth'] + metric_data['groundtruth_epsilon'], + color: "rgb(0, 0, 255)", + stemWidth: 10, + stemColor: "rgba(255, 255, 255, 0)", + whiskerWidth: 3, + whiskerColor: "rgba(0, 0, 0, 0.5)" + }] + }); + }) + } + + if (metric_name == 'resources') + { + // Resources + /* if (typeof level_4_data['max'][0] === 'undefined') { // CPU & Mem - if (!temp_testblock[level_2].hasOwnProperty(level_4)) { - temp_testblock[level_2][level_4] = { - total: max_values[level_4], - min: [], - max: [], - average: [] - }; - } - if (temp_testblock[level_2][level_4]['total'] != 0) { - temp_testblock[level_2][level_4]['average'].push((temp_testblock[level_2][level_4]['total'] - level_4_data['average']) / temp_testblock[level_2][level_4]['total']); - temp_testblock[level_2][level_4]['max'].push((temp_testblock[level_2][level_4]['total'] - level_4_data['min']) / temp_testblock[level_2][level_4]['total']); - temp_testblock[level_2][level_4]['min'].push((temp_testblock[level_2][level_4]['total'] - level_4_data['max']) / temp_testblock[level_2][level_4]['total']); - } - temp_testblock[level_2][level_4]['length']++; + if (!data_per_testblock.hasOwnProperty(level_4)) data_per_testblock[level_4] = []; + data_per_testblock[level_4].push({ + name: level_3, + data: [{ + x: 0, + y: level_4_data['average'].round(2), + min: level_4_data['min'].round(2), + max: level_4_data['max'].round(2) + }] + }, { + name: level_3 + '_variation', + type: 'errorbar', + data: [{ + low: level_4_data['min'].round(3), + high: level_4_data['max'].round(3) + }] + }); } else { + var data = []; + var data_variation = []; + // IO & Network - if (!temp_testblock[level_2].hasOwnProperty(level_4)) { - temp_testblock[level_2][level_4] = { - total: max_values[level_4], - min: [], - max: [], - average: [] - }; - } - for (var x = 0; x < level_4_data['max'].length; x++) { - if (temp_testblock[level_2][level_4]['total'][x] != 0) { - temp_testblock[level_2][level_4]['average'].push((temp_testblock[level_2][level_4]['total'][x] - level_4_data['average'][x]) / temp_testblock[level_2][level_4]['total'][x]); - temp_testblock[level_2][level_4]['max'].push((temp_testblock[level_2][level_4]['total'][x] - level_4_data['min'][x]) / temp_testblock[level_2][level_4]['total'][x]); - temp_testblock[level_2][level_4]['min'].push((temp_testblock[level_2][level_4]['total'][x] - level_4_data['max'][x]) / temp_testblock[level_2][level_4]['total'][x]); + if (!data_per_testblock.hasOwnProperty(level_4)) data_per_testblock[level_4] = []; + for (var i = 0; i < level_4_data['min'].length; i++) { + if (level_4 === 'io' && i > 1) { + level_4_data['average'][i] = (level_4_data['average'][i] / 1000).round(0); + level_4_data['min'][i] = (level_4_data['min'][i] / 1000).round(0); + level_4_data['max'][i] = (level_4_data['max'][i] / 1000).round(0); + } else if (level_4 === 'network' && i < 2) { + level_4_data['average'][i] = (level_4_data['average'][i] / 1000).round(0); + level_4_data['min'][i] = (level_4_data['min'][i] / 1000).round(0); + level_4_data['max'][i] = (level_4_data['max'][i] / 1000).round(0); } + data.push({ + x: i, + y: level_4_data['average'][i].round(0), + min: level_4_data['min'][i].round(0), + max: level_4_data['max'][i].round(0) + }); + data_variation.push({ + low: level_4_data['min'][i].round(0), + high: level_4_data['max'][i].round(0) + }); } + data_per_testblock[level_4].push({ + name: level_3, + data: data + }, { + name: level_3 + '_variation', + type: 'errorbar', + data: data_variation + }); } }); } - }); + });*/ } }); - }); + }); + console.log("data per test", data_per_test); + console.log("data per testblock", data_per_testblock); var temp_metrics = {}; + console.log("temp testblock", temp_testblock); + $.each(data_per_test, function (metric, metric_data) { + console.log("metric", metric); + console.log("metric data", metric_data); - $.each(temp_testblock, function (metric, metric_data) { if (!temp_metrics.hasOwnProperty(metric)) { temp_metrics[metric] = { average: [], @@ -278,13 +328,15 @@ var TestComparison = { }); $.each(categories, function (index, category) { + console.log("category:", category); + if (category != 'total') { var temp = { average: 0, min: 0, max: 0 }; - + if (category === 'resources') { temp['average'] = math.mean(temp_metrics['resources']['average']) * this_class.weight[category]; temp['min'] = math.mean(temp_metrics['resources']['min']) * this_class.weight[category]; @@ -332,10 +384,38 @@ var TestComparison = { } }); - results['total']['average'] = math.mean(temp['average']); - results['total']['min'] = math.mean(temp['min']); - results['total']['max'] = math.mean(temp['max']); + $.each(data_per_testblock, function (metric_name, data) { + console.log("metric name", metric_name); + console.log("data", data); + if (data.length != 0) { + results['total']['average']=data_per_test[metric_name]. + } + }); + testblock_number += 1 + }); + var details_per_test_panel = $('#details_per_test'); + details_per_test_panel.empty(); + + console.log("data_per_test=", data_per_test) + $.each(data_per_test, function (metric_name, data) { + console.log("metric name", metric_name); + console.log("data", data); + if (data.length != 0) test_details.show(); + details_per_test_panel.append('
' + + '
'); + $('#details_' + metric_name + '_content').highcharts({ + chart: plot_options[metric_name]['chart'], + title: plot_options[metric_name]['title'], + xAxis: plot_options[metric_name]['xAxis'], + yAxis: plot_options[metric_name]['yAxis'], + tooltip: plot_options[metric_name]['tooltip'], + series: data, + plotOptions: plot_options[metric_name]['plotOptions'] + }); + }); + + console.log("results: ", results); return results; }, computePoints: function (test_list, files) { @@ -344,7 +424,7 @@ var TestComparison = { // Iterate through selected tests $.each(files, function (index, test_name) { - var results = this_class.ratingAlgorithm(test_list[test_name], FileStorage.readData(test_name), max_values); + var results = this_class.ratingAlgorithm(test_list[test_name], FileStorage.readData("merged_"+test_name), max_values); //Save chart data $.each(results, function (category, data) { diff --git a/atf_presenter/html/js/atf_tools/test_list.js b/atf_presenter/html/js/atf_tools/test_list.js index a6064324..33008ae7 100644 --- a/atf_presenter/html/js/atf_tools/test_list.js +++ b/atf_presenter/html/js/atf_tools/test_list.js @@ -521,8 +521,11 @@ var TestList = { test_details.find('.nav-tabs').append(''); test_details.find('.tab-content').append('
'); } - + + console.log("data per testblock", data_per_testblock); $.each(data_per_testblock, function (metric_name, data) { + console.log("metric name", metric_name); + console.log("data", data); if (data.length != 0) { test_details.show(); @@ -549,8 +552,10 @@ var TestList = { var details_per_test_panel = $('#details_per_test'); details_per_test_panel.empty(); - //console.log("data_per_test=", data_per_test) + console.log("data_per_test=", data_per_test) $.each(data_per_test, function (metric_name, data) { + console.log("metric name", metric_name); + console.log("data", data); if (data.length != 0) test_details.show(); details_per_test_panel.append('
' + '
'); From db380d4a3176fc1eb1e615e0907ede6ffb109bce Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Sun, 5 Mar 2017 11:46:23 +0100 Subject: [PATCH 02/26] add presenter.py --- .../html/js/atf_tools/test_comparison.js | 36 +++-- atf_presenter/scripts/presenter.py | 135 ++++++++++++++++++ 2 files changed, 151 insertions(+), 20 deletions(-) create mode 100755 atf_presenter/scripts/presenter.py diff --git a/atf_presenter/html/js/atf_tools/test_comparison.js b/atf_presenter/html/js/atf_tools/test_comparison.js index cbbaa3b3..01e55c49 100644 --- a/atf_presenter/html/js/atf_tools/test_comparison.js +++ b/atf_presenter/html/js/atf_tools/test_comparison.js @@ -282,7 +282,7 @@ var TestComparison = { console.log("data per test", data_per_test); console.log("data per testblock", data_per_testblock); - var temp_metrics = {}; + /*var temp_metrics = {}; console.log("temp testblock", temp_testblock); $.each(data_per_test, function (metric, metric_data) { console.log("metric", metric); @@ -382,37 +382,33 @@ var TestComparison = { temp['min'].push(results[name]['min']); temp['max'].push(results[name]['max']); } - }); + });*/ $.each(data_per_testblock, function (metric_name, data) { - console.log("metric name", metric_name); - console.log("data", data); + //console.log("metric name", metric_name); + //console.log("data", data); if (data.length != 0) { - results['total']['average']=data_per_test[metric_name]. + results['total']['min'] = data[metric_name].data.min; } }); - testblock_number += 1 - }); + var details_per_test_panel = $('#details_per_test'); details_per_test_panel.empty(); - console.log("data_per_test=", data_per_test) + console.log("data_per_test=", data_per_test); $.each(data_per_test, function (metric_name, data) { console.log("metric name", metric_name); console.log("data", data); - if (data.length != 0) test_details.show(); - details_per_test_panel.append('
' + - '
'); - $('#details_' + metric_name + '_content').highcharts({ - chart: plot_options[metric_name]['chart'], - title: plot_options[metric_name]['title'], - xAxis: plot_options[metric_name]['xAxis'], - yAxis: plot_options[metric_name]['yAxis'], - tooltip: plot_options[metric_name]['tooltip'], - series: data, - plotOptions: plot_options[metric_name]['plotOptions'] - }); + if (data.length != 0){ + console.log("results: ", data[0].data[0].min); + console.log("results: ", data[0].data[0].max); + console.log("results: ", data[0].data[0].y); + results['total']['min'] = data[0].data[0].min; + results['total']['max'] = data[0].data[0].max; + results['total']['average'] = data[0].data[0].y; + + } }); console.log("results: ", results); diff --git a/atf_presenter/scripts/presenter.py b/atf_presenter/scripts/presenter.py new file mode 100755 index 00000000..1db05b2a --- /dev/null +++ b/atf_presenter/scripts/presenter.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python +import numpy +import rospy +import yaml +import matplotlib.pyplot as pyplot + +class presenter: + + def __init__(self): + self.filepath = "/tmp/atf_test/results_yaml/" + self.yaml_file = {} + self.testblock = [] + self.metric = set() + self.data = {} + self.tests = {} + + + + def import_yaml(self, file): + with open(self.filepath+file, 'r') as stream: + try: + #print(yaml.load(stream)) + self.yaml_file = yaml.load(stream) + except yaml.YAMLError as exc: + print(exc) + for testblock, metrics in self.yaml_file.iteritems(): + for metric, values in metrics.iteritems(): + self.data.update({metric : []}) + + def extract_yaml(self, num): + avg = self.data.copy() + mini = self.data.copy() + maxi = self.data.copy() + for testblock, metrics in self.yaml_file.iteritems(): + #print ("testblock: ", testblock) + for metric, values in metrics.iteritems(): + #print ("metric: ", metric) + self.metric.add(metric) + for data in values: + for name, result in data.iteritems(): + #print ("name:", name) + if result != None: + #print ("result: ",result) + #print type(result) + if isinstance(result, dict): + for attribute, number in result.iteritems(): + #print ("attribute: ", attribute) + if isinstance(number, list): + for dictval in number: + print ("value: ", dictval) + elif isinstance(number, float): + #print ("float: ",number) + if attribute == "average": + avg[metric].append(number) + if attribute == "min": + mini[metric].append(number) + if attribute == "max": + maxi[metric].append(number) + elif isinstance(number, int): + print ("integer: ",number) + elif isinstance(number, str) or isinstance(result, unicode): + print ("string: ",number) + elif isinstance(result, list): + for arrval in result: + print ("arrval:", arrval) + elif isinstance(result, int): + print ("number: ", result) + elif isinstance(result, str) or isinstance(result, unicode): + print ("string: ", result) + else: + rospy.logerr("Error, unknown result!") + vals = [avg, maxi, mini] + self.tests.update({"test"+str(num): vals}) + print ("tests:", self.tests) + def show_results(self): + print self.metric + for metric in self.metric: + plotdata = {} + testnames = [] + for testname, data in self.tests.iteritems(): + print "-------------------------------------------" + print testname + print data + #plotdata.update({testname : data[metric]}) + means = data[0][metric] + for i in (means): + testnames.append(testname) + + + print("show") + print testnames + print self.metric + print plotdata + N = 5 + ind = numpy.arange(len(data[0][metric])) # the x locations for the groups + width = 0.35 # the width of the bars + + #fig, ax = pyplot.subplots() + rects1 = ax.bar(ind, means, width, color='r')#, yerr=men_std) + + # women_means = [25, 32, 34, 20, 25] + # women_std = [3, 5, 2, 3, 3] + # ind = numpy.arange(N) + # rects2 = ax.bar(ind + width, women_means, width, color='y', yerr=women_std) + + # add some text for labels, title and axes ticks + ax.set_ylabel('Scores') + ax.set_title(metric) + ax.set_xticks(ind + width / 2) + ax.set_xticklabels(testnames) + + ax.legend((rects1[0], rects2[0]), ('Men', 'Women')) + + def autolabel(rects): + """ + Attach a text label above each bar displaying its height + """ + for rect in rects: + height = rect.get_height() + ax.text(rect.get_x() + rect.get_width() / 2., 1.05 * height, + '%d' % int(height), + ha='center', va='bottom') + + autolabel(rects1) + autolabel(rects2) + + pyplot.show() + +if __name__ == '__main__': + p = presenter() + p.import_yaml("merged_ts0_c0_r0_e0.yaml") + p.extract_yaml(1) + p.import_yaml("merged_ts0_c0_r1_e0.yaml") + p.extract_yaml(2) + p.show_results() From 9a121cfab2ceb611d3e978b9c12ca20b96ab4b39 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Mon, 6 Mar 2017 10:50:56 +0100 Subject: [PATCH 03/26] newest changes --- atf_presenter/scripts/presenter.py | 87 ++++++++++++++++++++---------- 1 file changed, 58 insertions(+), 29 deletions(-) diff --git a/atf_presenter/scripts/presenter.py b/atf_presenter/scripts/presenter.py index 1db05b2a..47c61a95 100755 --- a/atf_presenter/scripts/presenter.py +++ b/atf_presenter/scripts/presenter.py @@ -2,6 +2,7 @@ import numpy import rospy import yaml +import copy import matplotlib.pyplot as pyplot class presenter: @@ -28,9 +29,9 @@ def import_yaml(self, file): self.data.update({metric : []}) def extract_yaml(self, num): - avg = self.data.copy() - mini = self.data.copy() - maxi = self.data.copy() + avg = copy.deepcopy(self.data) + mini = copy.deepcopy(self.data) + maxi = copy.deepcopy(self.data) for testblock, metrics in self.yaml_file.iteritems(): #print ("testblock: ", testblock) for metric, values in metrics.iteritems(): @@ -49,13 +50,18 @@ def extract_yaml(self, num): for dictval in number: print ("value: ", dictval) elif isinstance(number, float): - #print ("float: ",number) + print ("result: ",result) if attribute == "average": avg[metric].append(number) + print "avg:", number if attribute == "min": mini[metric].append(number) + print "min:", number if attribute == "max": maxi[metric].append(number) + print "max:", number + print "avg:", avg, "min:", mini, "max:", maxi + print "\n \n \n -------------------------------------------------------------- \n \n \n" elif isinstance(number, int): print ("integer: ",number) elif isinstance(number, str) or isinstance(result, unicode): @@ -70,46 +76,68 @@ def extract_yaml(self, num): else: rospy.logerr("Error, unknown result!") vals = [avg, maxi, mini] + print "values", vals self.tests.update({"test"+str(num): vals}) + print "-------------------------------------------------" print ("tests:", self.tests) + print "-------------------------------------------------" + def show_results(self): print self.metric for metric in self.metric: plotdata = {} testnames = [] + means = [] + err = [] for testname, data in self.tests.iteritems(): - print "-------------------------------------------" - print testname - print data - #plotdata.update({testname : data[metric]}) - means = data[0][metric] - for i in (means): + # print "-------------------------------------------" + # print testname + print "data: ", data + print "mean: ",data[0][metric] + print "max: ", data[1][metric] + # #plotdata.update({testname : data[metric]}) + means.extend(data[0][metric]) + err.extend(numpy.array(data[1][metric])-numpy.array(data[0][metric])) + print "err:", err + for i in data[0][metric]: testnames.append(testname) - print("show") + # print("show") print testnames - print self.metric - print plotdata - N = 5 - ind = numpy.arange(len(data[0][metric])) # the x locations for the groups - width = 0.35 # the width of the bars - - #fig, ax = pyplot.subplots() - rects1 = ax.bar(ind, means, width, color='r')#, yerr=men_std) + # print self.metric + # print plotdata + + fig, ax = pyplot.subplots() + y_pos = numpy.arange(len(testnames)) + print "x", y_pos + print "y", means + #pyplot.bar(y_pos, means, align='center', alpha=0.5, yerr=err) + # example data + x = numpy.arange(0.1, 2, 0.5) + y = numpy.exp(-x) + print "x", x + print "y", y + + # example variable error bar values + yerr = 0.1 + 0.2 * numpy.sqrt(x) + xerr = 0.1 + yerr + #pyplot.errorbar(y_pos, means, yerr=[yerr, 2 * yerr], fmt='--o') + #pyplot.bar(y_pos, means, yerr=[yerr, 4 * yerr], alpha=0.5) + print "ypos:", y_pos[0], "means", means[0] + rects1 = ax.bar(y_pos, means, yerr=[yerr, 4 * yerr], alpha=0.5) + rects2 = ax.bar(y_pos, means, yerr=[yerr, 0.5 * yerr], alpha=0.5) + + # pyplot.xticks(y_pos, testnames) + # pyplot.ylabel('Usage') + # pyplot.title(metric) - # women_means = [25, 32, 34, 20, 25] - # women_std = [3, 5, 2, 3, 3] - # ind = numpy.arange(N) - # rects2 = ax.bar(ind + width, women_means, width, color='y', yerr=women_std) - - # add some text for labels, title and axes ticks ax.set_ylabel('Scores') - ax.set_title(metric) - ax.set_xticks(ind + width / 2) - ax.set_xticklabels(testnames) + ax.set_title('Scores by group and gender') + ax.set_xticks(y_pos + 0.5 / 2) + #ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5')) - ax.legend((rects1[0], rects2[0]), ('Men', 'Women')) + #ax.legend((rects1[0], rects2[0]), ('Men', 'Women')) def autolabel(rects): """ @@ -124,6 +152,7 @@ def autolabel(rects): autolabel(rects1) autolabel(rects2) + pyplot.show() if __name__ == '__main__': From c3f63b7b748ef49269b63661711ac08c7384d185 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Sat, 11 Mar 2017 11:45:49 +0100 Subject: [PATCH 04/26] modified presenter --- atf_presenter/scripts/presenter.py | 114 +++++++++++------------------ 1 file changed, 44 insertions(+), 70 deletions(-) diff --git a/atf_presenter/scripts/presenter.py b/atf_presenter/scripts/presenter.py index 47c61a95..37c8fce0 100755 --- a/atf_presenter/scripts/presenter.py +++ b/atf_presenter/scripts/presenter.py @@ -5,6 +5,8 @@ import copy import matplotlib.pyplot as pyplot +import os + class presenter: def __init__(self): @@ -18,7 +20,8 @@ def __init__(self): def import_yaml(self, file): - with open(self.filepath+file, 'r') as stream: + with open(file, 'r') as stream: + print "import file", file try: #print(yaml.load(stream)) self.yaml_file = yaml.load(stream) @@ -32,6 +35,7 @@ def extract_yaml(self, num): avg = copy.deepcopy(self.data) mini = copy.deepcopy(self.data) maxi = copy.deepcopy(self.data) + numvals = copy.deepcopy(self.data) for testblock, metrics in self.yaml_file.iteritems(): #print ("testblock: ", testblock) for metric, values in metrics.iteritems(): @@ -47,21 +51,23 @@ def extract_yaml(self, num): for attribute, number in result.iteritems(): #print ("attribute: ", attribute) if isinstance(number, list): - for dictval in number: - print ("value: ", dictval) + numvals[metric].append(number) + #print "numvals", numvals + #for dictval in number: + #print ("value: ", dictval) elif isinstance(number, float): - print ("result: ",result) + #print ("result: ",result) if attribute == "average": avg[metric].append(number) - print "avg:", number + ##print "avg:", number if attribute == "min": mini[metric].append(number) - print "min:", number + #print "min:", number if attribute == "max": maxi[metric].append(number) - print "max:", number - print "avg:", avg, "min:", mini, "max:", maxi - print "\n \n \n -------------------------------------------------------------- \n \n \n" + #print "max:", number + #print "avg:", avg, "min:", mini, "max:", maxi + #print "\n \n -------------------------------------------------------------- \n \n" elif isinstance(number, int): print ("integer: ",number) elif isinstance(number, str) or isinstance(result, unicode): @@ -75,90 +81,58 @@ def extract_yaml(self, num): print ("string: ", result) else: rospy.logerr("Error, unknown result!") - vals = [avg, maxi, mini] - print "values", vals - self.tests.update({"test"+str(num): vals}) - print "-------------------------------------------------" - print ("tests:", self.tests) - print "-------------------------------------------------" + vals = [avg, numvals] + #print "values", vals + self.tests.update({str(num): vals}) + # print "-------------------------------------------------" + # print ("tests:", self.tests) + # print "-------------------------------------------------" def show_results(self): print self.metric for metric in self.metric: - plotdata = {} testnames = [] means = [] - err = [] + devs = [] for testname, data in self.tests.iteritems(): # print "-------------------------------------------" # print testname - print "data: ", data - print "mean: ",data[0][metric] - print "max: ", data[1][metric] - # #plotdata.update({testname : data[metric]}) + # print "\n data: ", data + # print "\n mean: ",data[0][metric] + # print "\n values: ", data[1][metric] means.extend(data[0][metric]) - err.extend(numpy.array(data[1][metric])-numpy.array(data[0][metric])) - print "err:", err + for mean in data[1][metric]: + #print "mean", mean + devs.append(numpy.std(mean)) for i in data[0][metric]: testnames.append(testname) - # print("show") - print testnames + #print testnames # print self.metric # print plotdata - fig, ax = pyplot.subplots() y_pos = numpy.arange(len(testnames)) print "x", y_pos print "y", means - #pyplot.bar(y_pos, means, align='center', alpha=0.5, yerr=err) - # example data - x = numpy.arange(0.1, 2, 0.5) - y = numpy.exp(-x) - print "x", x - print "y", y - - # example variable error bar values - yerr = 0.1 + 0.2 * numpy.sqrt(x) - xerr = 0.1 + yerr - #pyplot.errorbar(y_pos, means, yerr=[yerr, 2 * yerr], fmt='--o') - #pyplot.bar(y_pos, means, yerr=[yerr, 4 * yerr], alpha=0.5) - print "ypos:", y_pos[0], "means", means[0] - rects1 = ax.bar(y_pos, means, yerr=[yerr, 4 * yerr], alpha=0.5) - rects2 = ax.bar(y_pos, means, yerr=[yerr, 0.5 * yerr], alpha=0.5) - - # pyplot.xticks(y_pos, testnames) - # pyplot.ylabel('Usage') - # pyplot.title(metric) - - ax.set_ylabel('Scores') - ax.set_title('Scores by group and gender') - ax.set_xticks(y_pos + 0.5 / 2) - #ax.set_xticklabels(('G1', 'G2', 'G3', 'G4', 'G5')) - - #ax.legend((rects1[0], rects2[0]), ('Men', 'Women')) - - def autolabel(rects): - """ - Attach a text label above each bar displaying its height - """ - for rect in rects: - height = rect.get_height() - ax.text(rect.get_x() + rect.get_width() / 2., 1.05 * height, - '%d' % int(height), - ha='center', va='bottom') - - autolabel(rects1) - autolabel(rects2) - + print "yerr", devs + pyplot.bar(y_pos, means, yerr=devs, alpha=0.5, color='red') + pyplot.xticks(y_pos+0.8/2, testnames, rotation='vertical') + pyplot.title(metric) + pyplot.tight_layout() pyplot.show() if __name__ == '__main__': p = presenter() - p.import_yaml("merged_ts0_c0_r0_e0.yaml") - p.extract_yaml(1) - p.import_yaml("merged_ts0_c0_r1_e0.yaml") - p.extract_yaml(2) + + Path = "/tmp/atf_test/results_yaml/" + filelist = os.listdir(Path) + for file in filelist: + print "file", file + if "merged" in str(file): + print "merged", file + p.import_yaml(Path+file) + filename = file.replace('.yaml', '') + p.extract_yaml(filename.replace('merged_', '')) p.show_results() From 5a83f335387ba73c47f53f38ec0b6ec4391487fa Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Sat, 11 Mar 2017 11:50:00 +0100 Subject: [PATCH 05/26] added files --- .idea/atf.iml | 12 + .idea/inspectionProfiles/Project_Default.xml | 13 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 954 ++++++++++++++++++ .../src/atf_metrics/calculate_distance.py | 116 +++ .../src/atf_metrics/check_localization.py | 100 ++ .../html/js/atf_tools/test_compare.js | 574 +++++++++++ hannes_test/CMakeLists.txt | 29 + hannes_test/config/robot_envs/env1.yaml | 2 + hannes_test/config/robots/part100_250mm.yaml | 12 + hannes_test/config/robots/part100_350mm.yaml | 12 + hannes_test/config/robots/part100_500mm.yaml | 12 + hannes_test/config/robots/part100_600mm.yaml | 12 + hannes_test/config/robots/part100_750mm.yaml | 12 + hannes_test/config/robots/part150_250mm.yaml | 12 + hannes_test/config/robots/part150_350mm.yaml | 12 + hannes_test/config/robots/part150_500mm.yaml | 12 + hannes_test/config/robots/part150_600mm.yaml | 12 + hannes_test/config/robots/part150_750mm.yaml | 12 + hannes_test/config/robots/part200_250mm.yaml | 12 + hannes_test/config/robots/part200_350mm.yaml | 12 + hannes_test/config/robots/part200_500mm.yaml | 12 + hannes_test/config/robots/part200_600mm.yaml | 12 + hannes_test/config/robots/part200_750mm.yaml | 12 + hannes_test/config/robots/part75_250mm.yaml | 12 + hannes_test/config/robots/part75_350mm.yaml | 12 + hannes_test/config/robots/part75_500mm.yaml | 12 + hannes_test/config/robots/part75_600mm.yaml | 12 + hannes_test/config/robots/part75_750mm.yaml | 12 + hannes_test/config/robots/robot1.yaml | 12 + hannes_test/config/robots/robot2.yaml | 7 + hannes_test/config/robots/robot3.yaml | 12 + hannes_test/config/test_configs/test1.yaml | 16 + hannes_test/config/test_configs/test2.yaml | 40 + hannes_test/config/test_configs/test3.yaml | 11 + .../config/test_generation_config.yaml | 21 + hannes_test/config/test_suites.yaml | 28 + hannes_test/launch/all.launch | 6 + hannes_test/launch/application.launch | 42 + hannes_test/package.xml | 22 + hannes_test/scripts/application.py | 89 ++ 43 files changed, 2364 insertions(+) create mode 100644 .idea/atf.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml create mode 100644 atf_metrics/src/atf_metrics/calculate_distance.py create mode 100644 atf_metrics/src/atf_metrics/check_localization.py create mode 100644 atf_presenter/html/js/atf_tools/test_compare.js create mode 100644 hannes_test/CMakeLists.txt create mode 100644 hannes_test/config/robot_envs/env1.yaml create mode 100644 hannes_test/config/robots/part100_250mm.yaml create mode 100644 hannes_test/config/robots/part100_350mm.yaml create mode 100644 hannes_test/config/robots/part100_500mm.yaml create mode 100644 hannes_test/config/robots/part100_600mm.yaml create mode 100644 hannes_test/config/robots/part100_750mm.yaml create mode 100644 hannes_test/config/robots/part150_250mm.yaml create mode 100644 hannes_test/config/robots/part150_350mm.yaml create mode 100644 hannes_test/config/robots/part150_500mm.yaml create mode 100644 hannes_test/config/robots/part150_600mm.yaml create mode 100644 hannes_test/config/robots/part150_750mm.yaml create mode 100644 hannes_test/config/robots/part200_250mm.yaml create mode 100644 hannes_test/config/robots/part200_350mm.yaml create mode 100644 hannes_test/config/robots/part200_500mm.yaml create mode 100644 hannes_test/config/robots/part200_600mm.yaml create mode 100644 hannes_test/config/robots/part200_750mm.yaml create mode 100644 hannes_test/config/robots/part75_250mm.yaml create mode 100644 hannes_test/config/robots/part75_350mm.yaml create mode 100644 hannes_test/config/robots/part75_500mm.yaml create mode 100644 hannes_test/config/robots/part75_600mm.yaml create mode 100644 hannes_test/config/robots/part75_750mm.yaml create mode 100644 hannes_test/config/robots/robot1.yaml create mode 100644 hannes_test/config/robots/robot2.yaml create mode 100644 hannes_test/config/robots/robot3.yaml create mode 100644 hannes_test/config/test_configs/test1.yaml create mode 100644 hannes_test/config/test_configs/test2.yaml create mode 100644 hannes_test/config/test_configs/test3.yaml create mode 100644 hannes_test/config/test_generation_config.yaml create mode 100644 hannes_test/config/test_suites.yaml create mode 100644 hannes_test/launch/all.launch create mode 100644 hannes_test/launch/application.launch create mode 100644 hannes_test/package.xml create mode 100755 hannes_test/scripts/application.py diff --git a/.idea/atf.iml b/.idea/atf.iml new file mode 100644 index 00000000..6f63a63c --- /dev/null +++ b/.idea/atf.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..3dc583b2 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..7b4d854c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..3b4b9228 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..94a25f7f --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..c47837bb --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,954 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Calculate + calculat + dist + distance + cal + PathLength + robot_config_file + write_lock + bagf + self.test_config + test + [testblock]["resources"] + B + Trigger + collect_resource_data + trigger_callback + self.res_pi + testblock_list + stests + plt + print + create_testblock_list + testblock + + + CheckLocalization + ["resources"][testblock] + CPULoad + TestblockTrigger + numpy + tests + pyplot + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1487770023563 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/atf_metrics/src/atf_metrics/calculate_distance.py b/atf_metrics/src/atf_metrics/calculate_distance.py new file mode 100644 index 00000000..62ea9a7d --- /dev/null +++ b/atf_metrics/src/atf_metrics/calculate_distance.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python +import rospy +import tf +import math + +class CalculateDistanceParamHandler: + def __init__(self): + """ + Class for returning the corresponding metric class with the given parameter. + """ + pass + + def parse_parameter(self, testblock_name, params): + """ + Method that returns the metric method with the given parameter. + :param params: Parameter + """ + metrics = [] + if type(params) is not list: + rospy.logerr("metric config not a list") + return False + + for metric in params: + # check for optional parameters + try: + groundtruth = metric["groundtruth"] + groundtruth_epsilon = metric["groundtruth_epsilon"] + except (TypeError, KeyError): + rospy.logwarn("No groundtruth parameters given, skipping groundtruth evaluation for metric 'distance' in testblock '%s'", testblock_name) + groundtruth = None + groundtruth_epsilon = None + metrics.append(CalculateDistance(metric["root_frame"], metric["measured_frame"], groundtruth, groundtruth_epsilon)) + return metrics + +class CalculateDistance: + def __init__(self, root_frame, measured_frame, groundtruth, groundtruth_epsilon): + """ + Class for calculating the distance to a given root frame. + The tf data is sent over the tf topic given in the robot_config.yaml. + :param root_frame: name of the first frame + :type root_frame: string + :param measured_frame: name of the second frame. The distance will be measured in relation to the root_frame. + :type measured_frame: string + """ + + self.active = False + self.root_frame = root_frame + self.measured_frame = measured_frame + self.distance = 0.0 + self.distances = 0.0 + self.dist_count = 0 + self.tf_sampling_freq = 20.0 # Hz + self.groundtruth = groundtruth + self.groundtruth_epsilon = groundtruth_epsilon + self.finished = False + + self.listener = tf.TransformListener() + + rospy.Timer(rospy.Duration.from_sec(1 / self.tf_sampling_freq), self.record_tf) + + def start(self, timestamp): + self.active = True + + def stop(self, timestamp): + self.active = False + self.finished = True + + def pause(self, timestamp): + self.active = False + self.first_value = True + + def purge(self, timestamp): + pass + + def record_tf(self, event): + if self.active: + try: + self.listener.waitForTransform(self.root_frame, + self.measured_frame, + rospy.Time(0), + rospy.Duration.from_sec(1 / (2*self.tf_sampling_freq))) + (trans, rot) = self.listener.lookupTransform(self.root_frame, self.measured_frame, rospy.Time(0)) + # self.listener.waitForTransform("/map", + # self.measured_frame, + # rospy.Time(0), + # rospy.Duration.from_sec(1 / (2*self.tf_sampling_freq))) + # (trans_hmm, rot_hmm) = self.listener.lookupTransform("/map", self.measured_frame, rospy.Time(0)) + # self.listener.waitForTransform("/map", + # self.root_frame, + # rospy.Time(0), + # rospy.Duration.from_sec(1 / (2*self.tf_sampling_freq))) + # (trans_ekf, rot_ekf) = self.listener.lookupTransform("/map", self.root_frame, rospy.Time(0)) + + except (tf.Exception, tf.LookupException, tf.ConnectivityException): + #rospy.logwarn(e) + pass + else: + self.distances = self.distances + math.sqrt(trans[0]**2 + trans[1]**2) + #rospy.loginfo("distance: "+str(math.sqrt(trans[0]**2 + trans[1]**2))+" baselink: "+str(math.sqrt(trans_hmm[0]**2 + trans_hmm[1]**2))+" baselinkekf: "+str(math.sqrt(trans_ekf[0]**2 + trans_ekf[1]**2))) + self.dist_count = self.dist_count + 1 + + + def get_result(self): + groundtruth_result = None + details = {"root_frame": self.root_frame, "measured_frame": self.measured_frame} + if self.finished: + print "Distances: "+str(self.distances)+" Dist Count: "+str(self.dist_count) + data = round(self.distances/self.dist_count, 3) + if self.groundtruth != None and self.groundtruth_epsilon != None: + if math.fabs(self.groundtruth - data) <= self.groundtruth_epsilon: + groundtruth_result = True + else: + groundtruth_result = False + return "distance", data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details + else: + return False diff --git a/atf_metrics/src/atf_metrics/check_localization.py b/atf_metrics/src/atf_metrics/check_localization.py new file mode 100644 index 00000000..30ca1386 --- /dev/null +++ b/atf_metrics/src/atf_metrics/check_localization.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +import rospy +import tf +import math + +class CheckLocalizationParamHandler: + def __init__(self): + """ + Class for returning the corresponding metric class with the given parameter. + """ + pass + + def parse_parameter(self, testblock_name, params): + """ + Method that returns the metric method with the given parameter. + :param params: Parameter + """ + metrics = [] + if type(params) is not list: + rospy.logerr("metric config not a list") + return False + + for metric in params: + # check for optional parameters + try: + groundtruth = metric["groundtruth"] + groundtruth_epsilon = metric["groundtruth_epsilon"] + except (TypeError, KeyError): + rospy.logwarn("No groundtruth parameters given, skipping groundtruth evaluation for metric 'distance' in testblock '%s'", testblock_name) + groundtruth = None + groundtruth_epsilon = None + metrics.append(CheckLocalization(metric["root_frame"], metric["measured_frame"], groundtruth, groundtruth_epsilon)) + return metrics + +class CheckLocalization: + def __init__(self, root_frame, measured_frame, groundtruth, groundtruth_epsilon): + """ + Class for calculating the distance to a given root frame. + The tf data is sent over the tf topic given in the robot_config.yaml. + :param root_frame: name of the first frame + :type root_frame: string + :param measured_frame: name of the second frame. The distance will be measured in relation to the root_frame. + :type measured_frame: string + """ + + self.active = False + self.root_frame = root_frame + self.measured_frame = measured_frame + self.distance = 0.0 + self.tf_sampling_freq = 5.0 # Hz + self.groundtruth = groundtruth + self.groundtruth_epsilon = groundtruth_epsilon + self.finished = False + + self.listener = tf.TransformListener() + + rospy.Timer(rospy.Duration.from_sec(1 / self.tf_sampling_freq), self.record_tf) + + def start(self, timestamp): + self.active = True + + def stop(self, timestamp): + self.active = False + self.finished = True + + def pause(self, timestamp): + self.active = False + self.first_value = True + + def purge(self, timestamp): + pass + + def record_tf(self, event): + if self.active: + try: + self.listener.waitForTransform(self.root_frame, + self.measured_frame, + rospy.Time(0), + rospy.Duration.from_sec(1 / (2*self.tf_sampling_freq))) + (trans, rot) = self.listener.lookupTransform(self.root_frame, self.measured_frame, rospy.Time(0)) + except (tf.Exception, tf.LookupException, tf.ConnectivityException): + #rospy.logwarn(e) + pass + else: + self.distance = math.sqrt(trans[0]**2 + trans[1]**2) + + + def get_result(self): + groundtruth_result = None + details = {"root_frame": self.root_frame, "measured_frame": self.measured_frame} + if self.finished: + data = round(self.distance, 3) + if self.groundtruth != None and self.groundtruth_epsilon != None: + if math.fabs(self.groundtruth - data) <= self.groundtruth_epsilon: + groundtruth_result = True + else: + groundtruth_result = False + return "localization", data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details + else: + return False diff --git a/atf_presenter/html/js/atf_tools/test_compare.js b/atf_presenter/html/js/atf_tools/test_compare.js new file mode 100644 index 00000000..157ac32b --- /dev/null +++ b/atf_presenter/html/js/atf_tools/test_compare.js @@ -0,0 +1,574 @@ +var TestCompare = { + name: 'test_compare', + convert: function (data) { + var new_test_list = {}; + $.each(data, function (index, values) { + $.each(values, function (index, values) { + new_test_list[index] = values; + }); + }); + return new_test_list; + }, + show: function () { + this.init(); + $('#test_list_content').show(); + }, + //init: function () { + // console.log("init") + // var test_list = FileStorage.readData(this.name); + // var test_list_div = $('#test_list_content').find('#test_list'); + // var compare_test_option = $('#compare_test_option'); + // var test_list_compare_selection_test = compare_test_option.find('#select_test_config'); + // var test_list_compare_selection_scene = compare_test_option.find('#select_scene_config'); + // var this_class = this; + // + // test_list_div.empty(); + // test_list_compare_selection_test.empty().append('').selectpicker('refresh'); + // + // test_list_compare_selection_scene.empty().append('').selectpicker('refresh'); + // + // var test_config_names = []; + // var scene_config_names = []; + // var number = 1; + // + // $.each(test_list, function (test_name, test_data) { + // //console.log("test_name=", test_name) + // var test_name_full = test_name.split('_'); + // //console.log("test_name_full=", test_name_full) + // var upload_status; + // var table_row_error; + // var test_error; + // var button_disabled; + // var checkbox_disabled; + // var test = FileStorage.readData("merged_" + test_name); + // + // if (!test) { + // upload_status = 'Error: File not found!'; + // table_row_error = ''; + // test_error = ''; + // button_disabled = ' disabled="disabled"'; + // checkbox_disabled = ' disabled="disabled"'; + // } else { + // upload_status = 'No error: No errors!'; + // button_disabled = ''; + // var error = this_class.checkForErrors(test); + // if (error[0] === 'error') { + // test_error = 'Error: ' + error[1]; + // table_row_error = ''; + // checkbox_disabled = ' disabled="disabled"'; + // } else if (error[0] === 'planning') { + // test_error = 'Error: ' + error[1]; + // table_row_error = ''; + // checkbox_disabled = ' disabled="disabled"'; + // } else { + // test_error = upload_status; + // table_row_error = ''; + // checkbox_disabled = button_disabled; + // + // if ($.inArray(test_data['test_config'], test_config_names) === -1) { + // test_config_names.push(test_data['test_config']); + // test_list_compare_selection_test.prop('disabled', false).append('').selectpicker('refresh'); + // } + // + // if ($.inArray(test_data['scene_config'], scene_config_names) === -1) { + // scene_config_names.push(test_data['scene_config']); + // test_list_compare_selection_scene.append('').selectpicker('refresh'); + // } + // } + // } + // + // test_list_div.append(table_row_error + + // '
' + + // '' + number + '' + + // '' + test_name + '' + + // 'Testsuite ' + test_name_full[0].replace(/^\D+/g, '') + '' + + // 'Test ' + test_name_full[1].replace(/^\D+/g, '') + '' + + // '' + test_data['test_config'] + '' + + // '' + test_data['scene_config'] + '' + + // '' + test_data['robot'] + '' + + // '' + upload_status + '' + test_error + '' + + // ''); + // number++; + // }); + //}, + checkForErrors: function (file) { + var error = ''; + if (file.hasOwnProperty('error')) { + error = ['error', 'Error(s) during execution!']; + } else { + $.each(file, function (testblock_name, testblock_value) { + if (testblock_value.hasOwnProperty('status') && testblock_value['status'] === 'error') { + error = ['planning', 'Planning error in testblock "' + testblock_name + '"!']; + return false; + } + }); + } + return error; + }, + compareTests: function (files) { + console.log("compareTests"); + $.each(files, function (index, name) { + var test_detail_div = $('#detail_test'); + var test_name_split = name.split('_'); + test_detail_div.find('.modal-title').html('Details Testsuite ' + test_name_split[0].replace(/^\D+/g, '') + ' - Test ' + test_name_split[1].replace(/^\D+/g, '')); + var test_details = test_detail_div.find('#detail_panel'); + var test_details_tab_content = test_details.find('.tab-content'); + test_details.hide(); + + // Get test data + //console.log("name=", name) + var test_results = FileStorage.readData("merged_" + name); + + // Get test list + var test_list = FileStorage.readData('test_list'); + var test_data = test_list[name]; + + var configuration_div = test_detail_div.find('#detail_configuration'); + configuration_div.empty(); + + var status_div = test_detail_div.find('#detail_status'); + status_div.empty(); + + var first_entry = true; + var error = false; + + var plot_tooltip = { + formatter: function () { + var o = this.point.options; + if (this.series.name.indexOf('variation') != -1) + { + name = this.series.name.split("_variation")[0] + groundtruth_epsilon = (o.high - o.low)/2.0 + groundtruth = o.low + groundtruth_epsilon + return '' + name + '
' + + 'Groundtruth: ' + groundtruth.round(3) + '+-' + groundtruth_epsilon.round(3) + '
'; + } + else + { + return '' + this.series.name + '
' + + 'Average: ' + this.y + '
' + + 'Minimum: ' + o.min + '
' + + 'Maximum: ' + o.max + '
'; + } + } + }; + + var categories = { + io: ['Read count', + 'Write count', + 'Kilobytes read', + 'Kilobytes wrote'], + network: ['Kilobytes sent', + 'Kilobytes received', + 'Packets sent', + 'Packets received', + 'Errors received', + 'Errors sent', + 'Packets dropped: Received', + 'Packets dropped: Sent'] + }; + + var plot_options = { + cpu: { + chart: { + defaultSeriesType: 'column', + type: 'column', + zoomType: 'xy' + }, + title: { + text: 'CPU' + }, + yAxis: { + title: { + text: 'Average consumption [%]' + } + }, + xAxis: { + labels: { + enabled: false + } + }, + plotOptions: {}, + tooltip: plot_tooltip + }, + mem: { + chart: { + defaultSeriesType: 'column', + type: 'column', + zoomType: 'xy' + }, + title: { + text: 'Memory' + }, + yAxis: { + title: { + text: 'Average consumption [%]' + } + }, + xAxis: { + labels: { + enabled: false + } + }, + plotOptions: {}, + tooltip: plot_tooltip + }, + io: { + chart: { + defaultSeriesType: 'column', + type: 'column', + zoomType: 'xy' + }, + title: { + text: 'Disk IO operations' + }, + yAxis: {}, + xAxis: { + labels: {} + }, + plotOptions: {}, + tooltip: plot_tooltip + }, + network: { + chart: { + defaultSeriesType: 'column', + type: 'column', + zoomType: 'xy' + }, + title: { + text: 'Network traffic' + }, + yAxis: {}, + xAxis: { + labels: {} + }, + plotOptions: {}, + tooltip: plot_tooltip + }, + time: { + chart: { + defaultSeriesType: 'column', + type: 'column', + zoomType: 'xy' + }, + title: { + text: 'Time' + }, + yAxis: { + title: { + text: 'Time [s]' + } + }, + xAxis: { + labels: { + enabled: false + } + }, + plotOptions: {}, + tooltip: plot_tooltip + }, + path_length: { + chart: { + defaultSeriesType: 'column', + type: 'column', + zoomType: 'xy' + }, + title: { + text: 'Path length' + }, + yAxis: { + title: { + text: 'Path length [m]' + } + }, + xAxis: { + labels: { + enabled: false + } + }, + plotOptions: {}, + tooltip: plot_tooltip + }, + publish_rate: { + chart: { + defaultSeriesType: 'column', + type: 'column', + zoomType: 'xy' + }, + title: { + text: 'Publish rate' + }, + yAxis: { + title: { + text: 'Publish rate [hz]' + } + }, + xAxis: { + labels: { + enabled: false + } + }, + plotOptions: {}, + tooltip: plot_tooltip + }, + interface: { + chart: { + defaultSeriesType: 'column', + type: 'column', + zoomType: 'xy' + }, + title: { + text: 'Interface' + }, + yAxis: { + title: { + text: 'Interface score [#]' + } + }, + xAxis: { + labels: { + enabled: false + } + }, + plotOptions: {}, + tooltip: plot_tooltip + }, + obstacle_distance: { + chart: { + defaultSeriesType: 'column', + type: 'column', + zoomType: 'xy' + }, + title: { + text: 'Minimal distance to obstacles' + }, + yAxis: { + title: { + text: 'Distance [m]' + } + }, + xAxis: { + labels: { + enabled: false + } + }, + plotOptions: {}, + tooltip: plot_tooltip + } + }; + + $.each(test_data, function (name) { + if (name === 'subtests') return true; + configuration_div.append('
  • ' + name.capitalize().replace('_', ' ') + ': ' + test_data[name] + '
  • '); + }); + + var data_per_test = {}; + + number_of_testblocks = Object.keys(test_results).length + //console.log("number_of_testblocks=", number_of_testblocks) + testblock_number = 0 + $.each(test_results, function (testblock_name, testblock_data) { + //console.log("testblock_name=", testblock_name); + //console.log("testblock_number=", testblock_number); + //console.log("testblock_data=", testblock_data); + + if (testblock_data.hasOwnProperty('status') && testblock_data['status'] === 'error') { + status_div.append(''); + error = true; + return false; + } else if (testblock_name === 'error') { + status_div.append(''); + error = true; + return false; + } + + var data_per_testblock = {}; + + $.each(testblock_data, function (metric_name, metric_list) { + //console.log("metric_name=", metric_name); + //console.log("metric_list=", metric_list); + if ((metric_name == 'time') || (metric_name == 'path_length') || (metric_name == 'publish_rate') || (metric_name == 'interface')) + { + number_of_entries = Object.keys(metric_list).length + //console.log("number_of_entries=", number_of_entries) + $.each(metric_list, function(entry_number, metric_data) { + //console.log("entry_number=", entry_number) + //console.log("metric_data=", metric_data) + metric_key_data = metric_data['data'] + + // individual settings per metric + chart_legend_name = testblock_name + if (metric_name == 'path_length') chart_legend_name = testblock_name + "
    (" + metric_data['details']['root_frame'] + " to " + metric_data['details']['measured_frame'] + ")" + if (metric_name == 'publish_rate') chart_legend_name = testblock_name + "
    (" + metric_data['details']['topic'] + ")" + if (metric_name == 'interface') chart_legend_name = testblock_name + "
    (" + metric_data['details'] + ")" + + if (!data_per_test.hasOwnProperty(metric_name)) data_per_test[metric_name] = []; + + if (number_of_testblocks <= 1) {color_testblock = 0} + else {color_testblock = (testblock_number/(number_of_testblocks-1)*255).round(0)} + + if (number_of_entries <= 1) {color_entry = 0} + else {color_entry = (entry_number/(number_of_entries-1)*255).round(0)} + + rgb = [255-color_testblock, color_testblock, color_entry] + color = "rgb(" + rgb[0].toString() + ", " + rgb[1].toString() + ", " + rgb[2].toString() + ")" + //console.log("color=", color) + + data_per_test[metric_name].push({ + name: chart_legend_name, + data: [{ + x: testblock_number, + y: metric_key_data['average'].round(3), + min: metric_key_data['min'].round(3), + max: metric_key_data['max'].round(3) + }], + color: color + }, { + name: chart_legend_name + '_variation', + type: 'errorbar', + data: [{ + x: testblock_number, + low: metric_key_data['min'].round(3), + high: metric_key_data['max'].round(3) + }, + { + x: testblock_number, + low: metric_data['groundtruth'] - metric_data['groundtruth_epsilon'], + high: metric_data['groundtruth'] + metric_data['groundtruth_epsilon'], + color: "rgb(0, 0, 255)", + stemWidth: 10, + stemColor: "rgba(255, 255, 255, 0)", + whiskerWidth: 3, + whiskerColor: "rgba(0, 0, 0, 0.5)" + }] + }); + }) + } + + if (metric_name == 'resources') + { + // Resources + /* if (typeof level_4_data['max'][0] === 'undefined') { + // CPU & Mem + if (!data_per_testblock.hasOwnProperty(level_4)) data_per_testblock[level_4] = []; + data_per_testblock[level_4].push({ + name: level_3, + data: [{ + x: 0, + y: level_4_data['average'].round(2), + min: level_4_data['min'].round(2), + max: level_4_data['max'].round(2) + }] + }, { + name: level_3 + '_variation', + type: 'errorbar', + data: [{ + low: level_4_data['min'].round(3), + high: level_4_data['max'].round(3) + }] + }); + } else { + var data = []; + var data_variation = []; + + // IO & Network + if (!data_per_testblock.hasOwnProperty(level_4)) data_per_testblock[level_4] = []; + for (var i = 0; i < level_4_data['min'].length; i++) { + if (level_4 === 'io' && i > 1) { + level_4_data['average'][i] = (level_4_data['average'][i] / 1000).round(0); + level_4_data['min'][i] = (level_4_data['min'][i] / 1000).round(0); + level_4_data['max'][i] = (level_4_data['max'][i] / 1000).round(0); + } else if (level_4 === 'network' && i < 2) { + level_4_data['average'][i] = (level_4_data['average'][i] / 1000).round(0); + level_4_data['min'][i] = (level_4_data['min'][i] / 1000).round(0); + level_4_data['max'][i] = (level_4_data['max'][i] / 1000).round(0); + } + data.push({ + x: i, + y: level_4_data['average'][i].round(0), + min: level_4_data['min'][i].round(0), + max: level_4_data['max'][i].round(0) + }); + data_variation.push({ + low: level_4_data['min'][i].round(0), + high: level_4_data['max'][i].round(0) + }); + } + data_per_testblock[level_4].push({ + name: level_3, + data: data + }, { + name: level_3 + '_variation', + type: 'errorbar', + data: data_variation + }); + } + }); + } + });*/ + } + }); + + if (Object.keys(data_per_testblock).length != 0) { + var active_class; + if (first_entry) { + test_details.find('.nav-tabs').empty(); + test_details.find('.tab-content').empty(); + active_class = 'active'; + first_entry = false; + } else + active_class = ''; + + test_details.find('.nav-tabs').append(''); + test_details.find('.tab-content').append('
    '); + } + + $.each(data_per_testblock, function (metric_name, data) { + if (data.length != 0) { + test_details.show(); + + var testblock_tab_content = test_details_tab_content.find('#details_' + testblock_name); + testblock_tab_content.append('
    ' + + '
    '); + if (categories.hasOwnProperty(metric_name)) plot_options[metric_name]['xAxis']['categories'] = categories[metric_name]; + else plot_options[metric_name]['xAxis']['categories'] = []; + + $('#details_' + testblock_name).find('#details_' + testblock_name + '_' + metric_name + '_content').highcharts({ + chart: plot_options[metric_name]['chart'], + title: plot_options[metric_name]['title'], + xAxis: plot_options[metric_name]['xAxis'], + yAxis: plot_options[metric_name]['yAxis'], + tooltip: plot_options[metric_name]['tooltip'], + series: data, + plotOptions: plot_options[metric_name]['plotOptions'] + }); + } + }); + testblock_number += 1 + }); + + var details_per_test_panel = $('#details_per_test'); + details_per_test_panel.empty(); + + //console.log("data_per_test=", data_per_test) + $.each(data_per_test, function (metric_name, data) { + if (data.length != 0) test_details.show(); + details_per_test_panel.append('
    ' + + '
    '); + $('#details_' + metric_name + '_content').highcharts({ + chart: plot_options[metric_name]['chart'], + title: plot_options[metric_name]['title'], + xAxis: plot_options[metric_name]['xAxis'], + yAxis: plot_options[metric_name]['yAxis'], + tooltip: plot_options[metric_name]['tooltip'], + series: data, + plotOptions: plot_options[metric_name]['plotOptions'] + }); + }); + + if (!error) { + status_div.append(''); + } + }); + } +}; diff --git a/hannes_test/CMakeLists.txt b/hannes_test/CMakeLists.txt new file mode 100644 index 00000000..8aff420d --- /dev/null +++ b/hannes_test/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 2.8.3) +project(hannes_test) + +find_package(catkin REQUIRED COMPONENTS + atf_core + roslaunch + rospy + rostopic +) +catkin_package( + CATKIN_DEPENDS rospy +) + +########### +## Build ## +########### + +############# +## Install ## +############# + +install(PROGRAMS scripts/application.py + DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) + +############# +## Testing ## +############# +roslaunch_add_file_check(launch) +atf_test() diff --git a/hannes_test/config/robot_envs/env1.yaml b/hannes_test/config/robot_envs/env1.yaml new file mode 100644 index 00000000..7a35d52a --- /dev/null +++ b/hannes_test/config/robot_envs/env1.yaml @@ -0,0 +1,2 @@ +additional_parameters: [] # Name and value of additional parameter which will be included in every recording test file +additional_arguments: [] # Name and value of additional arguments which will be included in every recording test file diff --git a/hannes_test/config/robots/part100_250mm.yaml b/hannes_test/config/robots/part100_250mm.yaml new file mode 100644 index 00000000..0b0ca2da --- /dev/null +++ b/hannes_test/config/robots/part100_250mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.25 + "part_num": 100 diff --git a/hannes_test/config/robots/part100_350mm.yaml b/hannes_test/config/robots/part100_350mm.yaml new file mode 100644 index 00000000..a6b4585b --- /dev/null +++ b/hannes_test/config/robots/part100_350mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.35 + "part_num": 100 diff --git a/hannes_test/config/robots/part100_500mm.yaml b/hannes_test/config/robots/part100_500mm.yaml new file mode 100644 index 00000000..57a1d6fe --- /dev/null +++ b/hannes_test/config/robots/part100_500mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.50 + "part_num": 100 diff --git a/hannes_test/config/robots/part100_600mm.yaml b/hannes_test/config/robots/part100_600mm.yaml new file mode 100644 index 00000000..359d07a8 --- /dev/null +++ b/hannes_test/config/robots/part100_600mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.60 + "part_num": 100 diff --git a/hannes_test/config/robots/part100_750mm.yaml b/hannes_test/config/robots/part100_750mm.yaml new file mode 100644 index 00000000..2496114a --- /dev/null +++ b/hannes_test/config/robots/part100_750mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.75 + "part_num": 100 diff --git a/hannes_test/config/robots/part150_250mm.yaml b/hannes_test/config/robots/part150_250mm.yaml new file mode 100644 index 00000000..7d58c76c --- /dev/null +++ b/hannes_test/config/robots/part150_250mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.25 + "part_num": 150 diff --git a/hannes_test/config/robots/part150_350mm.yaml b/hannes_test/config/robots/part150_350mm.yaml new file mode 100644 index 00000000..05447f8e --- /dev/null +++ b/hannes_test/config/robots/part150_350mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.35 + "part_num": 150 diff --git a/hannes_test/config/robots/part150_500mm.yaml b/hannes_test/config/robots/part150_500mm.yaml new file mode 100644 index 00000000..8597c2f1 --- /dev/null +++ b/hannes_test/config/robots/part150_500mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.50 + "part_num": 150 diff --git a/hannes_test/config/robots/part150_600mm.yaml b/hannes_test/config/robots/part150_600mm.yaml new file mode 100644 index 00000000..525eb0c8 --- /dev/null +++ b/hannes_test/config/robots/part150_600mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.60 + "part_num": 150 diff --git a/hannes_test/config/robots/part150_750mm.yaml b/hannes_test/config/robots/part150_750mm.yaml new file mode 100644 index 00000000..1b554ac6 --- /dev/null +++ b/hannes_test/config/robots/part150_750mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.75 + "part_num": 150 diff --git a/hannes_test/config/robots/part200_250mm.yaml b/hannes_test/config/robots/part200_250mm.yaml new file mode 100644 index 00000000..45728702 --- /dev/null +++ b/hannes_test/config/robots/part200_250mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.250 + "part_num": 200 diff --git a/hannes_test/config/robots/part200_350mm.yaml b/hannes_test/config/robots/part200_350mm.yaml new file mode 100644 index 00000000..85347f59 --- /dev/null +++ b/hannes_test/config/robots/part200_350mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.350 + "part_num": 200 diff --git a/hannes_test/config/robots/part200_500mm.yaml b/hannes_test/config/robots/part200_500mm.yaml new file mode 100644 index 00000000..44aeaa67 --- /dev/null +++ b/hannes_test/config/robots/part200_500mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.50 + "part_num": 200 diff --git a/hannes_test/config/robots/part200_600mm.yaml b/hannes_test/config/robots/part200_600mm.yaml new file mode 100644 index 00000000..5096c621 --- /dev/null +++ b/hannes_test/config/robots/part200_600mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.60 + "part_num": 200 diff --git a/hannes_test/config/robots/part200_750mm.yaml b/hannes_test/config/robots/part200_750mm.yaml new file mode 100644 index 00000000..e7bb2040 --- /dev/null +++ b/hannes_test/config/robots/part200_750mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.75 + "part_num": 200 diff --git a/hannes_test/config/robots/part75_250mm.yaml b/hannes_test/config/robots/part75_250mm.yaml new file mode 100644 index 00000000..c1b32d06 --- /dev/null +++ b/hannes_test/config/robots/part75_250mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.25 + "part_num": 75 diff --git a/hannes_test/config/robots/part75_350mm.yaml b/hannes_test/config/robots/part75_350mm.yaml new file mode 100644 index 00000000..466feef9 --- /dev/null +++ b/hannes_test/config/robots/part75_350mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.35 + "part_num": 75 diff --git a/hannes_test/config/robots/part75_500mm.yaml b/hannes_test/config/robots/part75_500mm.yaml new file mode 100644 index 00000000..1807ecbf --- /dev/null +++ b/hannes_test/config/robots/part75_500mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.5 + "part_num": 75 diff --git a/hannes_test/config/robots/part75_600mm.yaml b/hannes_test/config/robots/part75_600mm.yaml new file mode 100644 index 00000000..5edfb85f --- /dev/null +++ b/hannes_test/config/robots/part75_600mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.6 + "part_num": 75 diff --git a/hannes_test/config/robots/part75_750mm.yaml b/hannes_test/config/robots/part75_750mm.yaml new file mode 100644 index 00000000..9db4bece --- /dev/null +++ b/hannes_test/config/robots/part75_750mm.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.75 + "part_num": 75 diff --git a/hannes_test/config/robots/robot1.yaml b/hannes_test/config/robots/robot1.yaml new file mode 100644 index 00000000..5aa18733 --- /dev/null +++ b/hannes_test/config/robots/robot1.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 0.2 + "part_num": 100 diff --git a/hannes_test/config/robots/robot2.yaml b/hannes_test/config/robots/robot2.yaml new file mode 100644 index 00000000..636d86e2 --- /dev/null +++ b/hannes_test/config/robots/robot2.yaml @@ -0,0 +1,7 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameter: [] # Name and value of additional parameter which will be included in every recording test file +additional_arguments: [] # Name and value of additional arguments which will be included in every recording test file diff --git a/hannes_test/config/robots/robot3.yaml b/hannes_test/config/robots/robot3.yaml new file mode 100644 index 00000000..f5d02d45 --- /dev/null +++ b/hannes_test/config/robots/robot3.yaml @@ -0,0 +1,12 @@ +path_length: # Topics for the metric 'path_length' + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file +wait_for_topics: [] # Names of the topics to wait for before beginning the test +wait_for_services: [] # Names of the services to wait for before beginning the test +additional_parameters: + "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file +additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "int_res": 1.2 + "part_num": 10 diff --git a/hannes_test/config/test_configs/test1.yaml b/hannes_test/config/test_configs/test1.yaml new file mode 100644 index 00000000..35518bc2 --- /dev/null +++ b/hannes_test/config/test_configs/test1.yaml @@ -0,0 +1,16 @@ +# without groundtruth, without global topics +testblock_small: + time: [] + path_length: + - root_frame: map + measured_frame: base_link + distance: + - root_frame: base_link_ekf + measured_frame: base_link + localization: + - root_frame: base_link_ekf + measured_frame: base_link + groundtruth: 0.0 + groundtruth_epsilon: 2.0 + +# testblock_all empty diff --git a/hannes_test/config/test_configs/test2.yaml b/hannes_test/config/test_configs/test2.yaml new file mode 100644 index 00000000..9251ee40 --- /dev/null +++ b/hannes_test/config/test_configs/test2.yaml @@ -0,0 +1,40 @@ +# with groundtruth, with global topics +testblock_small: + time: [] + path_length: + - root_frame: map + - measured_frame: base_link + publish_rate: + - topic: map_hmm + - topic: map_intern +testblock_large: + time: + - groundtruth: 5 + groundtruth_epsilon: 0.5 + path_length: + - root_frame: link1 + measured_frame: link2 + groundtruth: 12.56 + groundtruth_epsilon: 1.5 + - root_frame: link1 + measured_frame: link3 + groundtruth: 0 + groundtruth_epsilon: 1.5 + publish_rate: + - topic: /topic1 + groundtruth: 11 + groundtruth_epsilon: 5 + - topic: /topic2 + groundtruth: 22 + groundtruth_epsilon: 5 + - topic: /topic3 + groundtruth: 33 + groundtruth_epsilon: 5 + interface: + - node: publisher1 + publishers: + - [topic1, std_msgs/String] + - node: publisher2 + publishers: + - [topic2, std_msgs/String] +# testblock_all empty diff --git a/hannes_test/config/test_configs/test3.yaml b/hannes_test/config/test_configs/test3.yaml new file mode 100644 index 00000000..e67f973d --- /dev/null +++ b/hannes_test/config/test_configs/test3.yaml @@ -0,0 +1,11 @@ +# without groundtruth, without global topics +testblock_small: + time: [] + path_length: + - root_frame: map + measured_frame: base_link + distance: + - root_frame: base_link_ekf + measured_frame: base_link + +# testblock_all empty diff --git a/hannes_test/config/test_generation_config.yaml b/hannes_test/config/test_generation_config.yaml new file mode 100644 index 00000000..502c39f8 --- /dev/null +++ b/hannes_test/config/test_generation_config.yaml @@ -0,0 +1,21 @@ +suites_file: config/test_suites.yaml # Path of the test_suite file +test_config_path: config/test_configs # Path of the test_config file +robot_config_path: config/robots # Folder which contains the robot_config files +robot_env_config_path: config/robot_envs # Folder which contains the robot_env_config files +repetitions: 5 # Number of repetitions per test + +app_executable: application.py # Name of the application's executable file +additional_launch_file: launch/application.launch # Path of the additional launch file + +bagfile_output: "/tmp/hannes_test/data/" # Folder for bagfile output +json_output: "/tmp/hannes_test/results_json/" # Folder for the json files output +yaml_output: "/tmp/hannes_test/results_yaml/" # Folder for the yaml files output + +speed_factor_analysis: 1.0 # Factor to speedup analysis (can lower accuracy if too fast, especially path_length) + +time_limit_recording: 700.0 # Time limit in seconds for recording +time_limit_analysing: 1000.0 # Time limit in seconds for analysing +time_limit_uploading: 1000.0 # Time limit in seconds for uploading + +upload_data: false +upload_result: false diff --git a/hannes_test/config/test_suites.yaml b/hannes_test/config/test_suites.yaml new file mode 100644 index 00000000..b762852f --- /dev/null +++ b/hannes_test/config/test_suites.yaml @@ -0,0 +1,28 @@ +# Definition of various test suites +testsuite_1: + test_configs: # You have to define at least one test_config + - test1 + robots: # You have to define at least one robot + - part200_250mm + - part200_350mm + - part200_500mm + - part200_600mm + - part200_750mm + - part100_250mm + - part100_350mm + - part100_500mm + - part100_600mm + - part100_750mm + - part150_250mm + - part150_350mm + - part150_500mm + - part150_600mm + - part150_750mm + - part75_250mm + - part75_350mm + - part75_500mm + - part75_600mm + - part75_750mm + + robot_envs: # You have to define at least one robot_env + - env1 diff --git a/hannes_test/launch/all.launch b/hannes_test/launch/all.launch new file mode 100644 index 00000000..548e73a8 --- /dev/null +++ b/hannes_test/launch/all.launch @@ -0,0 +1,6 @@ + + + + + + diff --git a/hannes_test/launch/application.launch b/hannes_test/launch/application.launch new file mode 100644 index 00000000..2227239e --- /dev/null +++ b/hannes_test/launch/application.launch @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hannes_test/package.xml b/hannes_test/package.xml new file mode 100644 index 00000000..3df1d6ec --- /dev/null +++ b/hannes_test/package.xml @@ -0,0 +1,22 @@ + + + hannes_test + 0.1.0 + Example test configuration to verifying the correct behaviour of the ATF. + + Florian Weisshardt + + Florian Weisshardt + + Apache 2.0 + + catkin + + atf_core + roslaunch + rospy + rostopic + + rostest + + diff --git a/hannes_test/scripts/application.py b/hannes_test/scripts/application.py new file mode 100755 index 00000000..4b4b2730 --- /dev/null +++ b/hannes_test/scripts/application.py @@ -0,0 +1,89 @@ +#!/usr/bin/python +import unittest +import rospy +import rostest +import tf +import math +import sys + +from atf_core import ATF +from simple_script_server import * + +class Application: + def __init__(self): + # ATF code + self.atf = ATF() + + # native app code + self.pub_freq = 20.0 # Hz + self.br = tf.TransformBroadcaster() + rospy.sleep(1) #wait for tf broadcaster to get active (rospy bug?) + self.sss = simple_script_server() + + def execute(self): + rospy.sleep(1) + self.initpose() + rospy.sleep(15) + self.atf.start("testblock_small") + rospy.sleep(12)#600s + #self.sss.move("base", [25.0,68.5,0.0]) + self.atf.stop("testblock_small") + + # large testblock (circle r=1, time=5 + #self.atf.start("testblock_large") + #self.pub_tf_circle("link1", "link2", radius=2, time=5) + #self.atf.stop("testblock_large") + + self.atf.shutdown() + + def pub_tf_circle(self, parent_frame_id, child1_frame_id, radius=1, time=1): + rate = rospy.Rate(int(self.pub_freq)) + for i in range(int(self.pub_freq * time) + 1): + t = i / self.pub_freq / time + self.br.sendTransform( + (-radius * math.cos(2 * math.pi * t) + radius, -radius * math.sin(2 * math.pi * t), 0), + tf.transformations.quaternion_from_euler(0, 0, 0), + rospy.Time.now(), + child1_frame_id, + parent_frame_id) + rate.sleep() + + def initpose(self): + pub_initialpose = rospy.Publisher('initialpose', PoseWithCovarianceStamped, queue_size=1) + + initialpose = PoseWithCovarianceStamped() + initialpose.header.stamp = rospy.Time.now() + print "stamp: "+str( initialpose.header.stamp) + initialpose.header.frame_id = "map" + initialpose.pose.pose.position.x = 8.2 + initialpose.pose.pose.position.y = 39.1 + initialpose.pose.pose.position.z = 0 + quat = tf.transformations.quaternion_from_euler(0.0, 0.0, -2.78) + initialpose.pose.pose.orientation.x = quat[0] + initialpose.pose.pose.orientation.y = quat[1] + initialpose.pose.pose.orientation.z = quat[2] + initialpose.pose.pose.orientation.w = quat[3] + + # publish robot pose on initialpose topic + for i in range(0,2): + pub_initialpose.publish(initialpose) + rospy.sleep(1.5) + print "publish initpose" + +class Test(unittest.TestCase): + def setUp(self): + self.app = Application() + + def tearDown(self): + pass + + def test_Recording(self): + self.app.execute() + +if __name__ == '__main__': + rospy.init_node('test_name') + if "standalone" in sys.argv: + app = Application() + app.execute() + else: + rostest.rosrun('application', 'recording', Test, sysargs=None) From 313e84e592a9ed1ae9f072ec2963ee5e46979c90 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Sat, 11 Mar 2017 20:22:17 +0100 Subject: [PATCH 06/26] msg add nodes not fixed --- .idea/workspace.xml | 269 ++++++++++-------- atf_core/src/atf_core/configuration_parser.py | 5 +- atf_core/src/atf_core/recorder.py | 2 +- .../config/recorder_plugins.yaml | 2 +- .../src/atf_recorder_plugins/__init__.py | 2 +- .../atf_recorder_plugins/plugin_resources.py | 195 ++++++++----- 6 files changed, 271 insertions(+), 204 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index c47837bb..18e2a446 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,12 @@ - + + + + + + \ No newline at end of file diff --git a/atf_core/src/atf_core/configuration_parser.py b/atf_core/src/atf_core/configuration_parser.py index e948d49f..3860270e 100644 --- a/atf_core/src/atf_core/configuration_parser.py +++ b/atf_core/src/atf_core/configuration_parser.py @@ -29,6 +29,7 @@ def get_config(self): def create_testblocks(self, config, recorder_handle=None, create_metrics=False): testblocks = {} + print "create testblocks, config:", config["test_config"] for testblock_name in config["test_config"].keys(): metric_handles = [] if create_metrics: @@ -37,9 +38,9 @@ def create_testblocks(self, config, recorder_handle=None, create_metrics=False): metric_handlers_config = self.load_data(rospkg.RosPack().get_path("atf_metrics") + "/config/metrics.yaml") #print "metric_handlers_config=", metric_handlers_config for metric_name in metrics: - #print "metric_name=", metric_name + print "metric_name=", metric_name metrics_return_list = getattr(atf_metrics, metric_handlers_config[metric_name]["handler"])().parse_parameter(testblock_name, metrics[metric_name]) - #print "metrics_return_list=", metrics_return_list + print "metrics_return_list=", metrics_return_list if type(metrics_return_list) == list: for metric_return in metrics_return_list: #print "metric_return=", metric_return diff --git a/atf_core/src/atf_core/recorder.py b/atf_core/src/atf_core/recorder.py index d127e09e..22ff3e09 100644 --- a/atf_core/src/atf_core/recorder.py +++ b/atf_core/src/atf_core/recorder.py @@ -140,7 +140,7 @@ def record_trigger(self, trigger): raise ATFRecorderError("Testblock '%s' not in test config" % trigger.name) # Send message to all recorder plugins - #print "self.recorder_plugin_list=", self.recorder_plugin_list + print "self.recorder_plugin_list=", self.recorder_plugin_list, "\n trigger: ", trigger for recorder_plugin in self.recorder_plugin_list: recorder_plugin.trigger_callback(trigger) diff --git a/atf_recorder_plugins/config/recorder_plugins.yaml b/atf_recorder_plugins/config/recorder_plugins.yaml index e85989bc..1b2ac1da 100644 --- a/atf_recorder_plugins/config/recorder_plugins.yaml +++ b/atf_recorder_plugins/config/recorder_plugins.yaml @@ -1,4 +1,4 @@ -#resources: RecordResources +resources: RecordResources interface: RecordInterface #obstacle_distance: RecordObstacleDistance # example: Example diff --git a/atf_recorder_plugins/src/atf_recorder_plugins/__init__.py b/atf_recorder_plugins/src/atf_recorder_plugins/__init__.py index d54ff25b..8a6deeef 100644 --- a/atf_recorder_plugins/src/atf_recorder_plugins/__init__.py +++ b/atf_recorder_plugins/src/atf_recorder_plugins/__init__.py @@ -1,4 +1,4 @@ -#from atf_recorder_plugins.plugin_resources import RecordResources +from atf_recorder_plugins.plugin_resources import RecordResources from atf_recorder_plugins.plugin_interface import RecordInterface #from atf_recorder_plugins.plugin_obstacle_distance import RecordObstacleDistance # from atf_recorder_plugins.example import Example diff --git a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py index abfc64d8..04524551 100755 --- a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py +++ b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py @@ -4,18 +4,19 @@ import time import xmlrpclib import rosnode +import yaml from copy import copy from re import findall from subprocess import check_output, CalledProcessError -from atf_msgs.msg import Resources, IO, Network -from atf_recorder import BagfileWriter - +from atf_msgs.msg import NodeResources, Resources, IO, Network, TestblockTrigger class RecordResources: - def __init__(self, topic_prefix, config_file, robot_config_file, write_lock, bag_file): - self.topic_prefix = topic_prefix - self.test_config = config_file + def __init__(self, write_lock, bag_file_writer): + self.topic_prefix = "" + file = "/home/fmw-hb/workshop_catkin_ws/src/msh_test/hannes_test_msh/config/test_configs/test2.yaml" + with open(file, 'r') as stream: + self.test_config = yaml.load(stream) self.resources_timer_frequency = 4.0 # Hz self.timer_interval = 1/self.resources_timer_frequency @@ -25,119 +26,161 @@ def __init__(self, topic_prefix, config_file, robot_config_file, write_lock, bag self.requested_nodes = {} self.res_pipeline = {} - self.BfW = BagfileWriter(bag_file, write_lock) + self.BfW = bag_file_writer rospy.Timer(rospy.Duration.from_sec(self.timer_interval), self.collect_resource_data) def update_requested_nodes(self, msg): - - if msg.trigger.trigger == Trigger.ACTIVATE: - for node in self.testblock_list[msg.name]: - if node not in self.requested_nodes: - self.requested_nodes[node] = copy(self.testblock_list[msg.name][node]) - self.res_pipeline[node] = copy(self.testblock_list[msg.name][node]) - else: - for res in self.testblock_list[msg.name][node]: - self.requested_nodes[node].append(res) - if res not in self.res_pipeline[node]: - self.res_pipeline[node].append(res) - - elif msg.trigger.trigger == Trigger.FINISH: + counter = 0 + if msg.trigger == TestblockTrigger.START: + print "START Trigger" for node in self.testblock_list[msg.name]: - for res in self.testblock_list[msg.name][node]: - self.requested_nodes[node].remove(res) - if res not in self.requested_nodes[node]: - self.res_pipeline[node].remove(res) - if len(self.requested_nodes[node]) == 0: - del self.requested_nodes[node] - del self.res_pipeline[node] + + #print "node: ", node, "requested nodes:", self.requested_nodes, "testblock node", self.testblock_list[msg.name] + for resource, names in node.iteritems(): + for name in names: + print resource, name + if name not in self.requested_nodes: + print "new node", counter, self.testblock_list[msg.name][counter][resource]#, "ohne: ", self.testblock_list[msg.name][resource] + self.requested_nodes[resource] = copy(self.testblock_list[msg.name][counter][resource]) + self.res_pipeline[resource] = copy(self.testblock_list[msg.name][counter][resource]) + # else: + # for res in self.testblock_list[msg.name][counter][resource]: + # self.requested_nodes[re].append(res) + # if res not in self.res_pipeline[node]: + # self.res_pipeline[node].append(res) + print "requested nodes start:", self.requested_nodes + counter += 1 + + elif msg.trigger == TestblockTrigger.STOP: + print "STOP Trigger" + # for node in self.testblock_list[msg.name]: + # + # # print "node: ", node, "requested nodes:", self.requested_nodes, "testblock node", self.testblock_list[msg.name] + # for resource, names in node.iteritems(): + # for name in names: + # print resource, name + # if name not in self.requested_nodes: + # print "new node", counter, self.testblock_list[msg.name][counter][ + # resource] # , "ohne: ", self.testblock_list[msg.name][resource] + # self.requested_nodes[resource].remove(self.testblock_list[msg.name][counter][resource]) + # self.res_pipeline[resource].remove(self.testblock_list[msg.name][counter][resource]) + # # else: + # # for res in self.testblock_list[msg.name][counter][resource]: + # # self.requested_nodes[re].append(res) + # # if res not in self.res_pipeline[node]: + # # self.res_pipeline[node].append(res) + # print "requested nodes end:", self.requested_nodes + # counter += 1 + # for node in self.testblock_list[msg.name]: + # for res in self.testblock_list[msg.name][node]: + # self.requested_nodes[node].remove(res) + # if res not in self.requested_nodes[node]: + # self.res_pipeline[node].remove(res) + # if len(self.requested_nodes[node]) == 0: + # del self.requested_nodes[node] + # del self.res_pipeline[node] def create_testblock_list(self): testblock_list = {} + nodes = [] for testblock in self.test_config: + print "\n testblock:", testblock try: self.test_config[testblock]["resources"] except KeyError: continue else: for resource in self.test_config[testblock]["resources"]: + #print "resources:", resource try: testblock_list[testblock] except KeyError: testblock_list.update({testblock: {}}) - for node_name in self.test_config[testblock]["resources"][resource]: - - if node_name not in testblock_list[testblock]: - testblock_list[testblock].update({node_name: [resource]}) - elif resource not in testblock_list[testblock][node_name]: - testblock_list[testblock][node_name].append(resource) - + for node_name in resource: + #print "node name:", node_name, + nodes.append(resource) + testblock_list.update({testblock: nodes}) + print "\n testblock list:", testblock_list return testblock_list def collect_resource_data(self, event): pipeline = copy(self.res_pipeline) if not len(pipeline) == 0: msg = Resources() + msg_list = [] topic = self.topic_prefix + "resources" - - for node in pipeline: + for resource, node in pipeline.iteritems(): msg_data = NodeResources() - pid = self.pid_list[node] - - if pid is None: - continue - - try: - msg_data.node_name = node - - if "cpu" in pipeline[node]: - msg_data.cpu = psutil.Process(pid).cpu_percent(interval=self.timer_interval) - - if "mem" in pipeline[node]: - msg_data.memory = psutil.Process(pid).memory_percent() - - if "io" in pipeline[node]: - data = findall('\d+', str(psutil.Process(pid).io_counters())) - msg_data.io.read_count = int(data[0]) - msg_data.io.write_count = int(data[1]) - msg_data.io.read_bytes = int(data[2]) - msg_data.io.write_bytes = int(data[3]) - - if "network" in pipeline[node]: - data = findall('\d+', str(psutil.net_io_counters())) - msg_data.network.bytes_sent = int(data[0]) - msg_data.network.bytes_recv = int(data[1]) - msg_data.network.packets_sent = int(data[2]) - msg_data.network.packets_recv = int(data[3]) - msg_data.network.errin = int(data[4]) - msg_data.network.errout = int(data[5]) - msg_data.network.dropin = int(data[6]) - msg_data.network.dropout = int(data[7]) - - msg.nodes.append(msg_data) - except (psutil.NoSuchProcess, psutil.AccessDenied): - pass + print "pid list: ", self.pid_list, "pid", self.pid_list[resource] + for pid in self.pid_list[resource]: + + if pid is None: + continue + print "message node name:", node, "pipeline:", pipeline + try: + msg_data.node_name = node + + if "cpu" in pipeline: + msg_data.cpu = psutil.Process(pid).get_cpu_percent(interval=self.timer_interval) + + if "mem" in pipeline: + msg_data.memory = psutil.Process(pid).get_memory_percent() + + if "io" in pipeline: + data = findall('\d+', str(psutil.Process(pid).get_io_counters())) + msg_data.io.read_count = int(data[0]) + msg_data.io.write_count = int(data[1]) + msg_data.io.read_bytes = int(data[2]) + msg_data.io.write_bytes = int(data[3]) + + if "network" in pipeline: + data = findall('\d+', str(psutil.net_io_counters())) + msg_data.network.bytes_sent = int(data[0]) + msg_data.network.bytes_recv = int(data[1]) + msg_data.network.packets_sent = int(data[2]) + msg_data.network.packets_recv = int(data[3]) + msg_data.network.errin = int(data[4]) + msg_data.network.errout = int(data[5]) + msg_data.network.dropin = int(data[6]) + msg_data.network.dropout = int(data[7]) + + print "message data: ", msg_data + #msg.nodes.append(msg_data) + msg_list.append(copy(msg_data)) + except (psutil.NoSuchProcess, psutil.AccessDenied) as e: + print "collecting error: ", e + pass + print "--------------------------------------" + print "messages:", msg_list + print "--------------------------------------" + msg.nodes=msg_list[0] + print "msg:", msg.nodes self.BfW.write_to_bagfile(topic, msg, rospy.Time.from_sec(time.time())) def trigger_callback(self, msg): # Only save node resources if testblock requests them + print "trigger callback: msg \n", msg, " \n testblocks", self.testblock_list, "\n msg trigger:", msg.trigger if msg.name in self.testblock_list: self.update_requested_nodes(msg) - if msg.trigger.trigger == Trigger.ERROR: - self.res_pipeline = [] def create_pid_list(self): node_list = {} + pid_list = [] for (testblock, nodes) in self.testblock_list.iteritems(): for node in nodes: - if node not in node_list: - node_list[node] = self.get_pid(node) - + for resource, names in node.iteritems(): + #print "node: ", node,"resource", resource,"nodes: ", nodes, "node_list:", node_list + for name in names: + if self.get_pid(name) not in pid_list: + pid_list.append(self.get_pid(name)) + node_list.update({resource:pid_list}) + #print "node list", node_list return node_list @staticmethod From e803ae29c3603f87df70d59e3e4e5f0c86fc6cf9 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Sat, 11 Mar 2017 21:38:22 +0100 Subject: [PATCH 07/26] resources recorded --- .idea/workspace.xml | 138 ++++++------------ atf_core/src/atf_core/recorder.py | 1 - .../atf_recorder_plugins/plugin_resources.py | 94 ++++++------ 3 files changed, 91 insertions(+), 142 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 18e2a446..18b74ae4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,11 +2,7 @@ - - - - \ No newline at end of file diff --git a/atf_core/src/atf_core/recorder.py b/atf_core/src/atf_core/recorder.py index 22ff3e09..446ab65a 100644 --- a/atf_core/src/atf_core/recorder.py +++ b/atf_core/src/atf_core/recorder.py @@ -140,7 +140,6 @@ def record_trigger(self, trigger): raise ATFRecorderError("Testblock '%s' not in test config" % trigger.name) # Send message to all recorder plugins - print "self.recorder_plugin_list=", self.recorder_plugin_list, "\n trigger: ", trigger for recorder_plugin in self.recorder_plugin_list: recorder_plugin.trigger_callback(trigger) diff --git a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py index 04524551..31b46612 100755 --- a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py +++ b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py @@ -49,7 +49,7 @@ def update_requested_nodes(self, msg): # self.requested_nodes[re].append(res) # if res not in self.res_pipeline[node]: # self.res_pipeline[node].append(res) - print "requested nodes start:", self.requested_nodes + #print "requested nodes start:", self.requested_nodes counter += 1 elif msg.trigger == TestblockTrigger.STOP: @@ -86,7 +86,7 @@ def create_testblock_list(self): testblock_list = {} nodes = [] for testblock in self.test_config: - print "\n testblock:", testblock + #print "\n testblock:", testblock try: self.test_config[testblock]["resources"] except KeyError: @@ -103,7 +103,7 @@ def create_testblock_list(self): #print "node name:", node_name, nodes.append(resource) testblock_list.update({testblock: nodes}) - print "\n testblock list:", testblock_list + #print "\n testblock list:", testblock_list return testblock_list def collect_resource_data(self, event): @@ -112,54 +112,56 @@ def collect_resource_data(self, event): msg = Resources() msg_list = [] topic = self.topic_prefix + "resources" - for resource, node in pipeline.iteritems(): + for resource, nodes in pipeline.iteritems(): msg_data = NodeResources() print "pid list: ", self.pid_list, "pid", self.pid_list[resource] for pid in self.pid_list[resource]: if pid is None: continue - print "message node name:", node, "pipeline:", pipeline - try: - msg_data.node_name = node - - if "cpu" in pipeline: - msg_data.cpu = psutil.Process(pid).get_cpu_percent(interval=self.timer_interval) - - if "mem" in pipeline: - msg_data.memory = psutil.Process(pid).get_memory_percent() - - if "io" in pipeline: - data = findall('\d+', str(psutil.Process(pid).get_io_counters())) - msg_data.io.read_count = int(data[0]) - msg_data.io.write_count = int(data[1]) - msg_data.io.read_bytes = int(data[2]) - msg_data.io.write_bytes = int(data[3]) - - if "network" in pipeline: - data = findall('\d+', str(psutil.net_io_counters())) - msg_data.network.bytes_sent = int(data[0]) - msg_data.network.bytes_recv = int(data[1]) - msg_data.network.packets_sent = int(data[2]) - msg_data.network.packets_recv = int(data[3]) - msg_data.network.errin = int(data[4]) - msg_data.network.errout = int(data[5]) - msg_data.network.dropin = int(data[6]) - msg_data.network.dropout = int(data[7]) - - print "message data: ", msg_data - #msg.nodes.append(msg_data) - msg_list.append(copy(msg_data)) - except (psutil.NoSuchProcess, psutil.AccessDenied) as e: - print "collecting error: ", e - pass - print "--------------------------------------" - print "messages:", msg_list - print "--------------------------------------" - msg.nodes=msg_list[0] - print "msg:", msg.nodes - - self.BfW.write_to_bagfile(topic, msg, rospy.Time.from_sec(time.time())) + for node in nodes: + print "message node:", node, "resource:", resource, "\n pipeline:", pipeline + try: + msg_data.node_name = node + + if "cpu" in pipeline: + msg_data.cpu = psutil.Process(pid).get_cpu_percent(interval=self.timer_interval) + + if "mem" in pipeline: + msg_data.memory = psutil.Process(pid).get_memory_percent() + + if "io" in pipeline: + data = findall('\d+', str(psutil.Process(pid).get_io_counters())) + msg_data.io.read_count = int(data[0]) + msg_data.io.write_count = int(data[1]) + msg_data.io.read_bytes = int(data[2]) + msg_data.io.write_bytes = int(data[3]) + + if "network" in pipeline: + data = findall('\d+', str(psutil.net_io_counters())) + msg_data.network.bytes_sent = int(data[0]) + msg_data.network.bytes_recv = int(data[1]) + msg_data.network.packets_sent = int(data[2]) + msg_data.network.packets_recv = int(data[3]) + msg_data.network.errin = int(data[4]) + msg_data.network.errout = int(data[5]) + msg_data.network.dropin = int(data[6]) + msg_data.network.dropout = int(data[7]) + + #print "message data: ", msg_data + #msg.nodes.append(msg_data) + msg_list.append(copy(msg_data)) + print "message node name: \n", msg_data.node_name, "\n type:", type(msg_data.node_name) + except (psutil.NoSuchProcess, psutil.AccessDenied) as e: + print "collecting error: ", e + pass + # print "--------------------------------------" + # print "messages:", msg_list + # print "--------------------------------------" + msg.nodes=msg_list + #print "msg:", msg.nodes + + self.BfW.write_to_bagfile(topic, msg, rospy.Time.now()) def trigger_callback(self, msg): @@ -206,4 +208,4 @@ def get_pid(name): pass rospy.logerr("Node '" + name + "' is not running!") - return None + return None \ No newline at end of file From fe840710e173bcd8fadf9e6d22d554a1d0f3bac4 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Sat, 11 Mar 2017 23:22:28 +0100 Subject: [PATCH 08/26] resources analyzed --- .idea/workspace.xml | 171 +++++++++--------- atf_core/scripts/analyser.py | 4 +- atf_core/src/atf_core/configuration_parser.py | 9 +- .../src/atf_metrics/calculate_resources.py | 42 +++-- .../atf_recorder_plugins/plugin_resources.py | 2 +- 5 files changed, 121 insertions(+), 107 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 18b74ae4..f96b4a65 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,9 @@ - + + + \ No newline at end of file diff --git a/atf_core/scripts/analyser.py b/atf_core/scripts/analyser.py index a90635bd..562fb8b1 100755 --- a/atf_core/scripts/analyser.py +++ b/atf_core/scripts/analyser.py @@ -112,9 +112,9 @@ def get_result(self): else: #print "testblock.metrics=", testblock.metrics for metric_handle in testblock.metrics: - #print "metric_handle=", metric_handle + print "metric_handle=", metric_handle metric_result = metric_handle.get_result() - #print "metric_result=", metric_result + print "metric_result=", metric_result if metric_result is not False: (metric_name, data, groundtruth_result, groundtruth, groundtruth_epsilon, details) = metric_result if testblock_name not in result: diff --git a/atf_core/src/atf_core/configuration_parser.py b/atf_core/src/atf_core/configuration_parser.py index 3860270e..853ff560 100644 --- a/atf_core/src/atf_core/configuration_parser.py +++ b/atf_core/src/atf_core/configuration_parser.py @@ -29,7 +29,7 @@ def get_config(self): def create_testblocks(self, config, recorder_handle=None, create_metrics=False): testblocks = {} - print "create testblocks, config:", config["test_config"] + #print "create testblocks, config:", config["test_config"] for testblock_name in config["test_config"].keys(): metric_handles = [] if create_metrics: @@ -38,9 +38,10 @@ def create_testblocks(self, config, recorder_handle=None, create_metrics=False): metric_handlers_config = self.load_data(rospkg.RosPack().get_path("atf_metrics") + "/config/metrics.yaml") #print "metric_handlers_config=", metric_handlers_config for metric_name in metrics: - print "metric_name=", metric_name - metrics_return_list = getattr(atf_metrics, metric_handlers_config[metric_name]["handler"])().parse_parameter(testblock_name, metrics[metric_name]) - print "metrics_return_list=", metrics_return_list + #print "metric_name=", metric_name, "\n testblock", testblock_name + metrics_return_list = getattr(atf_metrics, metric_handlers_config[metric_name]["handler"])().\ + parse_parameter(testblock_name, metrics[metric_name]) + #print "metrics_return_list=", metrics_return_list, "\n type:", type(metrics_return_list) if type(metrics_return_list) == list: for metric_return in metrics_return_list: #print "metric_return=", metric_return diff --git a/atf_metrics/src/atf_metrics/calculate_resources.py b/atf_metrics/src/atf_metrics/calculate_resources.py index 2cb7a02e..76a7a093 100644 --- a/atf_metrics/src/atf_metrics/calculate_resources.py +++ b/atf_metrics/src/atf_metrics/calculate_resources.py @@ -12,14 +12,15 @@ def __init__(self): """ self.params = [] - def parse_parameter(self, params): + def parse_parameter(self, testblock_name, params): """ Method that returns the metric method with the given parameter. :param params: Parameter """ self.params = params - - metrics = CalculateResources(self.params) + print "params:",params + metrics = [] + metrics.append(CalculateResources(self.params)) return metrics @@ -42,34 +43,39 @@ def __init__(self, resources): self.finished = False # Sort resources after nodes - for resource in self.resources: - for node in self.resources[resource]: - if node not in self.node_data: - self.node_data[node] = {resource: {"data": [], "average": [], "min": [], "max": []}} - elif resource not in self.node_data[node]: - self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) - + #print "resources:", self.resources, "\n node data:", self.node_data + for dict in self.resources: + for resource, nodes in dict.iteritems(): + for node in nodes: + if node not in self.node_data: + print "node : ", node + self.node_data[node] = {resource: {"data": [], "average": [], "min": [], "max": []}} + elif resource not in self.node_data[node]: + self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) + #print "node data after:", self.node_data rospy.Subscriber("/atf/resources", Resources, self.process_resource_data, queue_size=1) - def start(self): + def start(self, timestamp): self.active = True - def stop(self): + def stop(self, timestamp): self.active = False self.finished = True - def pause(self): + def pause(self, timestamp): self.active = False - @staticmethod - def purge(): + #@staticmethod + def purge(self, timestamp): pass def process_resource_data(self, msg): + print "process data \n msg:", msg, "\n active", self.active if self.active: for node in msg.nodes: try: for resource in self.node_data[node.node_name]: + print "nodes:", msg.nodes, "\n node data:", self.node_data, "\n resource", resource if resource == "cpu": self.node_data[node.node_name][resource]["data"].append(round(node.cpu, 2)) elif resource == "mem": @@ -117,7 +123,9 @@ def get_result(self): self.node_data[node][res]["min"] = float(round(min(self.node_data[node][res]["data"]), 2)) self.node_data[node][res]["max"] = float(round(max(self.node_data[node][res]["data"]), 2)) del self.node_data[node][res]["data"] - - return "resources", self.node_data + groundtruth_result = True + self.groundtruth = 0.0 + self.groundtruth_epsilon = 0.0 + return "resources", self.node_data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, "*resources details*" else: return False diff --git a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py index 31b46612..d043ab26 100755 --- a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py +++ b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py @@ -13,7 +13,7 @@ class RecordResources: def __init__(self, write_lock, bag_file_writer): - self.topic_prefix = "" + self.topic_prefix = "atf/" file = "/home/fmw-hb/workshop_catkin_ws/src/msh_test/hannes_test_msh/config/test_configs/test2.yaml" with open(file, 'r') as stream: self.test_config = yaml.load(stream) From 8f4eee89cc93949f5d19fb77225c0cd2d3d97982 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Tue, 14 Mar 2017 14:18:15 +0100 Subject: [PATCH 09/26] added resources metric --- .idea/workspace.xml | 203 +++++-- atf_core/scripts/analyser.py | 4 +- atf_core/src/atf_core/recorder.py | 1 + .../src/atf_metrics/calculate_distance.py | 116 ---- .../src/atf_metrics/calculate_path_length.py | 1 + .../src/atf_metrics/calculate_resources.py | 70 ++- .../src/atf_metrics/check_localization.py | 100 --- .../html/js/atf_tools/test_compare.js | 574 ------------------ .../html/js/atf_tools/test_comparison.js | 344 ++++------- atf_presenter/html/js/atf_tools/test_list.js | 9 +- atf_presenter/scripts/presenter.py | 138 ----- .../atf_recorder_plugins/plugin_resources.py | 75 +-- hannes_test/CMakeLists.txt | 29 - hannes_test/config/robot_envs/env1.yaml | 2 - hannes_test/config/robots/part100_250mm.yaml | 12 - hannes_test/config/robots/part100_350mm.yaml | 12 - hannes_test/config/robots/part100_500mm.yaml | 12 - hannes_test/config/robots/part100_600mm.yaml | 12 - hannes_test/config/robots/part100_750mm.yaml | 12 - hannes_test/config/robots/part150_250mm.yaml | 12 - hannes_test/config/robots/part150_350mm.yaml | 12 - hannes_test/config/robots/part150_500mm.yaml | 12 - hannes_test/config/robots/part150_600mm.yaml | 12 - hannes_test/config/robots/part150_750mm.yaml | 12 - hannes_test/config/robots/part200_250mm.yaml | 12 - hannes_test/config/robots/part200_350mm.yaml | 12 - hannes_test/config/robots/part200_500mm.yaml | 12 - hannes_test/config/robots/part200_600mm.yaml | 12 - hannes_test/config/robots/part200_750mm.yaml | 12 - hannes_test/config/robots/part75_250mm.yaml | 12 - hannes_test/config/robots/part75_350mm.yaml | 12 - hannes_test/config/robots/part75_500mm.yaml | 12 - hannes_test/config/robots/part75_600mm.yaml | 12 - hannes_test/config/robots/part75_750mm.yaml | 12 - hannes_test/config/robots/robot1.yaml | 12 - hannes_test/config/robots/robot2.yaml | 7 - hannes_test/config/robots/robot3.yaml | 12 - hannes_test/config/test_configs/test1.yaml | 16 - hannes_test/config/test_configs/test2.yaml | 40 -- hannes_test/config/test_configs/test3.yaml | 11 - .../config/test_generation_config.yaml | 21 - hannes_test/config/test_suites.yaml | 28 - hannes_test/launch/all.launch | 6 - hannes_test/launch/application.launch | 42 -- hannes_test/package.xml | 22 - hannes_test/scripts/application.py | 89 --- 46 files changed, 371 insertions(+), 1841 deletions(-) delete mode 100644 atf_metrics/src/atf_metrics/calculate_distance.py delete mode 100644 atf_metrics/src/atf_metrics/check_localization.py delete mode 100644 atf_presenter/html/js/atf_tools/test_compare.js delete mode 100755 atf_presenter/scripts/presenter.py delete mode 100644 hannes_test/CMakeLists.txt delete mode 100644 hannes_test/config/robot_envs/env1.yaml delete mode 100644 hannes_test/config/robots/part100_250mm.yaml delete mode 100644 hannes_test/config/robots/part100_350mm.yaml delete mode 100644 hannes_test/config/robots/part100_500mm.yaml delete mode 100644 hannes_test/config/robots/part100_600mm.yaml delete mode 100644 hannes_test/config/robots/part100_750mm.yaml delete mode 100644 hannes_test/config/robots/part150_250mm.yaml delete mode 100644 hannes_test/config/robots/part150_350mm.yaml delete mode 100644 hannes_test/config/robots/part150_500mm.yaml delete mode 100644 hannes_test/config/robots/part150_600mm.yaml delete mode 100644 hannes_test/config/robots/part150_750mm.yaml delete mode 100644 hannes_test/config/robots/part200_250mm.yaml delete mode 100644 hannes_test/config/robots/part200_350mm.yaml delete mode 100644 hannes_test/config/robots/part200_500mm.yaml delete mode 100644 hannes_test/config/robots/part200_600mm.yaml delete mode 100644 hannes_test/config/robots/part200_750mm.yaml delete mode 100644 hannes_test/config/robots/part75_250mm.yaml delete mode 100644 hannes_test/config/robots/part75_350mm.yaml delete mode 100644 hannes_test/config/robots/part75_500mm.yaml delete mode 100644 hannes_test/config/robots/part75_600mm.yaml delete mode 100644 hannes_test/config/robots/part75_750mm.yaml delete mode 100644 hannes_test/config/robots/robot1.yaml delete mode 100644 hannes_test/config/robots/robot2.yaml delete mode 100644 hannes_test/config/robots/robot3.yaml delete mode 100644 hannes_test/config/test_configs/test1.yaml delete mode 100644 hannes_test/config/test_configs/test2.yaml delete mode 100644 hannes_test/config/test_configs/test3.yaml delete mode 100644 hannes_test/config/test_generation_config.yaml delete mode 100644 hannes_test/config/test_suites.yaml delete mode 100644 hannes_test/launch/all.launch delete mode 100644 hannes_test/launch/application.launch delete mode 100644 hannes_test/package.xml delete mode 100755 hannes_test/scripts/application.py diff --git a/.idea/workspace.xml b/.idea/workspace.xml index f96b4a65..9c6436d4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,8 +2,13 @@ + + + + - + + @@ -23,18 +28,41 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + @@ -42,6 +70,16 @@ + + + + + + + + + + @@ -52,11 +90,23 @@ + + + + + + + + + + + + - - + + @@ -65,8 +115,8 @@ - - + + @@ -109,6 +159,9 @@ create trigger_ bag + pid + nodes + prin print @@ -136,11 +189,12 @@ @@ -217,6 +271,38 @@ \ No newline at end of file diff --git a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py index 90a33972..b07902dd 100755 --- a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py +++ b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py @@ -42,8 +42,8 @@ def update_requested_nodes(self, msg): if name not in self.requested_nodes: print "new node", counter, self.testblock_list[msg.name][counter][resource]#, "ohne: ", self.testblock_list[msg.name][resource] self.requested_nodes[resource] = copy(self.testblock_list[msg.name][counter][resource]) - self.res_pipeline[resource] = copy(self.testblock_list[msg.name][counter][resource] - counter += 1 + self.res_pipeline[resource] = copy(self.testblock_list[msg.name][counter][resource]) + counter += 1 elif msg.trigger == TestblockTrigger.STOP: print "STOP Trigger" From acedbdb66a7d54227f629e73605c1e76d1f97241 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Sun, 19 Mar 2017 12:40:20 +0100 Subject: [PATCH 11/26] deleted .idea files --- .gitignore | 2 + .idea/atf.iml | 12 - .idea/inspectionProfiles/Project_Default.xml | 13 - .idea/misc.xml | 4 - .idea/modules.xml | 8 - .idea/vcs.xml | 6 - .idea/workspace.xml | 1023 ----------------- atf_core/src/atf_core/configuration_parser.py | 8 +- .../src/atf_metrics/calculate_path_length.py | 1 - .../src/atf_metrics/calculate_resources.py | 8 +- .../atf_recorder_plugins/plugin_resources.py | 20 +- 11 files changed, 21 insertions(+), 1084 deletions(-) delete mode 100644 .idea/atf.iml delete mode 100644 .idea/inspectionProfiles/Project_Default.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.gitignore b/.gitignore index 83d560ed..8840e9f0 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,5 @@ qtcreator-* # Catkin custom files CATKIN_IGNORE test_generated + +.idea/* diff --git a/.idea/atf.iml b/.idea/atf.iml deleted file mode 100644 index 6f63a63c..00000000 --- a/.idea/atf.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 3dc583b2..00000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 7b4d854c..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 3b4b9228..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index f43871a5..00000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,1023 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - calculat - dist - distance - cal - PathLength - robot_config_file - write_lock - bagf - self.test_config - test - [testblock]["resources"] - B - Trigger - collect_resource_data - trigger_callback - self.res_pi - testblock_list - stests - plt - create_testblock_list - testblock - trigger - create - trigger_ - bag - pid - nodes - prin - print - hin - - - CheckLocalization - ["resources"][testblock] - CPULoad - TestblockTrigger - numpy - tests - pyplot - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1487770023563 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/atf_core/src/atf_core/configuration_parser.py b/atf_core/src/atf_core/configuration_parser.py index 853ff560..e948d49f 100644 --- a/atf_core/src/atf_core/configuration_parser.py +++ b/atf_core/src/atf_core/configuration_parser.py @@ -29,7 +29,6 @@ def get_config(self): def create_testblocks(self, config, recorder_handle=None, create_metrics=False): testblocks = {} - #print "create testblocks, config:", config["test_config"] for testblock_name in config["test_config"].keys(): metric_handles = [] if create_metrics: @@ -38,10 +37,9 @@ def create_testblocks(self, config, recorder_handle=None, create_metrics=False): metric_handlers_config = self.load_data(rospkg.RosPack().get_path("atf_metrics") + "/config/metrics.yaml") #print "metric_handlers_config=", metric_handlers_config for metric_name in metrics: - #print "metric_name=", metric_name, "\n testblock", testblock_name - metrics_return_list = getattr(atf_metrics, metric_handlers_config[metric_name]["handler"])().\ - parse_parameter(testblock_name, metrics[metric_name]) - #print "metrics_return_list=", metrics_return_list, "\n type:", type(metrics_return_list) + #print "metric_name=", metric_name + metrics_return_list = getattr(atf_metrics, metric_handlers_config[metric_name]["handler"])().parse_parameter(testblock_name, metrics[metric_name]) + #print "metrics_return_list=", metrics_return_list if type(metrics_return_list) == list: for metric_return in metrics_return_list: #print "metric_return=", metric_return diff --git a/atf_metrics/src/atf_metrics/calculate_path_length.py b/atf_metrics/src/atf_metrics/calculate_path_length.py index 14af97ee..d8b4deb5 100644 --- a/atf_metrics/src/atf_metrics/calculate_path_length.py +++ b/atf_metrics/src/atf_metrics/calculate_path_length.py @@ -15,7 +15,6 @@ def parse_parameter(self, testblock_name, params): Method that returns the metric method with the given parameter. :param params: Parameter """ - print "pathlength params:", params metrics = [] if type(params) is not list: rospy.logerr("metric config not a list") diff --git a/atf_metrics/src/atf_metrics/calculate_resources.py b/atf_metrics/src/atf_metrics/calculate_resources.py index e76a6b5e..ceea20dd 100644 --- a/atf_metrics/src/atf_metrics/calculate_resources.py +++ b/atf_metrics/src/atf_metrics/calculate_resources.py @@ -18,6 +18,9 @@ def parse_parameter(self, testblock_name, params): Method that returns the metric method with the given parameter. :param params: Parameter """ + if not isinstance(params, list): + rospy.logerr("metric config not a list") + return False metrics = [] for metric in params: @@ -32,7 +35,7 @@ def parse_parameter(self, testblock_name, params): del metric['groundtruth_epsilon'] except (TypeError, KeyError): rospy.logwarn( - "No groundtruth parameters given, skipping groundtruth evaluation for metric 'path_length' in testblock '%s'", + "No groundtruth parameters given, skipping groundtruth evaluation for metric 'resources' in testblock '%s'", testblock_name) groundtruth = None groundtruth_epsilon = None @@ -124,6 +127,7 @@ def process_resource_data(self, msg): def get_result(self): groundtruth_result = None + details = None average_sum = 0.0 if self.finished: @@ -160,6 +164,6 @@ def get_result(self): groundtruth_result = False #print "node data: ", self.node_data, "\n groundthruth result", groundtruth_result, " \n .................................." - return "resources", self.node_data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, "*resources details*" + return "resources", self.node_data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details else: return False diff --git a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py index b07902dd..cd5d6d8f 100755 --- a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py +++ b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py @@ -35,21 +35,21 @@ def update_requested_nodes(self, msg): if msg.trigger == TestblockTrigger.START: print "START Trigger" for node in self.testblock_list[msg.name]: - for resource, names in node.iteritems(): - for name in names: - print "resource:", resource," name", name - if name not in self.requested_nodes: - print "new node", counter, self.testblock_list[msg.name][counter][resource]#, "ohne: ", self.testblock_list[msg.name][resource] - self.requested_nodes[resource] = copy(self.testblock_list[msg.name][counter][resource]) - self.res_pipeline[resource] = copy(self.testblock_list[msg.name][counter][resource]) + if not resource in self.requested_nodes: + self.requested_nodes.update({resource:[]}) + self.requested_nodes[resource].extend(copy(self.testblock_list[msg.name][counter][resource])) + + #print "requested nodes after:", self.requested_nodes," \n-----------------------------------------\n pipeline before:",self.res_pipeline, "resource: ", resource, "\n copy:", self.testblock_list[msg.name][counter][resource] + if not resource in self.res_pipeline: + self.res_pipeline.update({resource:[]}) + self.res_pipeline[resource].extend(copy(self.testblock_list[msg.name][counter][resource])) counter += 1 elif msg.trigger == TestblockTrigger.STOP: print "STOP Trigger" def create_testblock_list(self): - testblock_list = {} nodes = [] for testblock in self.test_config: @@ -93,7 +93,7 @@ def collect_resource_data(self, event): if pid is None: continue for node in nodes: - #print "message node:", node, "resource:", resource, "\n pipeline:", pipeline + print "message node:", node, "nodes: ", nodes, "resource:", resource, "\n pipeline:", pipeline try: msg_data.node_name = node @@ -121,7 +121,7 @@ def collect_resource_data(self, event): msg_data.network.dropin = int(data[6]) msg_data.network.dropout = int(data[7]) - #print "message data: ", msg_data + print "message data: ", msg_data msg_list.append(copy(msg_data)) #print "message node name: \n", msg_data.node_name, "\n type:", type(msg_data.node_name) except (psutil.NoSuchProcess, psutil.AccessDenied) as e: From 66d0efabafd53361aca5747e74a5ad1f86c9262b Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Mon, 20 Mar 2017 21:16:52 +0100 Subject: [PATCH 12/26] split resources --- atf_core/scripts/analyser.py | 6 +- atf_core/scripts/merger.py | 2 +- atf_core/src/atf_core/configuration_parser.py | 8 +- atf_metrics/config/metrics.yaml | 10 +- atf_metrics/src/atf_metrics/__init__.py | 5 +- .../src/atf_metrics/calculate_path_length.py | 1 + .../src/atf_metrics/calculate_resources.py | 2 +- .../config/recorder_plugins.yaml | 5 +- .../atf_recorder_plugins/plugin_resources.py | 181 +++++++++--------- 9 files changed, 115 insertions(+), 105 deletions(-) diff --git a/atf_core/scripts/analyser.py b/atf_core/scripts/analyser.py index a90635bd..aea761c2 100755 --- a/atf_core/scripts/analyser.py +++ b/atf_core/scripts/analyser.py @@ -110,11 +110,11 @@ def get_result(self): rospy.logerr("An error occured during analysis of testblock '%s', no useful results available.") result.update({testblock.testblock_name: {"status": "error"}}) else: - #print "testblock.metrics=", testblock.metrics + print "testblock.metrics=", testblock.metrics for metric_handle in testblock.metrics: - #print "metric_handle=", metric_handle + print "metric_handle=", metric_handle metric_result = metric_handle.get_result() - #print "metric_result=", metric_result + print "metric_result=", metric_result if metric_result is not False: (metric_name, data, groundtruth_result, groundtruth, groundtruth_epsilon, details) = metric_result if testblock_name not in result: diff --git a/atf_core/scripts/merger.py b/atf_core/scripts/merger.py index 7318e0db..007283e4 100755 --- a/atf_core/scripts/merger.py +++ b/atf_core/scripts/merger.py @@ -91,7 +91,7 @@ def merge(self): #print "metric_data_list=", metric_data_list for i in range(len(metric_data_list)): #print "i=", i - #print "test_data_merged[testblock_name][metric_name][i]['data']['values']=", test_data_merged[testblock_name][metric_name][i]['data']['values'] + print "test_data_merged[testblock_name][metric_name][i]['data']['values']=", test_data_merged[testblock_name][metric_name][i]['data']['values'] test_data_merged[testblock_name][metric_name][i]['data']['min'] = min(test_data_merged[testblock_name][metric_name][i]['data']['values']) test_data_merged[testblock_name][metric_name][i]['data']['max'] = max(test_data_merged[testblock_name][metric_name][i]['data']['values']) test_data_merged[testblock_name][metric_name][i]['data']['average'] = round(sum(test_data_merged[testblock_name][metric_name][i]['data']['values'])/len(test_data_merged[testblock_name][metric_name][i]['data']['values']), 3) diff --git a/atf_core/src/atf_core/configuration_parser.py b/atf_core/src/atf_core/configuration_parser.py index e948d49f..5d050684 100644 --- a/atf_core/src/atf_core/configuration_parser.py +++ b/atf_core/src/atf_core/configuration_parser.py @@ -33,13 +33,13 @@ def create_testblocks(self, config, recorder_handle=None, create_metrics=False): metric_handles = [] if create_metrics: metrics = config["test_config"][testblock_name] - #print "metrics=", metrics + print "metrics=", metrics metric_handlers_config = self.load_data(rospkg.RosPack().get_path("atf_metrics") + "/config/metrics.yaml") - #print "metric_handlers_config=", metric_handlers_config + print "metric_handlers_config=", metric_handlers_config for metric_name in metrics: - #print "metric_name=", metric_name + print "metric_name=", metric_name metrics_return_list = getattr(atf_metrics, metric_handlers_config[metric_name]["handler"])().parse_parameter(testblock_name, metrics[metric_name]) - #print "metrics_return_list=", metrics_return_list + print "metrics_return_list=", metrics_return_list if type(metrics_return_list) == list: for metric_return in metrics_return_list: #print "metric_return=", metric_return diff --git a/atf_metrics/config/metrics.yaml b/atf_metrics/config/metrics.yaml index 0eb8afb6..0e2a0af9 100644 --- a/atf_metrics/config/metrics.yaml +++ b/atf_metrics/config/metrics.yaml @@ -2,8 +2,14 @@ time: handler: CalculateTimeParamHandler path_length: handler: CalculatePathLengthParamHandler -resources: - handler: CalculateResourcesParamHandler +resource_cpu: + handler: CalculateResourcesCpuParamHandler +resource_mem: + handler: CalculateResourcesMemParamHandler +resource_io: + handler: CalculateResourcesIOParamHandler +resource_network: + handler: CalculateResourcesNetworkParamHandler obstacle_distance: handler: CalculateDistanceToObstaclesParamHandler publish_rate: diff --git a/atf_metrics/src/atf_metrics/__init__.py b/atf_metrics/src/atf_metrics/__init__.py index ad617882..08555650 100644 --- a/atf_metrics/src/atf_metrics/__init__.py +++ b/atf_metrics/src/atf_metrics/__init__.py @@ -1,6 +1,9 @@ from atf_metrics.calculate_path_length import CalculatePathLength, CalculatePathLengthParamHandler from atf_metrics.calculate_time import CalculateTime, CalculateTimeParamHandler -from atf_metrics.calculate_resources import CalculateResources, CalculateResourcesParamHandler +from atf_metrics.calculate_resources_cpu import CalculateResourcesCpu, CalculateResourcesCpuParamHandler +from atf_metrics.calculate_resources_mem import CalculateResourcesMem, CalculateResourcesMemParamHandler +from atf_metrics.calculate_resources_io import CalculateResourcesIO, CalculateResourcesIOParamHandler +from atf_metrics.calculate_resources_network import CalculateResourcesNetwork, CalculateResourcesNetworkParamHandler from atf_metrics.calculate_distance_to_obstacles import CalculateDistanceToObstacles, CalculateDistanceToObstaclesParamHandler from atf_metrics.calculate_publish_rate import CalculatePublishRate, CalculatePublishRateParamHandler from atf_metrics.calculate_interface import CalculateInterface, CalculateInterfaceParamHandler diff --git a/atf_metrics/src/atf_metrics/calculate_path_length.py b/atf_metrics/src/atf_metrics/calculate_path_length.py index d8b4deb5..51c0ec98 100644 --- a/atf_metrics/src/atf_metrics/calculate_path_length.py +++ b/atf_metrics/src/atf_metrics/calculate_path_length.py @@ -109,6 +109,7 @@ def get_result(self): groundtruth_result = True else: groundtruth_result = False + print "path length data: ", data return "path_length", data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details else: return False diff --git a/atf_metrics/src/atf_metrics/calculate_resources.py b/atf_metrics/src/atf_metrics/calculate_resources.py index ceea20dd..537cfaf1 100644 --- a/atf_metrics/src/atf_metrics/calculate_resources.py +++ b/atf_metrics/src/atf_metrics/calculate_resources.py @@ -163,7 +163,7 @@ def get_result(self): else: groundtruth_result = False - #print "node data: ", self.node_data, "\n groundthruth result", groundtruth_result, " \n .................................." + #print "resources data: ", self.node_data, "\n groundthruth result", groundtruth_result, " \n .................................." return "resources", self.node_data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details else: return False diff --git a/atf_recorder_plugins/config/recorder_plugins.yaml b/atf_recorder_plugins/config/recorder_plugins.yaml index 1b2ac1da..dd2e1b7a 100644 --- a/atf_recorder_plugins/config/recorder_plugins.yaml +++ b/atf_recorder_plugins/config/recorder_plugins.yaml @@ -1,4 +1,7 @@ -resources: RecordResources +resources_cpu: RecordResources +resource_mem: RecordResources +resource_io: RecordResources +resource_network: RecordResources interface: RecordInterface #obstacle_distance: RecordObstacleDistance # example: Example diff --git a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py index cd5d6d8f..b4f8b1c1 100755 --- a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py +++ b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py @@ -6,7 +6,7 @@ import rosnode import yaml -from copy import copy +from copy import copy, deepcopy from re import findall from subprocess import check_output, CalledProcessError from atf_msgs.msg import NodeResources, Resources, IO, Network, TestblockTrigger @@ -23,7 +23,7 @@ def __init__(self, write_lock, bag_file_writer): self.testblock_list = self.create_testblock_list() self.pid_list = self.create_pid_list() - self.requested_nodes = {} + self.requested_nodes = [] self.res_pipeline = {} self.BfW = bag_file_writer @@ -32,18 +32,18 @@ def __init__(self, write_lock, bag_file_writer): def update_requested_nodes(self, msg): counter = 0 + requested_nodes = [] if msg.trigger == TestblockTrigger.START: print "START Trigger" + for node in self.testblock_list[msg.name]: - for resource, names in node.iteritems(): - if not resource in self.requested_nodes: - self.requested_nodes.update({resource:[]}) - self.requested_nodes[resource].extend(copy(self.testblock_list[msg.name][counter][resource])) - - #print "requested nodes after:", self.requested_nodes," \n-----------------------------------------\n pipeline before:",self.res_pipeline, "resource: ", resource, "\n copy:", self.testblock_list[msg.name][counter][resource] - if not resource in self.res_pipeline: - self.res_pipeline.update({resource:[]}) - self.res_pipeline[resource].extend(copy(self.testblock_list[msg.name][counter][resource])) + print "node:", node + if not node in requested_nodes: + requested_nodes.append(node) + #self.res_pipeline[resource].extend(node_name) + self.requested_nodes = deepcopy(requested_nodes) + #print "requested nodes:", self.requested_nodes + #print "res pipeline:", self.res_pipeline counter += 1 elif msg.trigger == TestblockTrigger.STOP: @@ -51,85 +51,81 @@ def update_requested_nodes(self, msg): def create_testblock_list(self): testblock_list = {} - nodes = [] + node_list = [] + counter = 0 + print "testconfig: ", self.test_config for testblock in self.test_config: - #print "\n testblock:", testblock + #print "testblock:", testblock, "\n tests:", self.test_config[testblock] try: - self.test_config[testblock]["resources"] + self.test_config[testblock] except KeyError: + rospy.logerr("No nodes for resources to record") continue else: - for resource in self.test_config[testblock]["resources"]: - #print "resources:", resource - try: - testblock_list[testblock] - except KeyError: - testblock_list.update({testblock: {}}) - - if 'groundtruth' in resource: - del resource['groundtruth'] - if 'groundtruth_epsilon' in resource: - del resource['groundtruth_epsilon'] - - for node_name in resource: - nodes.append(resource) - #print "node", node_name, "appended", nodes - - testblock_list.update({testblock: nodes}) - #print "\n testblock list:", testblock_list + for resource, nodes in self.test_config[testblock].iteritems(): + if str(resource).__contains__("resource"): + #print "resources:", resource, "nodes:", nodes[counter]["nodes"] + node_list.extend(nodes[counter]["nodes"]) + + # if 'groundtruth' in resource: + # del resource['groundtruth'] + # if 'groundtruth_epsilon' in resource: + # del resource['groundtruth_epsilon'] + counter += 1 + try: + testblock_list[testblock] + except KeyError: + testblock_list.update({testblock: []}) + #print "node list:", node_list + testblock_list.update({testblock: node_list}) + #print "--------------------------\n testblock list:", testblock_list return testblock_list def collect_resource_data(self, event): - pipeline = copy(self.res_pipeline) - if not len(pipeline) == 0: - msg = Resources() - msg_list = [] - topic = self.topic_prefix + "resources" - for resource, nodes in pipeline.iteritems(): - msg_data = NodeResources() - #print "pid list: ", self.pid_list, "pid", self.pid_list[resource] - for pid in self.pid_list[resource]: - - if pid is None: - continue - for node in nodes: - print "message node:", node, "nodes: ", nodes, "resource:", resource, "\n pipeline:", pipeline - try: - msg_data.node_name = node - - if "cpu" in pipeline: - msg_data.cpu = psutil.Process(pid).get_cpu_percent(interval=self.timer_interval) - - if "mem" in pipeline: - msg_data.memory = psutil.Process(pid).get_memory_percent() - - if "io" in pipeline: - data = findall('\d+', str(psutil.Process(pid).get_io_counters())) - msg_data.io.read_count = int(data[0]) - msg_data.io.write_count = int(data[1]) - msg_data.io.read_bytes = int(data[2]) - msg_data.io.write_bytes = int(data[3]) - - if "network" in pipeline: - data = findall('\d+', str(psutil.net_io_counters())) - msg_data.network.bytes_sent = int(data[0]) - msg_data.network.bytes_recv = int(data[1]) - msg_data.network.packets_sent = int(data[2]) - msg_data.network.packets_recv = int(data[3]) - msg_data.network.errin = int(data[4]) - msg_data.network.errout = int(data[5]) - msg_data.network.dropin = int(data[6]) - msg_data.network.dropout = int(data[7]) - - print "message data: ", msg_data - msg_list.append(copy(msg_data)) - #print "message node name: \n", msg_data.node_name, "\n type:", type(msg_data.node_name) - except (psutil.NoSuchProcess, psutil.AccessDenied) as e: - rospy.logerr("collecting error: %s", e) - pass - msg.nodes=msg_list - - self.BfW.write_to_bagfile(topic, msg, rospy.Time.now()) + msg = Resources() + msg_list = [] + topic = self.topic_prefix + "resources" + #for resource, nodes in pipeline.iteritems(): + msg_data = NodeResources() + #print "pid list: ", self.pid_list#, "pid", self.pid_list[resource] + for node, pid in self.pid_list.iteritems(): + if pid is None: + continue + #print "requested nodes: ", self.requested_nodes + #print "message node:", node, "pid:", pid + try: + msg_data.node_name = node + print "node:", node, "pid:", pid + + msg_data.cpu = psutil.Process(pid).get_cpu_percent(interval=self.timer_interval) + + msg_data.memory = psutil.Process(pid).get_memory_percent() + + data = findall('\d+', str(psutil.Process(pid).get_io_counters())) + msg_data.io.read_count = int(data[0]) + msg_data.io.write_count = int(data[1]) + msg_data.io.read_bytes = int(data[2]) + msg_data.io.write_bytes = int(data[3]) + + data = findall('\d+', str(psutil.net_io_counters())) + msg_data.network.bytes_sent = int(data[0]) + msg_data.network.bytes_recv = int(data[1]) + msg_data.network.packets_sent = int(data[2]) + msg_data.network.packets_recv = int(data[3]) + msg_data.network.errin = int(data[4]) + msg_data.network.errout = int(data[5]) + msg_data.network.dropin = int(data[6]) + msg_data.network.dropout = int(data[7]) + + #print "message data: ", msg_data + msg_list.append(copy(msg_data)) + #print "message list: ", msg_list + except (psutil.NoSuchProcess, psutil.AccessDenied) as e: + rospy.logerr("collecting error: %s", e) + pass + msg.nodes = msg_list + #print "resource msg:", msg + self.BfW.write_to_bagfile(topic, msg, rospy.Time.now()) def trigger_callback(self, msg): @@ -141,18 +137,19 @@ def trigger_callback(self, msg): def create_pid_list(self): node_list = {} - pid_list = [] + pid_list = {} for (testblock, nodes) in self.testblock_list.iteritems(): for node in nodes: - for resource, names in node.iteritems(): - print "node: ", node,"resource", resource,"nodes: ", nodes, "node_list:", node_list, "\n names:", names - if isinstance(names, list): - for name in names: - if self.get_pid(name) not in pid_list: - pid_list.append(self.get_pid(name)) - node_list.update({resource:pid_list}) - #print "node list", node_list - return node_list + #for resource, names in node.iteritems(): + #print "node: ", node,"nodes: ", nodes, "node_list:", node_list + #if isinstance(names, list): + # for name in names: + if self.get_pid(node) not in pid_list: + pid_list.update({node:self.get_pid(node)}) + print "pid", self.get_pid(node), "for node", node + #node_list.update({resource:pid_list}) + #print "pid list", pid_list + return pid_list @staticmethod def get_pid(name): From 9ba6218f40c4978bdcb4695cd46667c86b516682 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Mon, 20 Mar 2017 21:18:01 +0100 Subject: [PATCH 13/26] split calculate resources --- .../atf_metrics/calculate_resources_cpu.py | 141 +++++++++++++++ .../src/atf_metrics/calculate_resources_io.py | 169 ++++++++++++++++++ .../atf_metrics/calculate_resources_mem.py | 169 ++++++++++++++++++ .../calculate_resources_network.py | 157 ++++++++++++++++ 4 files changed, 636 insertions(+) create mode 100644 atf_metrics/src/atf_metrics/calculate_resources_cpu.py create mode 100644 atf_metrics/src/atf_metrics/calculate_resources_io.py create mode 100644 atf_metrics/src/atf_metrics/calculate_resources_mem.py create mode 100644 atf_metrics/src/atf_metrics/calculate_resources_network.py diff --git a/atf_metrics/src/atf_metrics/calculate_resources_cpu.py b/atf_metrics/src/atf_metrics/calculate_resources_cpu.py new file mode 100644 index 00000000..6e73c684 --- /dev/null +++ b/atf_metrics/src/atf_metrics/calculate_resources_cpu.py @@ -0,0 +1,141 @@ +#!/usr/bin/env python +import numpy +import rospy +import math + +from atf_msgs.msg import Resources, IO, Network + + +class CalculateResourcesCpuParamHandler: + def __init__(self): + """ + Class for returning the corresponding metric class with the given parameter. + """ + self.params = [] + + def parse_parameter(self, testblock_name, params): + """ + Method that returns the metric method with the given parameter. + :param params: Parameter + """ + if not isinstance(params, list): + rospy.logerr("metric config not a list") + return False + metrics = [] + print "params:", params + for metric in params: + # check for optional parameters + try: + groundtruth = metric["groundtruth"] + groundtruth_epsilon = metric["groundtruth_epsilon"] + print "groundtruth", groundtruth, "groundtruth_epsilon", groundtruth_epsilon + if 'groundtruth' in metric: + del metric['groundtruth'] + if 'groundtruth_epsilon' in metric: + del metric['groundtruth_epsilon'] + except (TypeError, KeyError): + rospy.logwarn( + "No groundtruth parameters given, skipping groundtruth evaluation for metric 'resources' in testblock '%s'", + testblock_name) + groundtruth = None + groundtruth_epsilon = None + print "metric:", metric + metrics.append(CalculateResourcesCpu(metric["nodes"], groundtruth, groundtruth_epsilon)) + return metrics + + +class CalculateResourcesCpu: + def __init__(self, nodes, groundtruth, groundtruth_epsilon): + """ + Class for calculating the average resource workload and writing the current resource data. + The resource data is sent over the topic "/testing/Resources". + :param resources: a dictionary containing the names of the resources and a list with the names of the nodes. + Example: {"cpu":[move_group], "mem": [move_group]} + :type resources: dict + """ + + self.active = False + self.resource = "cpu" + self.groundtruth = groundtruth + self.groundtruth_epsilon = groundtruth_epsilon + self.node_data = {} + self.size_io = len(IO.__slots__) + self.size_network = len(Network.__slots__) + self.finished = False + + # Sort resources after nodes + print "node data:", self.node_data + for node in nodes: + if node not in self.node_data: + print "node : ", node + self.node_data[node] = {self.resource: {"data": [], "average": [], "min": [], "max": []}} + # elif resource not in self.node_data[node]: + # self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) + print "node data after:", self.node_data + rospy.Subscriber("/atf/resources", Resources, self.process_resource_data, queue_size=1) + + def start(self, timestamp): + self.active = True + + def stop(self, timestamp): + self.active = False + self.finished = True + + def pause(self, timestamp): + self.active = False + + def purge(self, timestamp): + pass + + def process_resource_data(self, msg): + #print "--------------------------------------\nprocess data \n msg:", msg, "\n active", self.active + if self.active: + for node in msg.nodes: + try: + for resource in self.node_data[node.node_name]: + #print "nodes:", msg.nodes, "\n node data:", self.node_data, "\n resource", resource + if resource == "cpu": + self.node_data[node.node_name][resource]["data"].append(round(node.cpu, 2)) + except KeyError: + pass + + def get_result(self): + groundtruth_result = None + details = {"nodes":{}} + average_sum = 0.0 + + if self.finished: + #print "----------------------------- \n node data:", self.node_data + for node in self.node_data: + #print " node:", node + for res in self.node_data[node]: + #print "res", res + if len(self.node_data[node][res]["data"]) != 0: + self.node_data[node][res]["average"] = float(round(numpy.mean(self.node_data[node][res] + ["data"]), 2)) + self.node_data[node][res]["min"] = float(round(min(self.node_data[node][res]["data"]), 2)) + self.node_data[node][res]["max"] = float(round(max(self.node_data[node][res]["data"]), 2)) + average_sum += float(round(numpy.mean(self.node_data[node][res]["data"]), 2)) + print "average sum:", average_sum + del self.node_data[node][res]["data"] + + details["nodes"].update({node:[]}) + details["nodes"][node].append({"max":self.node_data[node][res]["max"]}) + details["nodes"][node].append({"average":self.node_data[node][res]["average"]}) + details["nodes"][node].append({"min":self.node_data[node][res]["min"]}) + + + #print "groundtruthes:", self.groundtruth, self.groundtruth_epsilon, "\n average:", self.node_data[node][res]["average"] + if self.groundtruth != None and self.groundtruth_epsilon != None: + for node in self.node_data: + + #print "average sum:check", average_sum + if math.fabs(self.groundtruth - average_sum) <= self.groundtruth_epsilon: + groundtruth_result = True + else: + groundtruth_result = False + + print "resources cpu data: ", average_sum, "\n groundthruth result", groundtruth_result, "details:", details, " \n .................................." + return "resources_cpu", round(average_sum, 3), groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details + else: + return False diff --git a/atf_metrics/src/atf_metrics/calculate_resources_io.py b/atf_metrics/src/atf_metrics/calculate_resources_io.py new file mode 100644 index 00000000..697021bd --- /dev/null +++ b/atf_metrics/src/atf_metrics/calculate_resources_io.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python +import numpy +import rospy +import math + +from atf_msgs.msg import Resources, IO, Network + + +class CalculateResourcesIOParamHandler: + def __init__(self): + """ + Class for returning the corresponding metric class with the given parameter. + """ + self.params = [] + + def parse_parameter(self, testblock_name, params): + """ + Method that returns the metric method with the given parameter. + :param params: Parameter + """ + if not isinstance(params, list): + rospy.logerr("metric config not a list") + return False + metrics = [] + + for metric in params: + # check for optional parameters + try: + groundtruth = metric["groundtruth"] + groundtruth_epsilon = metric["groundtruth_epsilon"] + #print "groundtruth", groundtruth, "groundtruth_epsilon", groundtruth_epsilon + if 'groundtruth' in metric: + del metric['groundtruth'] + if 'groundtruth_epsilon' in metric: + del metric['groundtruth_epsilon'] + except (TypeError, KeyError): + rospy.logwarn( + "No groundtruth parameters given, skipping groundtruth evaluation for metric 'resources' in testblock '%s'", + testblock_name) + groundtruth = None + groundtruth_epsilon = None + metrics.append(CalculateResourcesIO(metric, groundtruth, groundtruth_epsilon)) + return metrics + + +class CalculateResourcesIO: + def __init__(self, resources, groundtruth, groundtruth_epsilon): + """ + Class for calculating the average resource workload and writing the current resource data. + The resource data is sent over the topic "/testing/Resources". + :param resources: a dictionary containing the names of the resources and a list with the names of the nodes. + Example: {"cpu":[move_group], "mem": [move_group]} + :type resources: dict + """ + + self.active = False + self.resources = resources + self.groundtruth = groundtruth + self.groundtruth_epsilon = groundtruth_epsilon + self.node_data = {} + self.size_io = len(IO.__slots__) + self.size_network = len(Network.__slots__) + self.finished = False + + # Sort resources after nodes + #print "resources:", self.resources, "\n node data:", self.node_data + for resource, nodes in self.resources.iteritems(): + for node in nodes: + if node not in self.node_data: + #print "node : ", node + self.node_data[node] = {resource: {"data": [], "average": [], "min": [], "max": []}} + elif resource not in self.node_data[node]: + self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) + #print "node data after:", self.node_data + rospy.Subscriber("/atf/resources", Resources, self.process_resource_data, queue_size=1) + + def start(self, timestamp): + self.active = True + + def stop(self, timestamp): + self.active = False + self.finished = True + + def pause(self, timestamp): + self.active = False + + def purge(self, timestamp): + pass + + def process_resource_data(self, msg): + #print "process data \n msg:", msg, "\n active", self.active + if self.active: + for node in msg.nodes: + try: + for resource in self.node_data[node.node_name]: + #print "nodes:", msg.nodes, "\n node data:", self.node_data, "\n resource", resource + if resource == "cpu": + self.node_data[node.node_name][resource]["data"].append(round(node.cpu, 2)) + elif resource == "mem": + self.node_data[node.node_name][resource]["data"].append(round(node.memory, 2)) + elif resource == "io": + if len(self.node_data[node.node_name][resource]["data"]) == 0: + for i in xrange(0, self.size_io): + self.node_data[node.node_name][resource]["data"].append([]) + self.node_data[node.node_name][resource]["data"][0].append(round(node.io.read_count, 2)) + self.node_data[node.node_name][resource]["data"][1].append(round(node.io.write_count, 2)) + self.node_data[node.node_name][resource]["data"][2].append(round(node.io.read_bytes, 2)) + self.node_data[node.node_name][resource]["data"][3].append(round(node.io.write_bytes, 2)) + elif resource == "network": + if len(self.node_data[node.node_name][resource]["data"]) == 0: + for i in xrange(0, self.size_network): + self.node_data[node.node_name][resource]["data"].append([]) + self.node_data[node.node_name][resource]["data"][0].append(round(node.network.bytes_sent, + 2)) + self.node_data[node.node_name][resource]["data"][1].append(round(node.network.bytes_recv, + 2)) + self.node_data[node.node_name][resource]["data"][2].append(round(node.network.packets_sent, + 2)) + self.node_data[node.node_name][resource]["data"][3].append(round(node.network.packets_recv, + 2)) + self.node_data[node.node_name][resource]["data"][4].append(round(node.network.errin, 2)) + self.node_data[node.node_name][resource]["data"][5].append(round(node.network.errout, 2)) + self.node_data[node.node_name][resource]["data"][6].append(round(node.network.dropin, 2)) + self.node_data[node.node_name][resource]["data"][7].append(round(node.network.dropout, 2)) + except KeyError: + pass + + def get_result(self): + groundtruth_result = None + details = None + average_sum = 0.0 + + if self.finished: + #print "----------------------------- \n node data:", self.node_data + for node in self.node_data: + #print " node:", node + for res in self.node_data[node]: + #print "res", res + if len(self.node_data[node][res]["data"]) != 0: + if res == "io" or res == "network": + for values in self.node_data[node][res]["data"]: + self.node_data[node][res]["average"].append(float(round(numpy.mean(values), 2))) + self.node_data[node][res]["min"].append(float(round(min(values), 2))) + self.node_data[node][res]["max"].append(float(round(max(values), 2))) + average_sum += float(round(numpy.mean(values), 2)) + #print "average sum:", average_sum + else: + self.node_data[node][res]["average"] = float(round(numpy.mean(self.node_data[node][res] + ["data"]), 2)) + self.node_data[node][res]["min"] = float(round(min(self.node_data[node][res]["data"]), 2)) + self.node_data[node][res]["max"] = float(round(max(self.node_data[node][res]["data"]), 2)) + average_sum += float(round(numpy.mean(self.node_data[node][res]["data"]), 2)) + #print "average sum:", average_sum + del self.node_data[node][res]["data"] + + #print "groundtruthes:", self.groundtruth, self.groundtruth_epsilon, "\n average:", self.node_data[node][res]["average"] + if self.groundtruth != None and self.groundtruth_epsilon != None: + for node in self.node_data: + + #print "average sum:check", average_sum + if math.fabs(self.groundtruth - average_sum) <= self.groundtruth_epsilon: + groundtruth_result = True + else: + groundtruth_result = False + + print "resources io data: ", self.node_data, "\n groundthruth result", groundtruth_result, " \n .................................." + return "resources_io", self.node_data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details + else: + return False diff --git a/atf_metrics/src/atf_metrics/calculate_resources_mem.py b/atf_metrics/src/atf_metrics/calculate_resources_mem.py new file mode 100644 index 00000000..5cd7915a --- /dev/null +++ b/atf_metrics/src/atf_metrics/calculate_resources_mem.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python +import numpy +import rospy +import math + +from atf_msgs.msg import Resources, IO, Network + + +class CalculateResourcesMemParamHandler: + def __init__(self): + """ + Class for returning the corresponding metric class with the given parameter. + """ + self.params = [] + + def parse_parameter(self, testblock_name, params): + """ + Method that returns the metric method with the given parameter. + :param params: Parameter + """ + if not isinstance(params, list): + rospy.logerr("metric config not a list") + return False + metrics = [] + + for metric in params: + # check for optional parameters + try: + groundtruth = metric["groundtruth"] + groundtruth_epsilon = metric["groundtruth_epsilon"] + #print "groundtruth", groundtruth, "groundtruth_epsilon", groundtruth_epsilon + if 'groundtruth' in metric: + del metric['groundtruth'] + if 'groundtruth_epsilon' in metric: + del metric['groundtruth_epsilon'] + except (TypeError, KeyError): + rospy.logwarn( + "No groundtruth parameters given, skipping groundtruth evaluation for metric 'resources' in testblock '%s'", + testblock_name) + groundtruth = None + groundtruth_epsilon = None + metrics.append(CalculateResourcesMem(metric, groundtruth, groundtruth_epsilon)) + return metrics + + +class CalculateResourcesMem: + def __init__(self, resources, groundtruth, groundtruth_epsilon): + """ + Class for calculating the average resource workload and writing the current resource data. + The resource data is sent over the topic "/testing/Resources". + :param resources: a dictionary containing the names of the resources and a list with the names of the nodes. + Example: {"cpu":[move_group], "mem": [move_group]} + :type resources: dict + """ + + self.active = False + self.resources = resources + self.groundtruth = groundtruth + self.groundtruth_epsilon = groundtruth_epsilon + self.node_data = {} + self.size_io = len(IO.__slots__) + self.size_network = len(Network.__slots__) + self.finished = False + + # Sort resources after nodes + #print "resources:", self.resources, "\n node data:", self.node_data + for resource, nodes in self.resources.iteritems(): + for node in nodes: + if node not in self.node_data: + #print "node : ", node + self.node_data[node] = {resource: {"data": [], "average": [], "min": [], "max": []}} + elif resource not in self.node_data[node]: + self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) + #print "node data after:", self.node_data + rospy.Subscriber("/atf/resources", Resources, self.process_resource_data, queue_size=1) + + def start(self, timestamp): + self.active = True + + def stop(self, timestamp): + self.active = False + self.finished = True + + def pause(self, timestamp): + self.active = False + + def purge(self, timestamp): + pass + + def process_resource_data(self, msg): + #print "process data \n msg:", msg, "\n active", self.active + if self.active: + for node in msg.nodes: + try: + for resource in self.node_data[node.node_name]: + #print "nodes:", msg.nodes, "\n node data:", self.node_data, "\n resource", resource + if resource == "cpu": + self.node_data[node.node_name][resource]["data"].append(round(node.cpu, 2)) + elif resource == "mem": + self.node_data[node.node_name][resource]["data"].append(round(node.memory, 2)) + elif resource == "io": + if len(self.node_data[node.node_name][resource]["data"]) == 0: + for i in xrange(0, self.size_io): + self.node_data[node.node_name][resource]["data"].append([]) + self.node_data[node.node_name][resource]["data"][0].append(round(node.io.read_count, 2)) + self.node_data[node.node_name][resource]["data"][1].append(round(node.io.write_count, 2)) + self.node_data[node.node_name][resource]["data"][2].append(round(node.io.read_bytes, 2)) + self.node_data[node.node_name][resource]["data"][3].append(round(node.io.write_bytes, 2)) + elif resource == "network": + if len(self.node_data[node.node_name][resource]["data"]) == 0: + for i in xrange(0, self.size_network): + self.node_data[node.node_name][resource]["data"].append([]) + self.node_data[node.node_name][resource]["data"][0].append(round(node.network.bytes_sent, + 2)) + self.node_data[node.node_name][resource]["data"][1].append(round(node.network.bytes_recv, + 2)) + self.node_data[node.node_name][resource]["data"][2].append(round(node.network.packets_sent, + 2)) + self.node_data[node.node_name][resource]["data"][3].append(round(node.network.packets_recv, + 2)) + self.node_data[node.node_name][resource]["data"][4].append(round(node.network.errin, 2)) + self.node_data[node.node_name][resource]["data"][5].append(round(node.network.errout, 2)) + self.node_data[node.node_name][resource]["data"][6].append(round(node.network.dropin, 2)) + self.node_data[node.node_name][resource]["data"][7].append(round(node.network.dropout, 2)) + except KeyError: + pass + + def get_result(self): + groundtruth_result = None + details = None + average_sum = 0.0 + + if self.finished: + #print "----------------------------- \n node data:", self.node_data + for node in self.node_data: + #print " node:", node + for res in self.node_data[node]: + #print "res", res + if len(self.node_data[node][res]["data"]) != 0: + if res == "io" or res == "network": + for values in self.node_data[node][res]["data"]: + self.node_data[node][res]["average"].append(float(round(numpy.mean(values), 2))) + self.node_data[node][res]["min"].append(float(round(min(values), 2))) + self.node_data[node][res]["max"].append(float(round(max(values), 2))) + average_sum += float(round(numpy.mean(values), 2)) + #print "average sum:", average_sum + else: + self.node_data[node][res]["average"] = float(round(numpy.mean(self.node_data[node][res] + ["data"]), 2)) + self.node_data[node][res]["min"] = float(round(min(self.node_data[node][res]["data"]), 2)) + self.node_data[node][res]["max"] = float(round(max(self.node_data[node][res]["data"]), 2)) + average_sum += float(round(numpy.mean(self.node_data[node][res]["data"]), 2)) + #print "average sum:", average_sum + del self.node_data[node][res]["data"] + + #print "groundtruthes:", self.groundtruth, self.groundtruth_epsilon, "\n average:", self.node_data[node][res]["average"] + if self.groundtruth != None and self.groundtruth_epsilon != None: + for node in self.node_data: + + #print "average sum:check", average_sum + if math.fabs(self.groundtruth - average_sum) <= self.groundtruth_epsilon: + groundtruth_result = True + else: + groundtruth_result = False + + print "resources mem data: ", self.node_data, "\n groundthruth result", groundtruth_result, " \n .................................." + return "resources_mem", self.node_data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details + else: + return False diff --git a/atf_metrics/src/atf_metrics/calculate_resources_network.py b/atf_metrics/src/atf_metrics/calculate_resources_network.py new file mode 100644 index 00000000..4a3a29d8 --- /dev/null +++ b/atf_metrics/src/atf_metrics/calculate_resources_network.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python +import numpy +import rospy +import math + +from atf_msgs.msg import Resources, IO, Network + + +class CalculateResourcesNetworkParamHandler: + def __init__(self): + """ + Class for returning the corresponding metric class with the given parameter. + """ + self.params = [] + + def parse_parameter(self, testblock_name, params): + """ + Method that returns the metric method with the given parameter. + :param params: Parameter + """ + if not isinstance(params, list): + rospy.logerr("metric config not a list") + return False + metrics = [] + + for metric in params: + # check for optional parameters + try: + groundtruth = metric["groundtruth"] + groundtruth_epsilon = metric["groundtruth_epsilon"] + #print "groundtruth", groundtruth, "groundtruth_epsilon", groundtruth_epsilon + if 'groundtruth' in metric: + del metric['groundtruth'] + if 'groundtruth_epsilon' in metric: + del metric['groundtruth_epsilon'] + except (TypeError, KeyError): + rospy.logwarn( + "No groundtruth parameters given, skipping groundtruth evaluation for metric 'resources network' in testblock '%s'", + testblock_name) + groundtruth = None + groundtruth_epsilon = None + metrics.append(CalculateResourcesNetwork(metric, groundtruth, groundtruth_epsilon)) + return metrics + + +class CalculateResourcesNetwork: + def __init__(self, resources, groundtruth, groundtruth_epsilon): + """ + Class for calculating the average resource workload and writing the current resource data. + The resource data is sent over the topic "/testing/Resources". + :param resources: a dictionary containing the names of the resources and a list with the names of the nodes. + Example: {"cpu":[move_group], "mem": [move_group]} + :type resources: dict + """ + + self.active = False + self.resources = resources + self.groundtruth = groundtruth + self.groundtruth_epsilon = groundtruth_epsilon + self.node_data = {} + self.size_io = len(IO.__slots__) + self.size_network = len(Network.__slots__) + self.finished = False + + # Sort resources after nodes + #print "resources:", self.resources, "\n node data:", self.node_data + for resource, nodes in self.resources.iteritems(): + for node in nodes: + if node not in self.node_data: + #print "node : ", node + self.node_data[node] = {resource: {"data": [], "average": [], "min": [], "max": []}} + elif resource not in self.node_data[node]: + self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) + #print "node data after:", self.node_data + rospy.Subscriber("/atf/resources", Resources, self.process_resource_data, queue_size=1) + + def start(self, timestamp): + self.active = True + + def stop(self, timestamp): + self.active = False + self.finished = True + + def pause(self, timestamp): + self.active = False + + def purge(self, timestamp): + pass + + def process_resource_data(self, msg): + #print "process data \n msg:", msg, "\n active", self.active + if self.active: + for node in msg.nodes: + try: + for resource in self.node_data[node.node_name]: + #print "nodes:", msg.nodes, "\n node data:", self.node_data, "\n resource", resource + if resource == "network": + if len(self.node_data[node.node_name][resource]["data"]) == 0: + for i in xrange(0, self.size_network): + self.node_data[node.node_name][resource]["data"].append([]) + self.node_data[node.node_name][resource]["data"][0].append(round(node.network.bytes_sent, + 2)) + self.node_data[node.node_name][resource]["data"][1].append(round(node.network.bytes_recv, + 2)) + self.node_data[node.node_name][resource]["data"][2].append(round(node.network.packets_sent, + 2)) + self.node_data[node.node_name][resource]["data"][3].append(round(node.network.packets_recv, + 2)) + self.node_data[node.node_name][resource]["data"][4].append(round(node.network.errin, 2)) + self.node_data[node.node_name][resource]["data"][5].append(round(node.network.errout, 2)) + self.node_data[node.node_name][resource]["data"][6].append(round(node.network.dropin, 2)) + self.node_data[node.node_name][resource]["data"][7].append(round(node.network.dropout, 2)) + except KeyError: + pass + + def get_result(self): + groundtruth_result = None + details = None + average_sum = 0.0 + + if self.finished: + #print "----------------------------- \n node data:", self.node_data + for node in self.node_data: + #print " node:", node + for res in self.node_data[node]: + #print "res", res + if len(self.node_data[node][res]["data"]) != 0: + if res == "io" or res == "network": + for values in self.node_data[node][res]["data"]: + self.node_data[node][res]["average"].append(float(round(numpy.mean(values), 2))) + self.node_data[node][res]["min"].append(float(round(min(values), 2))) + self.node_data[node][res]["max"].append(float(round(max(values), 2))) + average_sum += float(round(numpy.mean(values), 2)) + #print "average sum:", average_sum + else: + self.node_data[node][res]["average"] = float(round(numpy.mean(self.node_data[node][res] + ["data"]), 2)) + self.node_data[node][res]["min"] = float(round(min(self.node_data[node][res]["data"]), 2)) + self.node_data[node][res]["max"] = float(round(max(self.node_data[node][res]["data"]), 2)) + average_sum += float(round(numpy.mean(self.node_data[node][res]["data"]), 2)) + #print "average sum:", average_sum + del self.node_data[node][res]["data"] + + #print "groundtruthes:", self.groundtruth, self.groundtruth_epsilon, "\n average:", self.node_data[node][res]["average"] + if self.groundtruth != None and self.groundtruth_epsilon != None: + for node in self.node_data: + + #print "average sum:check", average_sum + if math.fabs(self.groundtruth - average_sum) <= self.groundtruth_epsilon: + groundtruth_result = True + else: + groundtruth_result = False + + print "resources network data: ", self.node_data, "\n groundthruth result", groundtruth_result, " \n .................................." + return "resources_network", self.node_data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details + else: + return False From 76abd72e3acf47a0703efa87423496b65bb902b7 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Tue, 21 Mar 2017 11:20:56 +0100 Subject: [PATCH 14/26] cleanup for PR --- .gitignore | 2 +- atf_core/scripts/analyser.py | 6 +- atf_core/scripts/merger.py | 2 +- atf_core/src/atf_core/configuration_parser.py | 8 +- .../src/atf_metrics/calculate_path_length.py | 1 - .../atf_metrics/calculate_resources_cpu.py | 11 ++- .../src/atf_metrics/calculate_resources_io.py | 90 ++++++++----------- .../atf_metrics/calculate_resources_mem.py | 87 ++++++------------ .../calculate_resources_network.py | 69 +++++++------- 9 files changed, 114 insertions(+), 162 deletions(-) diff --git a/.gitignore b/.gitignore index 8840e9f0..bc300f2d 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,4 @@ qtcreator-* CATKIN_IGNORE test_generated -.idea/* +.idea/* \ No newline at end of file diff --git a/atf_core/scripts/analyser.py b/atf_core/scripts/analyser.py index aea761c2..a90635bd 100755 --- a/atf_core/scripts/analyser.py +++ b/atf_core/scripts/analyser.py @@ -110,11 +110,11 @@ def get_result(self): rospy.logerr("An error occured during analysis of testblock '%s', no useful results available.") result.update({testblock.testblock_name: {"status": "error"}}) else: - print "testblock.metrics=", testblock.metrics + #print "testblock.metrics=", testblock.metrics for metric_handle in testblock.metrics: - print "metric_handle=", metric_handle + #print "metric_handle=", metric_handle metric_result = metric_handle.get_result() - print "metric_result=", metric_result + #print "metric_result=", metric_result if metric_result is not False: (metric_name, data, groundtruth_result, groundtruth, groundtruth_epsilon, details) = metric_result if testblock_name not in result: diff --git a/atf_core/scripts/merger.py b/atf_core/scripts/merger.py index 007283e4..7318e0db 100755 --- a/atf_core/scripts/merger.py +++ b/atf_core/scripts/merger.py @@ -91,7 +91,7 @@ def merge(self): #print "metric_data_list=", metric_data_list for i in range(len(metric_data_list)): #print "i=", i - print "test_data_merged[testblock_name][metric_name][i]['data']['values']=", test_data_merged[testblock_name][metric_name][i]['data']['values'] + #print "test_data_merged[testblock_name][metric_name][i]['data']['values']=", test_data_merged[testblock_name][metric_name][i]['data']['values'] test_data_merged[testblock_name][metric_name][i]['data']['min'] = min(test_data_merged[testblock_name][metric_name][i]['data']['values']) test_data_merged[testblock_name][metric_name][i]['data']['max'] = max(test_data_merged[testblock_name][metric_name][i]['data']['values']) test_data_merged[testblock_name][metric_name][i]['data']['average'] = round(sum(test_data_merged[testblock_name][metric_name][i]['data']['values'])/len(test_data_merged[testblock_name][metric_name][i]['data']['values']), 3) diff --git a/atf_core/src/atf_core/configuration_parser.py b/atf_core/src/atf_core/configuration_parser.py index 5d050684..e948d49f 100644 --- a/atf_core/src/atf_core/configuration_parser.py +++ b/atf_core/src/atf_core/configuration_parser.py @@ -33,13 +33,13 @@ def create_testblocks(self, config, recorder_handle=None, create_metrics=False): metric_handles = [] if create_metrics: metrics = config["test_config"][testblock_name] - print "metrics=", metrics + #print "metrics=", metrics metric_handlers_config = self.load_data(rospkg.RosPack().get_path("atf_metrics") + "/config/metrics.yaml") - print "metric_handlers_config=", metric_handlers_config + #print "metric_handlers_config=", metric_handlers_config for metric_name in metrics: - print "metric_name=", metric_name + #print "metric_name=", metric_name metrics_return_list = getattr(atf_metrics, metric_handlers_config[metric_name]["handler"])().parse_parameter(testblock_name, metrics[metric_name]) - print "metrics_return_list=", metrics_return_list + #print "metrics_return_list=", metrics_return_list if type(metrics_return_list) == list: for metric_return in metrics_return_list: #print "metric_return=", metric_return diff --git a/atf_metrics/src/atf_metrics/calculate_path_length.py b/atf_metrics/src/atf_metrics/calculate_path_length.py index 51c0ec98..d8b4deb5 100644 --- a/atf_metrics/src/atf_metrics/calculate_path_length.py +++ b/atf_metrics/src/atf_metrics/calculate_path_length.py @@ -109,7 +109,6 @@ def get_result(self): groundtruth_result = True else: groundtruth_result = False - print "path length data: ", data return "path_length", data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details else: return False diff --git a/atf_metrics/src/atf_metrics/calculate_resources_cpu.py b/atf_metrics/src/atf_metrics/calculate_resources_cpu.py index 6e73c684..9bab7c94 100644 --- a/atf_metrics/src/atf_metrics/calculate_resources_cpu.py +++ b/atf_metrics/src/atf_metrics/calculate_resources_cpu.py @@ -101,7 +101,7 @@ def process_resource_data(self, msg): def get_result(self): groundtruth_result = None - details = {"nodes":{}} + details = {"sum of nodes":[]} average_sum = 0.0 if self.finished: @@ -119,11 +119,10 @@ def get_result(self): print "average sum:", average_sum del self.node_data[node][res]["data"] - details["nodes"].update({node:[]}) - details["nodes"][node].append({"max":self.node_data[node][res]["max"]}) - details["nodes"][node].append({"average":self.node_data[node][res]["average"]}) - details["nodes"][node].append({"min":self.node_data[node][res]["min"]}) - + details["sum of nodes"].append(node) + # details["nodes"][node].append({"max":self.node_data[node][res]["max"]}) + # details["nodes"][node].append({"average":self.node_data[node][res]["average"]}) + # details["nodes"][node].append({"min":self.node_data[node][res]["min"]}) #print "groundtruthes:", self.groundtruth, self.groundtruth_epsilon, "\n average:", self.node_data[node][res]["average"] if self.groundtruth != None and self.groundtruth_epsilon != None: diff --git a/atf_metrics/src/atf_metrics/calculate_resources_io.py b/atf_metrics/src/atf_metrics/calculate_resources_io.py index 697021bd..ba9dd26d 100644 --- a/atf_metrics/src/atf_metrics/calculate_resources_io.py +++ b/atf_metrics/src/atf_metrics/calculate_resources_io.py @@ -4,6 +4,7 @@ import math from atf_msgs.msg import Resources, IO, Network +from operator import add class CalculateResourcesIOParamHandler: @@ -22,13 +23,13 @@ def parse_parameter(self, testblock_name, params): rospy.logerr("metric config not a list") return False metrics = [] - + print "params:", params for metric in params: # check for optional parameters try: groundtruth = metric["groundtruth"] groundtruth_epsilon = metric["groundtruth_epsilon"] - #print "groundtruth", groundtruth, "groundtruth_epsilon", groundtruth_epsilon + print "groundtruth", groundtruth, "groundtruth_epsilon", groundtruth_epsilon if 'groundtruth' in metric: del metric['groundtruth'] if 'groundtruth_epsilon' in metric: @@ -39,12 +40,13 @@ def parse_parameter(self, testblock_name, params): testblock_name) groundtruth = None groundtruth_epsilon = None - metrics.append(CalculateResourcesIO(metric, groundtruth, groundtruth_epsilon)) + print "metric:", metric + metrics.append(CalculateResourcesIO(metric["nodes"], groundtruth, groundtruth_epsilon)) return metrics class CalculateResourcesIO: - def __init__(self, resources, groundtruth, groundtruth_epsilon): + def __init__(self, nodes, groundtruth, groundtruth_epsilon): """ Class for calculating the average resource workload and writing the current resource data. The resource data is sent over the topic "/testing/Resources". @@ -54,7 +56,7 @@ def __init__(self, resources, groundtruth, groundtruth_epsilon): """ self.active = False - self.resources = resources + self.resource = "io" self.groundtruth = groundtruth self.groundtruth_epsilon = groundtruth_epsilon self.node_data = {} @@ -63,15 +65,14 @@ def __init__(self, resources, groundtruth, groundtruth_epsilon): self.finished = False # Sort resources after nodes - #print "resources:", self.resources, "\n node data:", self.node_data - for resource, nodes in self.resources.iteritems(): - for node in nodes: - if node not in self.node_data: - #print "node : ", node - self.node_data[node] = {resource: {"data": [], "average": [], "min": [], "max": []}} - elif resource not in self.node_data[node]: - self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) - #print "node data after:", self.node_data + print "node data:", self.node_data + for node in nodes: + if node not in self.node_data: + print "node : ", node + self.node_data[node] = {self.resource: {"data": [], "average": [], "min": [], "max": []}} + # elif resource not in self.node_data[node]: + # self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) + print "node data after:", self.node_data rospy.Subscriber("/atf/resources", Resources, self.process_resource_data, queue_size=1) def start(self, timestamp): @@ -88,17 +89,13 @@ def purge(self, timestamp): pass def process_resource_data(self, msg): - #print "process data \n msg:", msg, "\n active", self.active + #print "--------------------------------------\nprocess data \n msg:", msg, "\n active", self.active if self.active: for node in msg.nodes: try: for resource in self.node_data[node.node_name]: #print "nodes:", msg.nodes, "\n node data:", self.node_data, "\n resource", resource - if resource == "cpu": - self.node_data[node.node_name][resource]["data"].append(round(node.cpu, 2)) - elif resource == "mem": - self.node_data[node.node_name][resource]["data"].append(round(node.memory, 2)) - elif resource == "io": + if resource == "io": if len(self.node_data[node.node_name][resource]["data"]) == 0: for i in xrange(0, self.size_io): self.node_data[node.node_name][resource]["data"].append([]) @@ -106,53 +103,38 @@ def process_resource_data(self, msg): self.node_data[node.node_name][resource]["data"][1].append(round(node.io.write_count, 2)) self.node_data[node.node_name][resource]["data"][2].append(round(node.io.read_bytes, 2)) self.node_data[node.node_name][resource]["data"][3].append(round(node.io.write_bytes, 2)) - elif resource == "network": - if len(self.node_data[node.node_name][resource]["data"]) == 0: - for i in xrange(0, self.size_network): - self.node_data[node.node_name][resource]["data"].append([]) - self.node_data[node.node_name][resource]["data"][0].append(round(node.network.bytes_sent, - 2)) - self.node_data[node.node_name][resource]["data"][1].append(round(node.network.bytes_recv, - 2)) - self.node_data[node.node_name][resource]["data"][2].append(round(node.network.packets_sent, - 2)) - self.node_data[node.node_name][resource]["data"][3].append(round(node.network.packets_recv, - 2)) - self.node_data[node.node_name][resource]["data"][4].append(round(node.network.errin, 2)) - self.node_data[node.node_name][resource]["data"][5].append(round(node.network.errout, 2)) - self.node_data[node.node_name][resource]["data"][6].append(round(node.network.dropin, 2)) - self.node_data[node.node_name][resource]["data"][7].append(round(node.network.dropout, 2)) except KeyError: pass def get_result(self): groundtruth_result = None - details = None + details = {"sum of read and write bytes from nodes":[]} average_sum = 0.0 if self.finished: - #print "----------------------------- \n node data:", self.node_data for node in self.node_data: #print " node:", node for res in self.node_data[node]: #print "res", res if len(self.node_data[node][res]["data"]) != 0: - if res == "io" or res == "network": - for values in self.node_data[node][res]["data"]: - self.node_data[node][res]["average"].append(float(round(numpy.mean(values), 2))) - self.node_data[node][res]["min"].append(float(round(min(values), 2))) - self.node_data[node][res]["max"].append(float(round(max(values), 2))) - average_sum += float(round(numpy.mean(values), 2)) - #print "average sum:", average_sum - else: - self.node_data[node][res]["average"] = float(round(numpy.mean(self.node_data[node][res] - ["data"]), 2)) - self.node_data[node][res]["min"] = float(round(min(self.node_data[node][res]["data"]), 2)) - self.node_data[node][res]["max"] = float(round(max(self.node_data[node][res]["data"]), 2)) - average_sum += float(round(numpy.mean(self.node_data[node][res]["data"]), 2)) - #print "average sum:", average_sum + self.node_data[node][res]["average"] = float(round(numpy.mean( + map(add, self.node_data[node][res]["data"][2], self.node_data[node][res]["data"][3])), 2)) + self.node_data[node][res]["min"] = float(round( + min(map(add, self.node_data[node][res]["data"][2], self.node_data[node][res]["data"][3])), + 2)) + self.node_data[node][res]["max"] = float(round( + max(map(add, self.node_data[node][res]["data"][2], self.node_data[node][res]["data"][3])), + 2)) + average_sum += float(round(numpy.mean(self.node_data[node][res]["average"]), 2)) + print "average sum:", average_sum + #print "----------------------------- \n node data:", self.node_data del self.node_data[node][res]["data"] + details["sum of read and write bytes from nodes"].append(node) + # details["nodes"][node].append({"max":self.node_data[node][res]["max"]}) + # details["nodes"][node].append({"average":self.node_data[node][res]["average"]}) + # details["nodes"][node].append({"min":self.node_data[node][res]["min"]}) + #print "groundtruthes:", self.groundtruth, self.groundtruth_epsilon, "\n average:", self.node_data[node][res]["average"] if self.groundtruth != None and self.groundtruth_epsilon != None: for node in self.node_data: @@ -163,7 +145,7 @@ def get_result(self): else: groundtruth_result = False - print "resources io data: ", self.node_data, "\n groundthruth result", groundtruth_result, " \n .................................." - return "resources_io", self.node_data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details + print "resources io data: ", average_sum, "\n groundthruth result", groundtruth_result, "details:", details, " \n .................................." + return "resources_io", round(average_sum, 3), groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details else: return False diff --git a/atf_metrics/src/atf_metrics/calculate_resources_mem.py b/atf_metrics/src/atf_metrics/calculate_resources_mem.py index 5cd7915a..235285c9 100644 --- a/atf_metrics/src/atf_metrics/calculate_resources_mem.py +++ b/atf_metrics/src/atf_metrics/calculate_resources_mem.py @@ -22,13 +22,13 @@ def parse_parameter(self, testblock_name, params): rospy.logerr("metric config not a list") return False metrics = [] - + print "params:", params for metric in params: # check for optional parameters try: groundtruth = metric["groundtruth"] groundtruth_epsilon = metric["groundtruth_epsilon"] - #print "groundtruth", groundtruth, "groundtruth_epsilon", groundtruth_epsilon + print "groundtruth", groundtruth, "groundtruth_epsilon", groundtruth_epsilon if 'groundtruth' in metric: del metric['groundtruth'] if 'groundtruth_epsilon' in metric: @@ -39,12 +39,13 @@ def parse_parameter(self, testblock_name, params): testblock_name) groundtruth = None groundtruth_epsilon = None - metrics.append(CalculateResourcesMem(metric, groundtruth, groundtruth_epsilon)) + print "metric:", metric + metrics.append(CalculateResourcesMem(metric["nodes"], groundtruth, groundtruth_epsilon)) return metrics class CalculateResourcesMem: - def __init__(self, resources, groundtruth, groundtruth_epsilon): + def __init__(self, nodes, groundtruth, groundtruth_epsilon): """ Class for calculating the average resource workload and writing the current resource data. The resource data is sent over the topic "/testing/Resources". @@ -54,7 +55,7 @@ def __init__(self, resources, groundtruth, groundtruth_epsilon): """ self.active = False - self.resources = resources + self.resource = "mem" self.groundtruth = groundtruth self.groundtruth_epsilon = groundtruth_epsilon self.node_data = {} @@ -63,15 +64,14 @@ def __init__(self, resources, groundtruth, groundtruth_epsilon): self.finished = False # Sort resources after nodes - #print "resources:", self.resources, "\n node data:", self.node_data - for resource, nodes in self.resources.iteritems(): - for node in nodes: - if node not in self.node_data: - #print "node : ", node - self.node_data[node] = {resource: {"data": [], "average": [], "min": [], "max": []}} - elif resource not in self.node_data[node]: - self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) - #print "node data after:", self.node_data + print "node data:", self.node_data + for node in nodes: + if node not in self.node_data: + print "node : ", node + self.node_data[node] = {self.resource: {"data": [], "average": [], "min": [], "max": []}} + # elif resource not in self.node_data[node]: + # self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) + print "node data after:", self.node_data rospy.Subscriber("/atf/resources", Resources, self.process_resource_data, queue_size=1) def start(self, timestamp): @@ -88,46 +88,20 @@ def purge(self, timestamp): pass def process_resource_data(self, msg): - #print "process data \n msg:", msg, "\n active", self.active + #print "--------------------------------------\nprocess data \n msg:", msg, "\n active", self.active if self.active: for node in msg.nodes: try: for resource in self.node_data[node.node_name]: #print "nodes:", msg.nodes, "\n node data:", self.node_data, "\n resource", resource - if resource == "cpu": - self.node_data[node.node_name][resource]["data"].append(round(node.cpu, 2)) - elif resource == "mem": + if resource == "mem": self.node_data[node.node_name][resource]["data"].append(round(node.memory, 2)) - elif resource == "io": - if len(self.node_data[node.node_name][resource]["data"]) == 0: - for i in xrange(0, self.size_io): - self.node_data[node.node_name][resource]["data"].append([]) - self.node_data[node.node_name][resource]["data"][0].append(round(node.io.read_count, 2)) - self.node_data[node.node_name][resource]["data"][1].append(round(node.io.write_count, 2)) - self.node_data[node.node_name][resource]["data"][2].append(round(node.io.read_bytes, 2)) - self.node_data[node.node_name][resource]["data"][3].append(round(node.io.write_bytes, 2)) - elif resource == "network": - if len(self.node_data[node.node_name][resource]["data"]) == 0: - for i in xrange(0, self.size_network): - self.node_data[node.node_name][resource]["data"].append([]) - self.node_data[node.node_name][resource]["data"][0].append(round(node.network.bytes_sent, - 2)) - self.node_data[node.node_name][resource]["data"][1].append(round(node.network.bytes_recv, - 2)) - self.node_data[node.node_name][resource]["data"][2].append(round(node.network.packets_sent, - 2)) - self.node_data[node.node_name][resource]["data"][3].append(round(node.network.packets_recv, - 2)) - self.node_data[node.node_name][resource]["data"][4].append(round(node.network.errin, 2)) - self.node_data[node.node_name][resource]["data"][5].append(round(node.network.errout, 2)) - self.node_data[node.node_name][resource]["data"][6].append(round(node.network.dropin, 2)) - self.node_data[node.node_name][resource]["data"][7].append(round(node.network.dropout, 2)) except KeyError: pass def get_result(self): groundtruth_result = None - details = None + details = {"sum of nodes":[]} average_sum = 0.0 if self.finished: @@ -137,22 +111,19 @@ def get_result(self): for res in self.node_data[node]: #print "res", res if len(self.node_data[node][res]["data"]) != 0: - if res == "io" or res == "network": - for values in self.node_data[node][res]["data"]: - self.node_data[node][res]["average"].append(float(round(numpy.mean(values), 2))) - self.node_data[node][res]["min"].append(float(round(min(values), 2))) - self.node_data[node][res]["max"].append(float(round(max(values), 2))) - average_sum += float(round(numpy.mean(values), 2)) - #print "average sum:", average_sum - else: - self.node_data[node][res]["average"] = float(round(numpy.mean(self.node_data[node][res] + self.node_data[node][res]["average"] = float(round(numpy.mean(self.node_data[node][res] ["data"]), 2)) - self.node_data[node][res]["min"] = float(round(min(self.node_data[node][res]["data"]), 2)) - self.node_data[node][res]["max"] = float(round(max(self.node_data[node][res]["data"]), 2)) - average_sum += float(round(numpy.mean(self.node_data[node][res]["data"]), 2)) - #print "average sum:", average_sum + self.node_data[node][res]["min"] = float(round(min(self.node_data[node][res]["data"]), 2)) + self.node_data[node][res]["max"] = float(round(max(self.node_data[node][res]["data"]), 2)) + average_sum += float(round(numpy.mean(self.node_data[node][res]["data"]), 2)) + print "average sum:", average_sum del self.node_data[node][res]["data"] + details["sum of nodes"].append(node) + # details["nodes"][node].append({"max":self.node_data[node][res]["max"]}) + # details["nodes"][node].append({"average":self.node_data[node][res]["average"]}) + # details["nodes"][node].append({"min":self.node_data[node][res]["min"]}) + #print "groundtruthes:", self.groundtruth, self.groundtruth_epsilon, "\n average:", self.node_data[node][res]["average"] if self.groundtruth != None and self.groundtruth_epsilon != None: for node in self.node_data: @@ -163,7 +134,7 @@ def get_result(self): else: groundtruth_result = False - print "resources mem data: ", self.node_data, "\n groundthruth result", groundtruth_result, " \n .................................." - return "resources_mem", self.node_data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details + print "resources mem data: ", average_sum, "\n groundthruth result", groundtruth_result, "details:", details, " \n .................................." + return "resources_mem", round(average_sum, 3), groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details else: return False diff --git a/atf_metrics/src/atf_metrics/calculate_resources_network.py b/atf_metrics/src/atf_metrics/calculate_resources_network.py index 4a3a29d8..fbcde841 100644 --- a/atf_metrics/src/atf_metrics/calculate_resources_network.py +++ b/atf_metrics/src/atf_metrics/calculate_resources_network.py @@ -4,7 +4,7 @@ import math from atf_msgs.msg import Resources, IO, Network - +from operator import add class CalculateResourcesNetworkParamHandler: def __init__(self): @@ -22,29 +22,30 @@ def parse_parameter(self, testblock_name, params): rospy.logerr("metric config not a list") return False metrics = [] - + print "params:", params for metric in params: # check for optional parameters try: groundtruth = metric["groundtruth"] groundtruth_epsilon = metric["groundtruth_epsilon"] - #print "groundtruth", groundtruth, "groundtruth_epsilon", groundtruth_epsilon + print "groundtruth", groundtruth, "groundtruth_epsilon", groundtruth_epsilon if 'groundtruth' in metric: del metric['groundtruth'] if 'groundtruth_epsilon' in metric: del metric['groundtruth_epsilon'] except (TypeError, KeyError): rospy.logwarn( - "No groundtruth parameters given, skipping groundtruth evaluation for metric 'resources network' in testblock '%s'", + "No groundtruth parameters given, skipping groundtruth evaluation for metric 'resources' in testblock '%s'", testblock_name) groundtruth = None groundtruth_epsilon = None - metrics.append(CalculateResourcesNetwork(metric, groundtruth, groundtruth_epsilon)) + print "metric:", metric + metrics.append(CalculateResourcesNetwork(metric["nodes"], groundtruth, groundtruth_epsilon)) return metrics class CalculateResourcesNetwork: - def __init__(self, resources, groundtruth, groundtruth_epsilon): + def __init__(self, nodes, groundtruth, groundtruth_epsilon): """ Class for calculating the average resource workload and writing the current resource data. The resource data is sent over the topic "/testing/Resources". @@ -54,7 +55,7 @@ def __init__(self, resources, groundtruth, groundtruth_epsilon): """ self.active = False - self.resources = resources + self.resource = "network" self.groundtruth = groundtruth self.groundtruth_epsilon = groundtruth_epsilon self.node_data = {} @@ -63,15 +64,14 @@ def __init__(self, resources, groundtruth, groundtruth_epsilon): self.finished = False # Sort resources after nodes - #print "resources:", self.resources, "\n node data:", self.node_data - for resource, nodes in self.resources.iteritems(): - for node in nodes: - if node not in self.node_data: - #print "node : ", node - self.node_data[node] = {resource: {"data": [], "average": [], "min": [], "max": []}} - elif resource not in self.node_data[node]: - self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) - #print "node data after:", self.node_data + print "node data:", self.node_data + for node in nodes: + if node not in self.node_data: + print "node : ", node + self.node_data[node] = {self.resource: {"data": [], "average": [], "min": [], "max": []}} + # elif resource not in self.node_data[node]: + # self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) + print "node data after:", self.node_data rospy.Subscriber("/atf/resources", Resources, self.process_resource_data, queue_size=1) def start(self, timestamp): @@ -88,7 +88,7 @@ def purge(self, timestamp): pass def process_resource_data(self, msg): - #print "process data \n msg:", msg, "\n active", self.active + #print "--------------------------------------\nprocess data \n msg:", msg, "\n active", self.active if self.active: for node in msg.nodes: try: @@ -115,7 +115,7 @@ def process_resource_data(self, msg): def get_result(self): groundtruth_result = None - details = None + details = {"sum of received and sent bytes from nodes":[]} average_sum = 0.0 if self.finished: @@ -125,22 +125,23 @@ def get_result(self): for res in self.node_data[node]: #print "res", res if len(self.node_data[node][res]["data"]) != 0: - if res == "io" or res == "network": - for values in self.node_data[node][res]["data"]: - self.node_data[node][res]["average"].append(float(round(numpy.mean(values), 2))) - self.node_data[node][res]["min"].append(float(round(min(values), 2))) - self.node_data[node][res]["max"].append(float(round(max(values), 2))) - average_sum += float(round(numpy.mean(values), 2)) - #print "average sum:", average_sum - else: - self.node_data[node][res]["average"] = float(round(numpy.mean(self.node_data[node][res] - ["data"]), 2)) - self.node_data[node][res]["min"] = float(round(min(self.node_data[node][res]["data"]), 2)) - self.node_data[node][res]["max"] = float(round(max(self.node_data[node][res]["data"]), 2)) - average_sum += float(round(numpy.mean(self.node_data[node][res]["data"]), 2)) - #print "average sum:", average_sum + self.node_data[node][res]["average"] = float(round(numpy.mean( + map(add, self.node_data[node][res]["data"][0], self.node_data[node][res]["data"][1])), 2)) + self.node_data[node][res]["min"] = float(round( + min(map(add, self.node_data[node][res]["data"][0], self.node_data[node][res]["data"][1])), + 2)) + self.node_data[node][res]["max"] = float(round( + max(map(add, self.node_data[node][res]["data"][0], self.node_data[node][res]["data"][1])), + 2)) + average_sum += float(round(numpy.mean(self.node_data[node][res]["average"]), 2)) + print "average sum:", average_sum del self.node_data[node][res]["data"] + details["sum of received and sent bytes from nodes"].append(node) + # details["nodes"][node].append({"max":self.node_data[node][res]["max"]}) + # details["nodes"][node].append({"average":self.node_data[node][res]["average"]}) + # details["nodes"][node].append({"min":self.node_data[node][res]["min"]}) + #print "groundtruthes:", self.groundtruth, self.groundtruth_epsilon, "\n average:", self.node_data[node][res]["average"] if self.groundtruth != None and self.groundtruth_epsilon != None: for node in self.node_data: @@ -151,7 +152,7 @@ def get_result(self): else: groundtruth_result = False - print "resources network data: ", self.node_data, "\n groundthruth result", groundtruth_result, " \n .................................." - return "resources_network", self.node_data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details + print "resources network data: ", average_sum, "\n groundthruth result", groundtruth_result, "details:", details, " \n .................................." + return "resources_network", round(average_sum, 3), groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details else: return False From f650b515b1a8b29c1b26608ba8f4fe0ed0b393bc Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Tue, 21 Mar 2017 11:22:49 +0100 Subject: [PATCH 15/26] remove old calculate_resources --- .../src/atf_metrics/calculate_resources.py | 169 ------------------ 1 file changed, 169 deletions(-) delete mode 100644 atf_metrics/src/atf_metrics/calculate_resources.py diff --git a/atf_metrics/src/atf_metrics/calculate_resources.py b/atf_metrics/src/atf_metrics/calculate_resources.py deleted file mode 100644 index 537cfaf1..00000000 --- a/atf_metrics/src/atf_metrics/calculate_resources.py +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/env python -import numpy -import rospy -import math - -from atf_msgs.msg import Resources, IO, Network - - -class CalculateResourcesParamHandler: - def __init__(self): - """ - Class for returning the corresponding metric class with the given parameter. - """ - self.params = [] - - def parse_parameter(self, testblock_name, params): - """ - Method that returns the metric method with the given parameter. - :param params: Parameter - """ - if not isinstance(params, list): - rospy.logerr("metric config not a list") - return False - metrics = [] - - for metric in params: - # check for optional parameters - try: - groundtruth = metric["groundtruth"] - groundtruth_epsilon = metric["groundtruth_epsilon"] - #print "groundtruth", groundtruth, "groundtruth_epsilon", groundtruth_epsilon - if 'groundtruth' in metric: - del metric['groundtruth'] - if 'groundtruth_epsilon' in metric: - del metric['groundtruth_epsilon'] - except (TypeError, KeyError): - rospy.logwarn( - "No groundtruth parameters given, skipping groundtruth evaluation for metric 'resources' in testblock '%s'", - testblock_name) - groundtruth = None - groundtruth_epsilon = None - metrics.append(CalculateResources(metric, groundtruth, groundtruth_epsilon)) - return metrics - - -class CalculateResources: - def __init__(self, resources, groundtruth, groundtruth_epsilon): - """ - Class for calculating the average resource workload and writing the current resource data. - The resource data is sent over the topic "/testing/Resources". - :param resources: a dictionary containing the names of the resources and a list with the names of the nodes. - Example: {"cpu":[move_group], "mem": [move_group]} - :type resources: dict - """ - - self.active = False - self.resources = resources - self.groundtruth = groundtruth - self.groundtruth_epsilon = groundtruth_epsilon - self.node_data = {} - self.size_io = len(IO.__slots__) - self.size_network = len(Network.__slots__) - self.finished = False - - # Sort resources after nodes - #print "resources:", self.resources, "\n node data:", self.node_data - for resource, nodes in self.resources.iteritems(): - for node in nodes: - if node not in self.node_data: - #print "node : ", node - self.node_data[node] = {resource: {"data": [], "average": [], "min": [], "max": []}} - elif resource not in self.node_data[node]: - self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) - #print "node data after:", self.node_data - rospy.Subscriber("/atf/resources", Resources, self.process_resource_data, queue_size=1) - - def start(self, timestamp): - self.active = True - - def stop(self, timestamp): - self.active = False - self.finished = True - - def pause(self, timestamp): - self.active = False - - def purge(self, timestamp): - pass - - def process_resource_data(self, msg): - #print "process data \n msg:", msg, "\n active", self.active - if self.active: - for node in msg.nodes: - try: - for resource in self.node_data[node.node_name]: - #print "nodes:", msg.nodes, "\n node data:", self.node_data, "\n resource", resource - if resource == "cpu": - self.node_data[node.node_name][resource]["data"].append(round(node.cpu, 2)) - elif resource == "mem": - self.node_data[node.node_name][resource]["data"].append(round(node.memory, 2)) - elif resource == "io": - if len(self.node_data[node.node_name][resource]["data"]) == 0: - for i in xrange(0, self.size_io): - self.node_data[node.node_name][resource]["data"].append([]) - self.node_data[node.node_name][resource]["data"][0].append(round(node.io.read_count, 2)) - self.node_data[node.node_name][resource]["data"][1].append(round(node.io.write_count, 2)) - self.node_data[node.node_name][resource]["data"][2].append(round(node.io.read_bytes, 2)) - self.node_data[node.node_name][resource]["data"][3].append(round(node.io.write_bytes, 2)) - elif resource == "network": - if len(self.node_data[node.node_name][resource]["data"]) == 0: - for i in xrange(0, self.size_network): - self.node_data[node.node_name][resource]["data"].append([]) - self.node_data[node.node_name][resource]["data"][0].append(round(node.network.bytes_sent, - 2)) - self.node_data[node.node_name][resource]["data"][1].append(round(node.network.bytes_recv, - 2)) - self.node_data[node.node_name][resource]["data"][2].append(round(node.network.packets_sent, - 2)) - self.node_data[node.node_name][resource]["data"][3].append(round(node.network.packets_recv, - 2)) - self.node_data[node.node_name][resource]["data"][4].append(round(node.network.errin, 2)) - self.node_data[node.node_name][resource]["data"][5].append(round(node.network.errout, 2)) - self.node_data[node.node_name][resource]["data"][6].append(round(node.network.dropin, 2)) - self.node_data[node.node_name][resource]["data"][7].append(round(node.network.dropout, 2)) - except KeyError: - pass - - def get_result(self): - groundtruth_result = None - details = None - average_sum = 0.0 - - if self.finished: - #print "----------------------------- \n node data:", self.node_data - for node in self.node_data: - #print " node:", node - for res in self.node_data[node]: - #print "res", res - if len(self.node_data[node][res]["data"]) != 0: - if res == "io" or res == "network": - for values in self.node_data[node][res]["data"]: - self.node_data[node][res]["average"].append(float(round(numpy.mean(values), 2))) - self.node_data[node][res]["min"].append(float(round(min(values), 2))) - self.node_data[node][res]["max"].append(float(round(max(values), 2))) - average_sum += float(round(numpy.mean(values), 2)) - #print "average sum:", average_sum - else: - self.node_data[node][res]["average"] = float(round(numpy.mean(self.node_data[node][res] - ["data"]), 2)) - self.node_data[node][res]["min"] = float(round(min(self.node_data[node][res]["data"]), 2)) - self.node_data[node][res]["max"] = float(round(max(self.node_data[node][res]["data"]), 2)) - average_sum += float(round(numpy.mean(self.node_data[node][res]["data"]), 2)) - #print "average sum:", average_sum - del self.node_data[node][res]["data"] - - #print "groundtruthes:", self.groundtruth, self.groundtruth_epsilon, "\n average:", self.node_data[node][res]["average"] - if self.groundtruth != None and self.groundtruth_epsilon != None: - for node in self.node_data: - - #print "average sum:check", average_sum - if math.fabs(self.groundtruth - average_sum) <= self.groundtruth_epsilon: - groundtruth_result = True - else: - groundtruth_result = False - - #print "resources data: ", self.node_data, "\n groundthruth result", groundtruth_result, " \n .................................." - return "resources", self.node_data, groundtruth_result, self.groundtruth, self.groundtruth_epsilon, details - else: - return False From 9306505e40cc8b08bc1a23d0615bb7360798032d Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Tue, 21 Mar 2017 15:45:55 +0100 Subject: [PATCH 16/26] updated presenter --- atf_presenter/scripts/presenter.py | 89 ++++++++++++++++-------------- 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/atf_presenter/scripts/presenter.py b/atf_presenter/scripts/presenter.py index d009f8ce..21f8feef 100755 --- a/atf_presenter/scripts/presenter.py +++ b/atf_presenter/scripts/presenter.py @@ -3,9 +3,11 @@ import rospy import yaml import copy +import os +import sys +import optparse import matplotlib.pyplot as plt -import os class presenter: @@ -33,6 +35,7 @@ def import_yaml(self, file): for metric, values in metrics.iteritems(): self.data.update({metric : []}) + def extract_yaml(self, num): avg = copy.deepcopy(self.data) mini = copy.deepcopy(self.data) @@ -40,11 +43,11 @@ def extract_yaml(self, num): numvals = copy.deepcopy(self.data) for testblock, metrics in self.yaml_file.iteritems(): #print ("testblock: ", testblock) - for metric, values in metrics.iteritems(): + for metric, data in metrics.iteritems(): #print ("metric: ", metric) self.metric.add(metric) - for data in values: - for name, result in data.iteritems(): + for values in data: + for name, result in values.iteritems(): #print ("name:", name) if result != None: #print ("result: ",result) @@ -53,10 +56,13 @@ def extract_yaml(self, num): for attribute, number in result.iteritems(): #print ("attribute: ", attribute) if isinstance(number, list): - numvals[metric].append(number) print "numvals", numvals - #for dictval in number: - #print ("value: ", dictval) + for item in number: + #print ("value: ", item) + if isinstance(item, str): + continue + else: + numvals[metric].append(item) elif isinstance(number, float): #print ("result: ",result) if attribute == "average": @@ -69,26 +75,25 @@ def extract_yaml(self, num): maxi[metric].append(number) #print "max:", number #print "avg:", avg, "min:", mini, "max:", maxi - #print "\n \n -------------------------------------------------------------- \n \n" - elif isinstance(number, int): - print ("integer: ",number) - elif isinstance(number, str) or isinstance(result, unicode): - print ("string: ",number) - elif isinstance(result, list): - for arrval in result: - print ("arrval:", arrval) - elif isinstance(result, int): - print ("number: ", result) - elif isinstance(result, str) or isinstance(result, unicode): - print ("string: ", result) + # elif isinstance(number, int): + # print ("integer: ",number) + # elif isinstance(number, str) or isinstance(result, unicode): + # print ("string: ",number) + # elif isinstance(result, list): + # for arrval in result: + # print ("arrval:", arrval) + # elif isinstance(result, int): + # print ("number: ", result) + # elif isinstance(result, str) or isinstance(result, unicode): + # print ("string: ", result) else: rospy.logerr("Error, unknown result!") vals = [avg, numvals] - print "values", vals + #print "values", vals self.tests.update({str(num): vals}) - # print "-------------------------------------------------" - # print ("tests:", self.tests) - # print "-------------------------------------------------" + print "-------------------------------------------------" + print ("tests:", self.tests) + print "-------------------------------------------------" def import_testnames(self, file): with open(file, 'r') as stream: @@ -101,7 +106,7 @@ def import_testnames(self, file): self.testlist = yaml.load(stream) def show_results(self, all): - if(all == "all"): + if(all): self.metric.remove('time') #print "metric: ",self.metric counter = 0 @@ -114,12 +119,12 @@ def show_results(self, all): # print "-------------------------------------------" # print testname # print "\n data: ", data - # print "\n mean: ",data[0][metric] - # print "\n values: ", data[1][metric] + # print "mean: ",data[0][metric] + # print "values: ", data[1][metric] means.extend(data[0][metric]) - for mean in data[1][metric]: - #print "mean", mean - devs.append(numpy.std(mean)) + #for mean in data[1][metric]: + #print "dev", numpy.std(data[1][metric]), "from mean", data[1][metric] + devs.append(numpy.std(data[1][metric])) for test in self.testlist: if testname in test: #print "\n testname:", self.testlist, " \n \n test:", test @@ -164,12 +169,12 @@ def show_results(self, all): # print "-------------------------------------------" # print testname # print "\n data: ", data - # print "\n mean: ",data[0][metric] - # print "\n values: ", data[1][metric] + # print "mean: ",data[0][metric] + # print "values: ", data[1][metric] means.extend(data[0][metric]) - for mean in data[1][metric]: - #print "mean", mean - devs.append(numpy.std(mean)) + #for mean in data[1][metric]: + #print "dev", numpy.std(data[1][metric]), "from mean", data[1][metric] + devs.append(numpy.std(data[1][metric])) for test in self.testlist: if testname in test: #print "\n testname:", self.testlist, " \n \n test:", test @@ -199,18 +204,20 @@ def show_results(self, all): plt.tight_layout() plt.show() - if __name__ == '__main__': - p = presenter() + parser = optparse.OptionParser() + parser.add_option('-a', '--all', dest='all', help='Print all plots in one Window', default=False, action="store_true") + (options, args) = parser.parse_args() + p = presenter() Path = "/tmp/hannes_test_new/results_yaml/" filelist = os.listdir(Path) p.import_testnames(Path.replace('yaml', 'json')+"test_list.json") for file in filelist: #print "file", file - #if "merged" in str(file): - p.import_yaml(Path+file) - filename = file.replace('.yaml', '') - p.extract_yaml(filename.replace('merged_', '')) - p.show_results("all") + if "merged" in str(file): + p.import_yaml(Path+file) + filename = file.replace('.yaml', '') + p.extract_yaml(filename.replace('merged_', '')) + p.show_results(options.all) From f8f161d6987005b33803cfb1ad49f85cc653b50a Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Tue, 21 Mar 2017 16:00:03 +0100 Subject: [PATCH 17/26] use function to calculate data --- atf_presenter/scripts/presenter.py | 95 ++++++++++-------------------- 1 file changed, 32 insertions(+), 63 deletions(-) diff --git a/atf_presenter/scripts/presenter.py b/atf_presenter/scripts/presenter.py index 21f8feef..b304b0cf 100755 --- a/atf_presenter/scripts/presenter.py +++ b/atf_presenter/scripts/presenter.py @@ -111,42 +111,8 @@ def show_results(self, all): #print "metric: ",self.metric counter = 0 fig, axarr = plt.subplots(len(self.metric), sharex=True) - testnames = [] for metric in self.metric: - means = [] - devs = [] - for testname, data in self.tests.iteritems(): - # print "-------------------------------------------" - # print testname - # print "\n data: ", data - # print "mean: ",data[0][metric] - # print "values: ", data[1][metric] - means.extend(data[0][metric]) - #for mean in data[1][metric]: - #print "dev", numpy.std(data[1][metric]), "from mean", data[1][metric] - devs.append(numpy.std(data[1][metric])) - for test in self.testlist: - if testname in test: - #print "\n testname:", self.testlist, " \n \n test:", test - if (test[testname]['robot'] not in self.testnames): - self.testnames.append(test[testname]['robot']) - #print "------------------------\n testnames:", testnames, "\n", self.testnames - - - # print("show") - # print testnames - # print self.metric - # print plotdata - y_pos = numpy.arange(len(self.testnames)) - # print "x", y_pos - # print "y", means - # print "yerr", devs - - # plt.bar(y_pos, means, yerr=devs, alpha=0.5, color='red') - # plt.xticks(y_pos+0.8/2, testnames, rotation='vertical') - # plt.title(metric) - # plt.tight_layout() - + (y_pos, means, devs) = self.calculate_data(metric) axarr[counter].bar(y_pos, means, yerr=devs, alpha=0.5, color='red') rects = axarr[counter].bar(y_pos, means, yerr=devs, alpha=0.5, color='red') axarr[counter].set_title(metric) @@ -163,34 +129,7 @@ def show_results(self, all): else: print self.metric for metric in self.metric: - means = [] - devs = [] - for testname, data in self.tests.iteritems(): - # print "-------------------------------------------" - # print testname - # print "\n data: ", data - # print "mean: ",data[0][metric] - # print "values: ", data[1][metric] - means.extend(data[0][metric]) - #for mean in data[1][metric]: - #print "dev", numpy.std(data[1][metric]), "from mean", data[1][metric] - devs.append(numpy.std(data[1][metric])) - for test in self.testlist: - if testname in test: - #print "\n testname:", self.testlist, " \n \n test:", test - if (test[testname]['robot'] not in self.testnames): - self.testnames.append(test[testname]['robot']) - - - # print("show") - # print testnames - # print self.metric - # print plotdata - y_pos = numpy.arange(len(self.testnames)) - # print "x", y_pos - # print "y", means - # print "yerr", devs - + (y_pos, means, devs) = self.calculate_data(metric) plt.bar(y_pos, means, yerr=devs, alpha=0.5, color='red') rects = plt.bar(y_pos, means, yerr=devs, alpha=0.5, color='red') for rect in rects: @@ -204,6 +143,36 @@ def show_results(self, all): plt.tight_layout() plt.show() + def calculate_data(self, metric): + means = [] + devs = [] + for testname, data in self.tests.iteritems(): + # print "-------------------------------------------" + # print testname + # print "\n data: ", data + # print "mean: ",data[0][metric] + # print "values: ", data[1][metric] + means.extend(data[0][metric]) + #for mean in data[1][metric]: + #print "dev", numpy.std(data[1][metric]), "from mean", data[1][metric] + devs.append(numpy.std(data[1][metric])) + for test in self.testlist: + if testname in test: + #print "\n testname:", self.testlist, " \n \n test:", test + if (test[testname]['robot'] not in self.testnames): + self.testnames.append(test[testname]['robot']) + + + # print("show") + # print testnames + # print self.metric + # print plotdata + y_pos = numpy.arange(len(self.testnames)) + # print "y pos", y_pos + # print "height", means + # print "deviation", devs + return (y_pos, means, devs) + if __name__ == '__main__': parser = optparse.OptionParser() parser.add_option('-a', '--all', dest='all', help='Print all plots in one Window', default=False, action="store_true") From 3d1502dd52b726a69b4cb91495bbd1c76ead8711 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Wed, 22 Mar 2017 16:38:44 +0100 Subject: [PATCH 18/26] overnight test --- .gitignore | 1 + atf_presenter/scripts/presenter.py | 15 ++++--- .../atf_recorder_plugins/plugin_resources.py | 4 +- hannes_test/config/robots/part100_250mm.yaml | 13 +++--- .../config/robots/part100_250mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/part100_350mm.yaml | 13 +++--- .../config/robots/part100_350mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/part100_500mm.yaml | 15 ++++--- .../config/robots/part100_500mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/part100_600mm.yaml | 12 ----- hannes_test/config/robots/part100_750mm.yaml | 13 +++--- .../config/robots/part100_750mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/part150_250mm.yaml | 13 +++--- .../config/robots/part150_250mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/part150_350mm.yaml | 13 +++--- .../config/robots/part150_350mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/part150_500mm.yaml | 15 ++++--- .../config/robots/part150_500mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/part150_600mm.yaml | 12 ----- hannes_test/config/robots/part150_750mm.yaml | 13 +++--- .../config/robots/part150_750mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/part200_250mm.yaml | 12 ----- hannes_test/config/robots/part200_350mm.yaml | 12 ----- hannes_test/config/robots/part200_500mm.yaml | 12 ----- hannes_test/config/robots/part200_600mm.yaml | 12 ----- hannes_test/config/robots/part200_750mm.yaml | 12 ----- hannes_test/config/robots/part75_250mm.yaml | 13 +++--- .../config/robots/part75_250mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/part75_350mm.yaml | 13 +++--- .../config/robots/part75_350mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/part75_500mm.yaml | 13 +++--- .../config/robots/part75_500mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/part75_600mm.yaml | 12 ----- hannes_test/config/robots/part75_750mm.yaml | 13 +++--- .../config/robots/part75_750mm_ndtmatch.yaml | 13 ++++++ hannes_test/config/robots/robot1.yaml | 12 ----- hannes_test/config/robots/robot2.yaml | 7 --- hannes_test/config/robots/robot3.yaml | 12 ----- hannes_test/config/test_configs/test1.yaml | 3 ++ .../config/test_generation_config.yaml | 2 +- hannes_test/config/test_suites.yaml | 22 +++++++++- hannes_test/launch/application.launch | 6 +-- hannes_test/launch/application_slam.launch | 44 +++++++++++++++++++ 43 files changed, 324 insertions(+), 216 deletions(-) create mode 100644 hannes_test/config/robots/part100_250mm_ndtmatch.yaml create mode 100644 hannes_test/config/robots/part100_350mm_ndtmatch.yaml create mode 100644 hannes_test/config/robots/part100_500mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part100_600mm.yaml create mode 100644 hannes_test/config/robots/part100_750mm_ndtmatch.yaml create mode 100644 hannes_test/config/robots/part150_250mm_ndtmatch.yaml create mode 100644 hannes_test/config/robots/part150_350mm_ndtmatch.yaml create mode 100644 hannes_test/config/robots/part150_500mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part150_600mm.yaml create mode 100644 hannes_test/config/robots/part150_750mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part200_250mm.yaml delete mode 100644 hannes_test/config/robots/part200_350mm.yaml delete mode 100644 hannes_test/config/robots/part200_500mm.yaml delete mode 100644 hannes_test/config/robots/part200_600mm.yaml delete mode 100644 hannes_test/config/robots/part200_750mm.yaml create mode 100644 hannes_test/config/robots/part75_250mm_ndtmatch.yaml create mode 100644 hannes_test/config/robots/part75_350mm_ndtmatch.yaml create mode 100644 hannes_test/config/robots/part75_500mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part75_600mm.yaml create mode 100644 hannes_test/config/robots/part75_750mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/robot1.yaml delete mode 100644 hannes_test/config/robots/robot2.yaml delete mode 100644 hannes_test/config/robots/robot3.yaml create mode 100644 hannes_test/launch/application_slam.launch diff --git a/.gitignore b/.gitignore index bc300f2d..17e5da2d 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ qtcreator-* /planning/src *~ +*.orig # Emacs .#* diff --git a/atf_presenter/scripts/presenter.py b/atf_presenter/scripts/presenter.py index b304b0cf..96a4de1d 100755 --- a/atf_presenter/scripts/presenter.py +++ b/atf_presenter/scripts/presenter.py @@ -91,9 +91,9 @@ def extract_yaml(self, num): vals = [avg, numvals] #print "values", vals self.tests.update({str(num): vals}) - print "-------------------------------------------------" - print ("tests:", self.tests) - print "-------------------------------------------------" + # print "-------------------------------------------------" + # print "tests:\n", self.tests + # print "-------------------------------------------------" def import_testnames(self, file): with open(file, 'r') as stream: @@ -146,9 +146,11 @@ def show_results(self, all): def calculate_data(self, metric): means = [] devs = [] - for testname, data in self.tests.iteritems(): + for testname in sorted(self.tests, key=lambda ts : int(ts.split('_')[2].replace('r', ''))): # Magic! + data = self.tests[testname] # print "-------------------------------------------" # print testname + # print sorted(self.tests, key=lambda ts : int(ts.split('_')[2].replace('r', ''))) # print "\n data: ", data # print "mean: ",data[0][metric] # print "values: ", data[1][metric] @@ -157,12 +159,11 @@ def calculate_data(self, metric): #print "dev", numpy.std(data[1][metric]), "from mean", data[1][metric] devs.append(numpy.std(data[1][metric])) for test in self.testlist: + #print "\n-------------------\ntest:", test, "\ntestname:", testname, "\n data: \n", data if testname in test: #print "\n testname:", self.testlist, " \n \n test:", test if (test[testname]['robot'] not in self.testnames): self.testnames.append(test[testname]['robot']) - - # print("show") # print testnames # print self.metric @@ -179,7 +180,7 @@ def calculate_data(self, metric): (options, args) = parser.parse_args() p = presenter() - Path = "/tmp/hannes_test_new/results_yaml/" + Path = "/home/fmw-hb/Desktop/hannes_test_new/results_yaml/"#"/tmp/hannes_test_new/results_yaml/" filelist = os.listdir(Path) p.import_testnames(Path.replace('yaml', 'json')+"test_list.json") diff --git a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py index b4f8b1c1..ec9d2a0a 100755 --- a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py +++ b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py @@ -14,7 +14,7 @@ class RecordResources: def __init__(self, write_lock, bag_file_writer): self.topic_prefix = "atf/" - file = "/home/fmw-hb/workshop_catkin_ws/src/msh_test/hannes_test_msh/config/test_configs/test2.yaml" + file = "/home/fmw-hb/atf_catkin_ws/src/atf/hannes_test/config/test_configs/test1.yaml" with open(file, 'r') as stream: self.test_config = yaml.load(stream) @@ -174,4 +174,4 @@ def get_pid(name): pass rospy.logerr("Node '" + name + "' is not running!") - return None \ No newline at end of file + return None diff --git a/hannes_test/config/robots/part100_250mm.yaml b/hannes_test/config/robots/part100_250mm.yaml index 0b0ca2da..664d9d6c 100644 --- a/hannes_test/config/robots/part100_250mm.yaml +++ b/hannes_test/config/robots/part100_250mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "/use_sim_time": true +additional_arguments: "int_res": 0.25 "part_num": 100 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part100_250mm_ndtmatch.yaml b/hannes_test/config/robots/part100_250mm_ndtmatch.yaml new file mode 100644 index 00000000..784db212 --- /dev/null +++ b/hannes_test/config/robots/part100_250mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.25 + "part_num": 100 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part100_350mm.yaml b/hannes_test/config/robots/part100_350mm.yaml index a6b4585b..f23d8e32 100644 --- a/hannes_test/config/robots/part100_350mm.yaml +++ b/hannes_test/config/robots/part100_350mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "/use_sim_time": true +additional_arguments: "int_res": 0.35 "part_num": 100 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part100_350mm_ndtmatch.yaml b/hannes_test/config/robots/part100_350mm_ndtmatch.yaml new file mode 100644 index 00000000..c0313371 --- /dev/null +++ b/hannes_test/config/robots/part100_350mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part100_500mm.yaml b/hannes_test/config/robots/part100_500mm.yaml index 57a1d6fe..17c3e3b8 100644 --- a/hannes_test/config/robots/part100_500mm.yaml +++ b/hannes_test/config/robots/part100_500mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 0.50 + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 "part_num": 100 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part100_500mm_ndtmatch.yaml b/hannes_test/config/robots/part100_500mm_ndtmatch.yaml new file mode 100644 index 00000000..480837c7 --- /dev/null +++ b/hannes_test/config/robots/part100_500mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 100 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part100_600mm.yaml b/hannes_test/config/robots/part100_600mm.yaml deleted file mode 100644 index 359d07a8..00000000 --- a/hannes_test/config/robots/part100_600mm.yaml +++ /dev/null @@ -1,12 +0,0 @@ -path_length: # Topics for the metric 'path_length' - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test -additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 0.60 - "part_num": 100 diff --git a/hannes_test/config/robots/part100_750mm.yaml b/hannes_test/config/robots/part100_750mm.yaml index 2496114a..0795f1c8 100644 --- a/hannes_test/config/robots/part100_750mm.yaml +++ b/hannes_test/config/robots/part100_750mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "/use_sim_time": true +additional_arguments: "int_res": 0.75 "part_num": 100 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part100_750mm_ndtmatch.yaml b/hannes_test/config/robots/part100_750mm_ndtmatch.yaml new file mode 100644 index 00000000..524cd0ba --- /dev/null +++ b/hannes_test/config/robots/part100_750mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.75 + "part_num": 100 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part150_250mm.yaml b/hannes_test/config/robots/part150_250mm.yaml index 7d58c76c..5f17a4de 100644 --- a/hannes_test/config/robots/part150_250mm.yaml +++ b/hannes_test/config/robots/part150_250mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "/use_sim_time": true +additional_arguments: "int_res": 0.25 "part_num": 150 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part150_250mm_ndtmatch.yaml b/hannes_test/config/robots/part150_250mm_ndtmatch.yaml new file mode 100644 index 00000000..65b24cc0 --- /dev/null +++ b/hannes_test/config/robots/part150_250mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.25 + "part_num": 150 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part150_350mm.yaml b/hannes_test/config/robots/part150_350mm.yaml index 05447f8e..dd7ce450 100644 --- a/hannes_test/config/robots/part150_350mm.yaml +++ b/hannes_test/config/robots/part150_350mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "/use_sim_time": true +additional_arguments: "int_res": 0.35 "part_num": 150 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part150_350mm_ndtmatch.yaml b/hannes_test/config/robots/part150_350mm_ndtmatch.yaml new file mode 100644 index 00000000..6a08a30c --- /dev/null +++ b/hannes_test/config/robots/part150_350mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 150 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part150_500mm.yaml b/hannes_test/config/robots/part150_500mm.yaml index 8597c2f1..adb28ed3 100644 --- a/hannes_test/config/robots/part150_500mm.yaml +++ b/hannes_test/config/robots/part150_500mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 0.50 + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 "part_num": 150 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part150_500mm_ndtmatch.yaml b/hannes_test/config/robots/part150_500mm_ndtmatch.yaml new file mode 100644 index 00000000..7d9953c7 --- /dev/null +++ b/hannes_test/config/robots/part150_500mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 150 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part150_600mm.yaml b/hannes_test/config/robots/part150_600mm.yaml deleted file mode 100644 index 525eb0c8..00000000 --- a/hannes_test/config/robots/part150_600mm.yaml +++ /dev/null @@ -1,12 +0,0 @@ -path_length: # Topics for the metric 'path_length' - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test -additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 0.60 - "part_num": 150 diff --git a/hannes_test/config/robots/part150_750mm.yaml b/hannes_test/config/robots/part150_750mm.yaml index 1b554ac6..fe99b80a 100644 --- a/hannes_test/config/robots/part150_750mm.yaml +++ b/hannes_test/config/robots/part150_750mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "/use_sim_time": true +additional_arguments: "int_res": 0.75 "part_num": 150 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part150_750mm_ndtmatch.yaml b/hannes_test/config/robots/part150_750mm_ndtmatch.yaml new file mode 100644 index 00000000..75332eb2 --- /dev/null +++ b/hannes_test/config/robots/part150_750mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.75 + "part_num": 150 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part200_250mm.yaml b/hannes_test/config/robots/part200_250mm.yaml deleted file mode 100644 index 45728702..00000000 --- a/hannes_test/config/robots/part200_250mm.yaml +++ /dev/null @@ -1,12 +0,0 @@ -path_length: # Topics for the metric 'path_length' - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test -additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 0.250 - "part_num": 200 diff --git a/hannes_test/config/robots/part200_350mm.yaml b/hannes_test/config/robots/part200_350mm.yaml deleted file mode 100644 index 85347f59..00000000 --- a/hannes_test/config/robots/part200_350mm.yaml +++ /dev/null @@ -1,12 +0,0 @@ -path_length: # Topics for the metric 'path_length' - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test -additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 0.350 - "part_num": 200 diff --git a/hannes_test/config/robots/part200_500mm.yaml b/hannes_test/config/robots/part200_500mm.yaml deleted file mode 100644 index 44aeaa67..00000000 --- a/hannes_test/config/robots/part200_500mm.yaml +++ /dev/null @@ -1,12 +0,0 @@ -path_length: # Topics for the metric 'path_length' - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test -additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 0.50 - "part_num": 200 diff --git a/hannes_test/config/robots/part200_600mm.yaml b/hannes_test/config/robots/part200_600mm.yaml deleted file mode 100644 index 5096c621..00000000 --- a/hannes_test/config/robots/part200_600mm.yaml +++ /dev/null @@ -1,12 +0,0 @@ -path_length: # Topics for the metric 'path_length' - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test -additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 0.60 - "part_num": 200 diff --git a/hannes_test/config/robots/part200_750mm.yaml b/hannes_test/config/robots/part200_750mm.yaml deleted file mode 100644 index e7bb2040..00000000 --- a/hannes_test/config/robots/part200_750mm.yaml +++ /dev/null @@ -1,12 +0,0 @@ -path_length: # Topics for the metric 'path_length' - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test -additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 0.75 - "part_num": 200 diff --git a/hannes_test/config/robots/part75_250mm.yaml b/hannes_test/config/robots/part75_250mm.yaml index c1b32d06..ecfade8a 100644 --- a/hannes_test/config/robots/part75_250mm.yaml +++ b/hannes_test/config/robots/part75_250mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "/use_sim_time": true +additional_arguments: "int_res": 0.25 "part_num": 75 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part75_250mm_ndtmatch.yaml b/hannes_test/config/robots/part75_250mm_ndtmatch.yaml new file mode 100644 index 00000000..a2b6bde1 --- /dev/null +++ b/hannes_test/config/robots/part75_250mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.25 + "part_num": 75 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part75_350mm.yaml b/hannes_test/config/robots/part75_350mm.yaml index 466feef9..32b08ba3 100644 --- a/hannes_test/config/robots/part75_350mm.yaml +++ b/hannes_test/config/robots/part75_350mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "/use_sim_time": true +additional_arguments: "int_res": 0.35 "part_num": 75 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part75_350mm_ndtmatch.yaml b/hannes_test/config/robots/part75_350mm_ndtmatch.yaml new file mode 100644 index 00000000..b1f1e4d0 --- /dev/null +++ b/hannes_test/config/robots/part75_350mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 75 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part75_500mm.yaml b/hannes_test/config/robots/part75_500mm.yaml index 1807ecbf..1c125b74 100644 --- a/hannes_test/config/robots/part75_500mm.yaml +++ b/hannes_test/config/robots/part75_500mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "/use_sim_time": true +additional_arguments: "int_res": 0.5 "part_num": 75 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part75_500mm_ndtmatch.yaml b/hannes_test/config/robots/part75_500mm_ndtmatch.yaml new file mode 100644 index 00000000..364fae8d --- /dev/null +++ b/hannes_test/config/robots/part75_500mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 75 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part75_600mm.yaml b/hannes_test/config/robots/part75_600mm.yaml deleted file mode 100644 index 5edfb85f..00000000 --- a/hannes_test/config/robots/part75_600mm.yaml +++ /dev/null @@ -1,12 +0,0 @@ -path_length: # Topics for the metric 'path_length' - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test -additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 0.6 - "part_num": 75 diff --git a/hannes_test/config/robots/part75_750mm.yaml b/hannes_test/config/robots/part75_750mm.yaml index 9db4bece..83e3711e 100644 --- a/hannes_test/config/robots/part75_750mm.yaml +++ b/hannes_test/config/robots/part75_750mm.yaml @@ -1,12 +1,13 @@ -path_length: # Topics for the metric 'path_length' +path_length: topics: - "/tf" - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file + "/use_sim_time": true +additional_arguments: "int_res": 0.75 "part_num": 75 + "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part75_750mm_ndtmatch.yaml b/hannes_test/config/robots/part75_750mm_ndtmatch.yaml new file mode 100644 index 00000000..1ff1ea04 --- /dev/null +++ b/hannes_test/config/robots/part75_750mm_ndtmatch.yaml @@ -0,0 +1,13 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.75 + "part_num": 75 + "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/robot1.yaml b/hannes_test/config/robots/robot1.yaml deleted file mode 100644 index 5aa18733..00000000 --- a/hannes_test/config/robots/robot1.yaml +++ /dev/null @@ -1,12 +0,0 @@ -path_length: # Topics for the metric 'path_length' - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test -additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 0.2 - "part_num": 100 diff --git a/hannes_test/config/robots/robot2.yaml b/hannes_test/config/robots/robot2.yaml deleted file mode 100644 index 636d86e2..00000000 --- a/hannes_test/config/robots/robot2.yaml +++ /dev/null @@ -1,7 +0,0 @@ -path_length: # Topics for the metric 'path_length' - topics: - - "/tf" -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test -additional_parameter: [] # Name and value of additional parameter which will be included in every recording test file -additional_arguments: [] # Name and value of additional arguments which will be included in every recording test file diff --git a/hannes_test/config/robots/robot3.yaml b/hannes_test/config/robots/robot3.yaml deleted file mode 100644 index f5d02d45..00000000 --- a/hannes_test/config/robots/robot3.yaml +++ /dev/null @@ -1,12 +0,0 @@ -path_length: # Topics for the metric 'path_length' - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" # Path to the robot bringup launch file -wait_for_topics: [] # Names of the topics to wait for before beginning the test -wait_for_services: [] # Names of the services to wait for before beginning the test -additional_parameters: - "/use_sim_time": true # Name and value of additional parameter which will be included in every recording test file -additional_arguments: # Name and value of additional arguments which will be included in every recording test file - "int_res": 1.2 - "part_num": 10 diff --git a/hannes_test/config/test_configs/test1.yaml b/hannes_test/config/test_configs/test1.yaml index 1765da5d..a5fa2c3c 100644 --- a/hannes_test/config/test_configs/test1.yaml +++ b/hannes_test/config/test_configs/test1.yaml @@ -14,5 +14,8 @@ testblock_small: measured_frame: base_link groundtruth: 0.0 groundtruth_epsilon: 2.0 + resource_cpu: + - nodes: + - slam # testblock_all empty diff --git a/hannes_test/config/test_generation_config.yaml b/hannes_test/config/test_generation_config.yaml index a676e454..e10ca1fc 100644 --- a/hannes_test/config/test_generation_config.yaml +++ b/hannes_test/config/test_generation_config.yaml @@ -2,7 +2,7 @@ suites_file: config/test_suites.yaml # Path of th test_config_path: config/test_configs # Path of the test_config file robot_config_path: config/robots # Folder which contains the robot_config files robot_env_config_path: config/robot_envs # Folder which contains the robot_env_config files -repetitions: 10 # Number of repetitions per test +repetitions: 3 # Number of repetitions per test app_executable: application.py # Name of the application's executable file additional_launch_file: launch/application.launch # Path of the additional launch file diff --git a/hannes_test/config/test_suites.yaml b/hannes_test/config/test_suites.yaml index bb69efa7..8cba8749 100644 --- a/hannes_test/config/test_suites.yaml +++ b/hannes_test/config/test_suites.yaml @@ -3,11 +3,29 @@ testsuite_1: test_configs: # You have to define at least one test_config - test1 robots: # You have to define at least one robot + - part75_250mm_ndtmatch + - part75_350mm_ndtmatch + - part75_500mm_ndtmatch + - part75_750mm_ndtmatch + - part100_250mm_ndtmatch + - part100_350mm_ndtmatch + - part100_500mm_ndtmatch + - part100_750mm_ndtmatch + - part150_250mm_ndtmatch + - part150_350mm_ndtmatch + - part150_500mm_ndtmatch + - part150_750mm_ndtmatch - part75_250mm + - part75_350mm + - part75_500mm + - part75_750mm + - part100_250mm - part100_350mm + - part100_500mm + - part100_750mm + - part150_250mm - part150_350mm - part150_500mm - - part200_600mm - + - part150_750mm robot_envs: # You have to define at least one robot_env - env1 diff --git a/hannes_test/launch/application.launch b/hannes_test/launch/application.launch index af715534..f9b229af 100644 --- a/hannes_test/launch/application.launch +++ b/hannes_test/launch/application.launch @@ -12,15 +12,15 @@ - + - + diff --git a/hannes_test/launch/application_slam.launch b/hannes_test/launch/application_slam.launch new file mode 100644 index 00000000..bf6a9d8e --- /dev/null +++ b/hannes_test/launch/application_slam.launch @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9aa055201d5645c879ae1a4aa72e32cc191d67d2 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Fri, 24 Mar 2017 13:12:32 +0100 Subject: [PATCH 19/26] add robots maker --- hannes_test/scripts/robots_maker.py | 59 +++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 hannes_test/scripts/robots_maker.py diff --git a/hannes_test/scripts/robots_maker.py b/hannes_test/scripts/robots_maker.py new file mode 100755 index 00000000..328723fb --- /dev/null +++ b/hannes_test/scripts/robots_maker.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python + +import rospy +import tf +import math +import yaml +import os.path + +class robot_maker(): + def __init__(self): + self.int_res = [0.25, 0.35, 0.5, 0.75] #[0.25, 0.35, 0.5, 0.6, 0.75, 1.0, 1.5] + self.part_num = [50, 75, 100, 150, 200] #[25, 50, 75, 100, 150, 200, 500] + self.ndt_match = ["false", "true"] + self.file_path = "/home/fmw-hb/Desktop/robots/" #'/home/fmw-hb/atf_catkin_ws/src/atf/hannes_test/config/robots/' + self.robots = "" + + + def make_robots(self): + for part in self.part_num: + for res in self.int_res: + for ndt in self.ndt_match: + if(ndt == "true"): + filename = "part"+str(part)+"_"+str(int(res*1000))+"mm_ndtmatch" + else: + filename = "part"+str(part)+"_"+str(int(res*1000))+"mm" + # save everything in the file + #with open(self.file_path+filename, 'w') as stream: + #print "Path: "+self.file_path+filename + print filename + robot = open(self.file_path+filename+".yaml", 'w') + robot.write("path_length:\n topics:\n - \"/tf\"\n - \"/scan_unified\"\nrobot_bringup_launch: \"launch/all.launch\"\nwait_for_topics: []\nwait_for_services: []\n" + "additional_parameters:\n \"/use_sim_time\": true\n" + "additional_arguments:\n \"int_res\": "+str(res)+"\n \"part_num\": "+str(part)+"\n \"ndt_match\": "+ndt) + # stream.write(yaml.dump({'path_length': {'topics': [{'"/tf"', '"/scan_unified"'}] + # 'robot_bringup_launch': '"launch/all.launch"' + # 'wait_for_topics': '[]' + # 'wait_for_services': '[]' + # 'additional_parameters': + # '"/use_sim_time"': true + # additional_arguments: + # "int_res": 0.35 + # "part_num": 75 + # "ndt_match": true}, default_flow_style=False)) + self.robots = self.robots + "\n" + " - " + filename + + meta = open(self.file_path+"robots", 'wa') + meta.write(self.robots) + + + + + + +if __name__ == '__main__': + try: + RM = robot_maker() + RM.make_robots() + except rospy.ROSInterruptException: + pass From 5128a5cd9c33ca11001c5acc41550ee6a3717f2e Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Thu, 4 May 2017 16:28:57 +0200 Subject: [PATCH 20/26] added parameters gain, counter, mapping und shortterm map gain --- atf_presenter/scripts/presenter.py | 43 ++++++------ .../atf_recorder_plugins/plugin_resources.py | 2 +- hannes_test/config/robots/part100_250mm.yaml | 13 ---- .../config/robots/part100_250mm_ndtmatch.yaml | 13 ---- hannes_test/config/robots/part100_350mm.yaml | 13 ---- .../config/robots/part100_350mm_ndtmatch.yaml | 13 ---- hannes_test/config/robots/part100_500mm.yaml | 13 ---- .../config/robots/part100_500mm_ndtmatch.yaml | 13 ---- hannes_test/config/robots/part100_750mm.yaml | 13 ---- .../config/robots/part100_750mm_ndtmatch.yaml | 13 ---- hannes_test/config/robots/part150_250mm.yaml | 13 ---- .../config/robots/part150_250mm_ndtmatch.yaml | 13 ---- hannes_test/config/robots/part150_350mm.yaml | 13 ---- .../config/robots/part150_350mm_ndtmatch.yaml | 13 ---- hannes_test/config/robots/part150_500mm.yaml | 13 ---- .../config/robots/part150_500mm_ndtmatch.yaml | 13 ---- hannes_test/config/robots/part150_750mm.yaml | 13 ---- .../config/robots/part150_750mm_ndtmatch.yaml | 13 ---- hannes_test/config/robots/part75_250mm.yaml | 13 ---- .../config/robots/part75_250mm_ndtmatch.yaml | 13 ---- hannes_test/config/robots/part75_350mm.yaml | 13 ---- .../config/robots/part75_350mm_ndtmatch.yaml | 13 ---- hannes_test/config/robots/part75_500mm.yaml | 13 ---- .../config/robots/part75_500mm_ndtmatch.yaml | 13 ---- hannes_test/config/robots/part75_750mm.yaml | 13 ---- .../config/robots/part75_750mm_ndtmatch.yaml | 13 ---- .../config/test_generation_config.yaml | 10 +-- hannes_test/config/test_suites.yaml | 40 +++++------ hannes_test/launch/application.launch | 11 +++- hannes_test/scripts/application.py | 34 +++++----- hannes_test/scripts/robots_maker.py | 66 ++++++++++--------- 31 files changed, 106 insertions(+), 412 deletions(-) delete mode 100644 hannes_test/config/robots/part100_250mm.yaml delete mode 100644 hannes_test/config/robots/part100_250mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part100_350mm.yaml delete mode 100644 hannes_test/config/robots/part100_350mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part100_500mm.yaml delete mode 100644 hannes_test/config/robots/part100_500mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part100_750mm.yaml delete mode 100644 hannes_test/config/robots/part100_750mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part150_250mm.yaml delete mode 100644 hannes_test/config/robots/part150_250mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part150_350mm.yaml delete mode 100644 hannes_test/config/robots/part150_350mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part150_500mm.yaml delete mode 100644 hannes_test/config/robots/part150_500mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part150_750mm.yaml delete mode 100644 hannes_test/config/robots/part150_750mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part75_250mm.yaml delete mode 100644 hannes_test/config/robots/part75_250mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part75_350mm.yaml delete mode 100644 hannes_test/config/robots/part75_350mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part75_500mm.yaml delete mode 100644 hannes_test/config/robots/part75_500mm_ndtmatch.yaml delete mode 100644 hannes_test/config/robots/part75_750mm.yaml delete mode 100644 hannes_test/config/robots/part75_750mm_ndtmatch.yaml diff --git a/atf_presenter/scripts/presenter.py b/atf_presenter/scripts/presenter.py index 96a4de1d..3140c023 100755 --- a/atf_presenter/scripts/presenter.py +++ b/atf_presenter/scripts/presenter.py @@ -105,8 +105,24 @@ def import_testnames(self, file): # self.testnames.append(robot[1]['robot']) self.testlist = yaml.load(stream) - def show_results(self, all): - if(all): + def show_results(self, single): + if(single): + print self.metric + for metric in self.metric: + (y_pos, means, devs) = self.calculate_data(metric) + plt.bar(y_pos, means, yerr=devs, alpha=0.5, color='red') + rects = plt.bar(y_pos, means, yerr=devs, alpha=0.5, color='red') + for rect in rects: + height = rect.get_height() + plt.text(rect.get_x() + rect.get_width()/2., 1.05*height, + '%.1f' % round(height, 1), + ha='center', va='bottom') + plt.xticks(y_pos+0.8/2, self.testnames, rotation='vertical') + plt.title(metric) + plt.tight_layout() + plt.tight_layout() + plt.show() + else: self.metric.remove('time') #print "metric: ",self.metric counter = 0 @@ -126,22 +142,7 @@ def show_results(self, all): counter += 1 plt.tight_layout() plt.show() - else: - print self.metric - for metric in self.metric: - (y_pos, means, devs) = self.calculate_data(metric) - plt.bar(y_pos, means, yerr=devs, alpha=0.5, color='red') - rects = plt.bar(y_pos, means, yerr=devs, alpha=0.5, color='red') - for rect in rects: - height = rect.get_height() - plt.text(rect.get_x() + rect.get_width()/2., 1.05*height, - '%.1f' % round(height, 1), - ha='center', va='bottom') - plt.xticks(y_pos+0.8/2, self.testnames, rotation='vertical') - plt.title(metric) - plt.tight_layout() - plt.tight_layout() - plt.show() + def calculate_data(self, metric): means = [] @@ -176,11 +177,11 @@ def calculate_data(self, metric): if __name__ == '__main__': parser = optparse.OptionParser() - parser.add_option('-a', '--all', dest='all', help='Print all plots in one Window', default=False, action="store_true") + parser.add_option('-s', '--single', dest='single', help='Print all plots in single windows', default=False, action="store_true") (options, args) = parser.parse_args() p = presenter() - Path = "/home/fmw-hb/Desktop/hannes_test_new/results_yaml/"#"/tmp/hannes_test_new/results_yaml/" + Path = "/home/fmw-hb/Documents/hannes_test_load/results_yaml/"#"/home/fmw-hb/Desktop/hannes_test_shortterm/results_yaml/"#"/tmp/hannes_test_new/results_yaml/" filelist = os.listdir(Path) p.import_testnames(Path.replace('yaml', 'json')+"test_list.json") @@ -190,4 +191,4 @@ def calculate_data(self, metric): p.import_yaml(Path+file) filename = file.replace('.yaml', '') p.extract_yaml(filename.replace('merged_', '')) - p.show_results(options.all) + p.show_results(options.single) diff --git a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py index ec9d2a0a..6c49309d 100755 --- a/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py +++ b/atf_recorder_plugins/src/atf_recorder_plugins/plugin_resources.py @@ -95,7 +95,7 @@ def collect_resource_data(self, event): #print "message node:", node, "pid:", pid try: msg_data.node_name = node - print "node:", node, "pid:", pid + #print "node:", node, "pid:", pid msg_data.cpu = psutil.Process(pid).get_cpu_percent(interval=self.timer_interval) diff --git a/hannes_test/config/robots/part100_250mm.yaml b/hannes_test/config/robots/part100_250mm.yaml deleted file mode 100644 index 664d9d6c..00000000 --- a/hannes_test/config/robots/part100_250mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.25 - "part_num": 100 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part100_250mm_ndtmatch.yaml b/hannes_test/config/robots/part100_250mm_ndtmatch.yaml deleted file mode 100644 index 784db212..00000000 --- a/hannes_test/config/robots/part100_250mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.25 - "part_num": 100 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part100_350mm.yaml b/hannes_test/config/robots/part100_350mm.yaml deleted file mode 100644 index f23d8e32..00000000 --- a/hannes_test/config/robots/part100_350mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.35 - "part_num": 100 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part100_350mm_ndtmatch.yaml b/hannes_test/config/robots/part100_350mm_ndtmatch.yaml deleted file mode 100644 index c0313371..00000000 --- a/hannes_test/config/robots/part100_350mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.35 - "part_num": 100 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part100_500mm.yaml b/hannes_test/config/robots/part100_500mm.yaml deleted file mode 100644 index 17c3e3b8..00000000 --- a/hannes_test/config/robots/part100_500mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.5 - "part_num": 100 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part100_500mm_ndtmatch.yaml b/hannes_test/config/robots/part100_500mm_ndtmatch.yaml deleted file mode 100644 index 480837c7..00000000 --- a/hannes_test/config/robots/part100_500mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.5 - "part_num": 100 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part100_750mm.yaml b/hannes_test/config/robots/part100_750mm.yaml deleted file mode 100644 index 0795f1c8..00000000 --- a/hannes_test/config/robots/part100_750mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.75 - "part_num": 100 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part100_750mm_ndtmatch.yaml b/hannes_test/config/robots/part100_750mm_ndtmatch.yaml deleted file mode 100644 index 524cd0ba..00000000 --- a/hannes_test/config/robots/part100_750mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.75 - "part_num": 100 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part150_250mm.yaml b/hannes_test/config/robots/part150_250mm.yaml deleted file mode 100644 index 5f17a4de..00000000 --- a/hannes_test/config/robots/part150_250mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.25 - "part_num": 150 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part150_250mm_ndtmatch.yaml b/hannes_test/config/robots/part150_250mm_ndtmatch.yaml deleted file mode 100644 index 65b24cc0..00000000 --- a/hannes_test/config/robots/part150_250mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.25 - "part_num": 150 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part150_350mm.yaml b/hannes_test/config/robots/part150_350mm.yaml deleted file mode 100644 index dd7ce450..00000000 --- a/hannes_test/config/robots/part150_350mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.35 - "part_num": 150 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part150_350mm_ndtmatch.yaml b/hannes_test/config/robots/part150_350mm_ndtmatch.yaml deleted file mode 100644 index 6a08a30c..00000000 --- a/hannes_test/config/robots/part150_350mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.35 - "part_num": 150 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part150_500mm.yaml b/hannes_test/config/robots/part150_500mm.yaml deleted file mode 100644 index adb28ed3..00000000 --- a/hannes_test/config/robots/part150_500mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.5 - "part_num": 150 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part150_500mm_ndtmatch.yaml b/hannes_test/config/robots/part150_500mm_ndtmatch.yaml deleted file mode 100644 index 7d9953c7..00000000 --- a/hannes_test/config/robots/part150_500mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.5 - "part_num": 150 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part150_750mm.yaml b/hannes_test/config/robots/part150_750mm.yaml deleted file mode 100644 index fe99b80a..00000000 --- a/hannes_test/config/robots/part150_750mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.75 - "part_num": 150 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part150_750mm_ndtmatch.yaml b/hannes_test/config/robots/part150_750mm_ndtmatch.yaml deleted file mode 100644 index 75332eb2..00000000 --- a/hannes_test/config/robots/part150_750mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.75 - "part_num": 150 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part75_250mm.yaml b/hannes_test/config/robots/part75_250mm.yaml deleted file mode 100644 index ecfade8a..00000000 --- a/hannes_test/config/robots/part75_250mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.25 - "part_num": 75 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part75_250mm_ndtmatch.yaml b/hannes_test/config/robots/part75_250mm_ndtmatch.yaml deleted file mode 100644 index a2b6bde1..00000000 --- a/hannes_test/config/robots/part75_250mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.25 - "part_num": 75 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part75_350mm.yaml b/hannes_test/config/robots/part75_350mm.yaml deleted file mode 100644 index 32b08ba3..00000000 --- a/hannes_test/config/robots/part75_350mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.35 - "part_num": 75 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part75_350mm_ndtmatch.yaml b/hannes_test/config/robots/part75_350mm_ndtmatch.yaml deleted file mode 100644 index b1f1e4d0..00000000 --- a/hannes_test/config/robots/part75_350mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.35 - "part_num": 75 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part75_500mm.yaml b/hannes_test/config/robots/part75_500mm.yaml deleted file mode 100644 index 1c125b74..00000000 --- a/hannes_test/config/robots/part75_500mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.5 - "part_num": 75 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part75_500mm_ndtmatch.yaml b/hannes_test/config/robots/part75_500mm_ndtmatch.yaml deleted file mode 100644 index 364fae8d..00000000 --- a/hannes_test/config/robots/part75_500mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.5 - "part_num": 75 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/robots/part75_750mm.yaml b/hannes_test/config/robots/part75_750mm.yaml deleted file mode 100644 index 83e3711e..00000000 --- a/hannes_test/config/robots/part75_750mm.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.75 - "part_num": 75 - "ndt_match": false \ No newline at end of file diff --git a/hannes_test/config/robots/part75_750mm_ndtmatch.yaml b/hannes_test/config/robots/part75_750mm_ndtmatch.yaml deleted file mode 100644 index 1ff1ea04..00000000 --- a/hannes_test/config/robots/part75_750mm_ndtmatch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -path_length: - topics: - - "/tf" - - "/scan_unified" -robot_bringup_launch: "launch/all.launch" -wait_for_topics: [] -wait_for_services: [] -additional_parameters: - "/use_sim_time": true -additional_arguments: - "int_res": 0.75 - "part_num": 75 - "ndt_match": true \ No newline at end of file diff --git a/hannes_test/config/test_generation_config.yaml b/hannes_test/config/test_generation_config.yaml index e10ca1fc..3b9d0b94 100644 --- a/hannes_test/config/test_generation_config.yaml +++ b/hannes_test/config/test_generation_config.yaml @@ -7,14 +7,14 @@ repetitions: 3 # Number of repe app_executable: application.py # Name of the application's executable file additional_launch_file: launch/application.launch # Path of the additional launch file -bagfile_output: "/tmp/hannes_test_new/data/" # Folder for bagfile output -json_output: "/tmp/hannes_test_new/results_json/" # Folder for the json files output -yaml_output: "/tmp/hannes_test_new/results_yaml/" # Folder for the yaml files output +bagfile_output: "/home/fmw-hb/Desktop/hannes_test_/data/" # Folder for bagfile output +json_output: "/home/fmw-hb/Desktop/hannes_test_/results_json/" # Folder for the json files output +yaml_output: "/home/fmw-hb/Desktop/hannes_test_/results_yaml/" # Folder for the yaml files output speed_factor_analysis: 2.0 # Factor to speedup analysis (can lower accuracy if too fast, especially path_length) -time_limit_recording: 700.0 # Time limit in seconds for recording -time_limit_analysing: 700.0 # Time limit in seconds for analysing +time_limit_recording: 900.0 # Time limit in seconds for recording +time_limit_analysing: 500.0 # Time limit in seconds for analysing time_limit_uploading: 1000.0 # Time limit in seconds for uploading upload_data: false diff --git a/hannes_test/config/test_suites.yaml b/hannes_test/config/test_suites.yaml index 8cba8749..d093e54f 100644 --- a/hannes_test/config/test_suites.yaml +++ b/hannes_test/config/test_suites.yaml @@ -3,29 +3,21 @@ testsuite_1: test_configs: # You have to define at least one test_config - test1 robots: # You have to define at least one robot - - part75_250mm_ndtmatch - - part75_350mm_ndtmatch - - part75_500mm_ndtmatch - - part75_750mm_ndtmatch - - part100_250mm_ndtmatch - - part100_350mm_ndtmatch - - part100_500mm_ndtmatch - - part100_750mm_ndtmatch - - part150_250mm_ndtmatch - - part150_350mm_ndtmatch - - part150_500mm_ndtmatch - - part150_750mm_ndtmatch - - part75_250mm - - part75_350mm - - part75_500mm - - part75_750mm - - part100_250mm - - part100_350mm - - part100_500mm - - part100_750mm - - part150_250mm - - part150_350mm - - part150_500mm - - part150_750mm + - 0.5mapping_0.25overlaymap + - 1mapping_0.25overlaymap + - 5mapping_0.25overlaymap + - 10mapping_0.25overlaymap + - 0.5mapping_0.5overlaymap + - 1mapping_0.5overlaymap + - 5mapping_0.5overlaymap + - 10mapping_0.5overlaymap + - 0.5mapping_0.75overlaymap + - 1mapping_0.75overlaymap + - 5mapping_0.75overlaymap + - 10mapping_0.75overlaymap + - 0.5mapping_1.0overlaymap + - 1mapping_1.0overlaymap + - 5mapping_1.0overlaymap + - 10mapping_1.0overlaymap robot_envs: # You have to define at least one robot_env - env1 diff --git a/hannes_test/launch/application.launch b/hannes_test/launch/application.launch index f9b229af..847a9d25 100644 --- a/hannes_test/launch/application.launch +++ b/hannes_test/launch/application.launch @@ -5,8 +5,13 @@ + + + + - + + @@ -39,6 +44,10 @@ + + + + diff --git a/hannes_test/scripts/application.py b/hannes_test/scripts/application.py index c0025ebc..b35c98c0 100755 --- a/hannes_test/scripts/application.py +++ b/hannes_test/scripts/application.py @@ -25,29 +25,24 @@ def execute(self): self.initpose() rospy.sleep(15) self.atf.start("testblock_small") - rospy.sleep(600)#600s - #self.sss.move("base", [25.0,68.5,0.0]) + rospy.sleep(750)#600s + # listener = tf.TransformListener() + # try: + # listener.waitForTransform("/map", "/base_link_", rospy.Time(0), rospy.Duration.from_sec(10)) + # (trans, rot) = listener.lookupTransform("/map", "/base_link_", rospy.Time(0)) + # except (tf.Exception, tf.LookupException, tf.ConnectivityException) as e: + # rospy.logwarn(e) + # pass + # else: + # print "transformation at the end: ", trans + # meta = open("/home/fmw-hb/Desktop/hannes_test_long/"+"final_positions", 'wa') + # meta.write(str(5)) self.atf.stop("testblock_small") - # large testblock (circle r=1, time=5 - #self.atf.start("testblock_large") - #self.pub_tf_circle("link1", "link2", radius=2, time=5) - #self.atf.stop("testblock_large") + self.atf.shutdown() - def pub_tf_circle(self, parent_frame_id, child1_frame_id, radius=1, time=1): - rate = rospy.Rate(int(self.pub_freq)) - for i in range(int(self.pub_freq * time) + 1): - t = i / self.pub_freq / time - self.br.sendTransform( - (-radius * math.cos(2 * math.pi * t) + radius, -radius * math.sin(2 * math.pi * t), 0), - tf.transformations.quaternion_from_euler(0, 0, 0), - rospy.Time.now(), - child1_frame_id, - parent_frame_id) - rate.sleep() - def initpose(self): pub_initialpose = rospy.Publisher('initialpose', PoseWithCovarianceStamped, queue_size=1) @@ -63,6 +58,9 @@ def initpose(self): initialpose.pose.pose.orientation.y = quat[1] initialpose.pose.pose.orientation.z = quat[2] initialpose.pose.pose.orientation.w = quat[3] + initialpose.pose.covariance[0] = 0.01; + initialpose.pose.covariance[7] = 0.01; + initialpose.pose.covariance[35] = 0.01; # publish robot pose on initialpose topic for i in range(0,2): diff --git a/hannes_test/scripts/robots_maker.py b/hannes_test/scripts/robots_maker.py index 328723fb..1b241ad4 100755 --- a/hannes_test/scripts/robots_maker.py +++ b/hannes_test/scripts/robots_maker.py @@ -8,9 +8,13 @@ class robot_maker(): def __init__(self): - self.int_res = [0.25, 0.35, 0.5, 0.75] #[0.25, 0.35, 0.5, 0.6, 0.75, 1.0, 1.5] - self.part_num = [50, 75, 100, 150, 200] #[25, 50, 75, 100, 150, 200, 500] - self.ndt_match = ["false", "true"] + self.int_res = [0.35] #[0.25, 0.35, 0.5, 0.6, 0.75, 1.0, 1.5] + self.part_num = [100] #[25, 50, 75, 100, 150, 200, 500] + self.cb_counter = [1] + self.mapping = [0.5, 1, 5, 10] + self.ndt_match = ["true"] + self.gain = [2] + self.dyn_gain = [0.25, 0.5, 0.75, 1.0] self.file_path = "/home/fmw-hb/Desktop/robots/" #'/home/fmw-hb/atf_catkin_ws/src/atf/hannes_test/config/robots/' self.robots = "" @@ -19,38 +23,40 @@ def make_robots(self): for part in self.part_num: for res in self.int_res: for ndt in self.ndt_match: - if(ndt == "true"): - filename = "part"+str(part)+"_"+str(int(res*1000))+"mm_ndtmatch" - else: - filename = "part"+str(part)+"_"+str(int(res*1000))+"mm" - # save everything in the file - #with open(self.file_path+filename, 'w') as stream: - #print "Path: "+self.file_path+filename - print filename - robot = open(self.file_path+filename+".yaml", 'w') - robot.write("path_length:\n topics:\n - \"/tf\"\n - \"/scan_unified\"\nrobot_bringup_launch: \"launch/all.launch\"\nwait_for_topics: []\nwait_for_services: []\n" - "additional_parameters:\n \"/use_sim_time\": true\n" - "additional_arguments:\n \"int_res\": "+str(res)+"\n \"part_num\": "+str(part)+"\n \"ndt_match\": "+ndt) - # stream.write(yaml.dump({'path_length': {'topics': [{'"/tf"', '"/scan_unified"'}] - # 'robot_bringup_launch': '"launch/all.launch"' - # 'wait_for_topics': '[]' - # 'wait_for_services': '[]' - # 'additional_parameters': - # '"/use_sim_time"': true - # additional_arguments: - # "int_res": 0.35 - # "part_num": 75 - # "ndt_match": true}, default_flow_style=False)) - self.robots = self.robots + "\n" + " - " + filename + for gain in self.gain: + for counter in self.cb_counter: + for dyn_gain in self.dyn_gain: + for mapping in self.mapping: + + if(ndt == "true"): + filename = str(mapping)+"mapping_"+str(dyn_gain)+"overlaymap" + else: + filename = str(gain)+"gain_"+"part"+str(part)+"_"+str(int(res*1000))+"mm" + # save everything in the file + #with open(self.file_path+filename, 'w') as stream: + #print "Path: "+self.file_path+filename + print filename + robot = open(self.file_path+filename+".yaml", 'w') + robot.write("path_length:\n topics:\n - \"/tf\"\n - \"/scan_unified\"\nrobot_bringup_launch: \"launch/all.launch\"\nwait_for_topics: []\nwait_for_services: []\n" + "additional_parameters:\n \"/use_sim_time\": true\n" + "additional_arguments:\n \"int_res\": "+str(res)+"\n \"part_num\": "+str(part)+"\n \"ndt_match\": "+ndt+"\n \"gain\": "+str(gain)+ + "\n \"counter\": "+str(counter)+"\n \"mapping\": "+str(mapping)+"\n \"stmgain\": "+str(dyn_gain)) + # stream.write(yaml.dump({'path_length': {'topics': [{'"/tf"', '"/scan_unified"'}] + # 'robot_bringup_launch': '"launch/all.launch"' + # 'wait_for_topics': '[]' + # 'wait_for_services': '[]' + # 'additional_parameters': + # '"/use_sim_time"': true + # additional_arguments: + # "int_res": 0.35 + # "part_num": 75 + # "ndt_match": true}, default_flow_style=False)) + self.robots = self.robots + " - " + filename + "\n" meta = open(self.file_path+"robots", 'wa') meta.write(self.robots) - - - - if __name__ == '__main__': try: RM = robot_maker() From 1db5b981a687be1401ddbbcb0deacf95207ef077 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Wed, 21 Jun 2017 13:39:22 +0200 Subject: [PATCH 21/26] changes from last run within atf --- atf_core/scripts/record_all.py | 2 +- atf_core/src/atf_core/recorder.py | 1 - .../atf_metrics/calculate_resources_cpu.py | 1 - .../src/atf_metrics/check_localization.py | 7 +- hannes_test/config/test_configs/test1.yaml | 7 +- .../config/test_generation_config.yaml | 14 +-- hannes_test/config/test_suites.yaml | 19 +--- hannes_test/launch/application.launch | 89 +++++++++++++------ hannes_test/scripts/application.py | 61 +++++++++---- hannes_test/scripts/robots_maker.py | 8 +- 10 files changed, 135 insertions(+), 74 deletions(-) diff --git a/atf_core/scripts/record_all.py b/atf_core/scripts/record_all.py index b92c9e8d..dade93b7 100755 --- a/atf_core/scripts/record_all.py +++ b/atf_core/scripts/record_all.py @@ -13,7 +13,7 @@ path_to_test_files = os.path.join(pkg_path, "test_generated/recording") filenames = [] - for (dirpath, dirnames, list_of_files) in os.walk(path_to_test_files): + for (dirpath, dirnames, list_of_files) in os.walk(path_to_test_files, topdown=True): for f in list_of_files: if f.endswith(".test"): filenames.append(f) diff --git a/atf_core/src/atf_core/recorder.py b/atf_core/src/atf_core/recorder.py index 4a03bd30..657439de 100644 --- a/atf_core/src/atf_core/recorder.py +++ b/atf_core/src/atf_core/recorder.py @@ -17,7 +17,6 @@ class ATFRecorder: def __init__(self, config, testblock_list): self.ns = "/atf/" self.config = config - recorder_config = self.load_data(rospkg.RosPack().get_path("atf_recorder_plugins") + "/config/recorder_plugins.yaml") diff --git a/atf_metrics/src/atf_metrics/calculate_resources_cpu.py b/atf_metrics/src/atf_metrics/calculate_resources_cpu.py index 9bab7c94..541d7ab8 100644 --- a/atf_metrics/src/atf_metrics/calculate_resources_cpu.py +++ b/atf_metrics/src/atf_metrics/calculate_resources_cpu.py @@ -71,7 +71,6 @@ def __init__(self, nodes, groundtruth, groundtruth_epsilon): self.node_data[node] = {self.resource: {"data": [], "average": [], "min": [], "max": []}} # elif resource not in self.node_data[node]: # self.node_data[node].update({resource: {"data": [], "average": [], "min": [], "max": []}}) - print "node data after:", self.node_data rospy.Subscriber("/atf/resources", Resources, self.process_resource_data, queue_size=1) def start(self, timestamp): diff --git a/atf_metrics/src/atf_metrics/check_localization.py b/atf_metrics/src/atf_metrics/check_localization.py index 30ca1386..4a7864d8 100644 --- a/atf_metrics/src/atf_metrics/check_localization.py +++ b/atf_metrics/src/atf_metrics/check_localization.py @@ -47,7 +47,8 @@ def __init__(self, root_frame, measured_frame, groundtruth, groundtruth_epsilon) self.root_frame = root_frame self.measured_frame = measured_frame self.distance = 0.0 - self.tf_sampling_freq = 5.0 # Hz + self.lost_count = 0 + self.tf_sampling_freq = 1.0 # Hz self.groundtruth = groundtruth self.groundtruth_epsilon = groundtruth_epsilon self.finished = False @@ -83,13 +84,15 @@ def record_tf(self, event): pass else: self.distance = math.sqrt(trans[0]**2 + trans[1]**2) + if (self.distance > 1.0): + self.lost_count += 1 def get_result(self): groundtruth_result = None details = {"root_frame": self.root_frame, "measured_frame": self.measured_frame} if self.finished: - data = round(self.distance, 3) + data = self.lost_count if self.groundtruth != None and self.groundtruth_epsilon != None: if math.fabs(self.groundtruth - data) <= self.groundtruth_epsilon: groundtruth_result = True diff --git a/hannes_test/config/test_configs/test1.yaml b/hannes_test/config/test_configs/test1.yaml index a5fa2c3c..d6c06da8 100644 --- a/hannes_test/config/test_configs/test1.yaml +++ b/hannes_test/config/test_configs/test1.yaml @@ -16,6 +16,11 @@ testblock_small: groundtruth_epsilon: 2.0 resource_cpu: - nodes: - - slam + - slam +# - ipa_loc_feature_association_node +# - ipa_loc_feature_fusion_ekf_node +# - ipa_loc_feature_map_server +# - ipa_loc_feature_source_laser_node + # testblock_all empty diff --git a/hannes_test/config/test_generation_config.yaml b/hannes_test/config/test_generation_config.yaml index 3b9d0b94..6e911aa2 100644 --- a/hannes_test/config/test_generation_config.yaml +++ b/hannes_test/config/test_generation_config.yaml @@ -2,19 +2,19 @@ suites_file: config/test_suites.yaml # Path of th test_config_path: config/test_configs # Path of the test_config file robot_config_path: config/robots # Folder which contains the robot_config files robot_env_config_path: config/robot_envs # Folder which contains the robot_env_config files -repetitions: 3 # Number of repetitions per test +repetitions: 15 # Number of repetitions per test app_executable: application.py # Name of the application's executable file additional_launch_file: launch/application.launch # Path of the additional launch file -bagfile_output: "/home/fmw-hb/Desktop/hannes_test_/data/" # Folder for bagfile output -json_output: "/home/fmw-hb/Desktop/hannes_test_/results_json/" # Folder for the json files output -yaml_output: "/home/fmw-hb/Desktop/hannes_test_/results_yaml/" # Folder for the yaml files output +bagfile_output: "/home/fmw-hb/Desktop/hannes_test_slam/data/" # Folder for bagfile output +json_output: "/home/fmw-hb/Desktop/hannes_test_slam/results_json/" # Folder for the json files output +yaml_output: "/home/fmw-hb/Desktop/hannes_test_slam/results_yaml/" # Folder for the yaml files output -speed_factor_analysis: 2.0 # Factor to speedup analysis (can lower accuracy if too fast, especially path_length) +speed_factor_analysis: 1.0 # Factor to speedup analysis (can lower accuracy if too fast, especially path_length) -time_limit_recording: 900.0 # Time limit in seconds for recording -time_limit_analysing: 500.0 # Time limit in seconds for analysing +time_limit_recording: 777.0 # Time limit in seconds for recording +time_limit_analysing: 800.0 # Time limit in seconds for analysing time_limit_uploading: 1000.0 # Time limit in seconds for uploading upload_data: false diff --git a/hannes_test/config/test_suites.yaml b/hannes_test/config/test_suites.yaml index d093e54f..3c85e442 100644 --- a/hannes_test/config/test_suites.yaml +++ b/hannes_test/config/test_suites.yaml @@ -3,21 +3,8 @@ testsuite_1: test_configs: # You have to define at least one test_config - test1 robots: # You have to define at least one robot - - 0.5mapping_0.25overlaymap - - 1mapping_0.25overlaymap - - 5mapping_0.25overlaymap - - 10mapping_0.25overlaymap - - 0.5mapping_0.5overlaymap - - 1mapping_0.5overlaymap - - 5mapping_0.5overlaymap - - 10mapping_0.5overlaymap - - 0.5mapping_0.75overlaymap - - 1mapping_0.75overlaymap - - 5mapping_0.75overlaymap - - 10mapping_0.75overlaymap - - 0.5mapping_1.0overlaymap - - 1mapping_1.0overlaymap - - 5mapping_1.0overlaymap - - 10mapping_1.0overlaymap + - noopt_100part + # - 5opt_25part + # - 1mapping_1count robot_envs: # You have to define at least one robot_env - env1 diff --git a/hannes_test/launch/application.launch b/hannes_test/launch/application.launch index 847a9d25..d3f26dcd 100644 --- a/hannes_test/launch/application.launch +++ b/hannes_test/launch/application.launch @@ -1,6 +1,13 @@ + + + + + + + @@ -9,45 +16,77 @@ - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + diff --git a/hannes_test/scripts/application.py b/hannes_test/scripts/application.py index b35c98c0..a057982b 100755 --- a/hannes_test/scripts/application.py +++ b/hannes_test/scripts/application.py @@ -5,6 +5,10 @@ import tf import math import sys +import os +import rosnode +import time +import shutil from atf_core import ATF from simple_script_server import * @@ -19,30 +23,55 @@ def __init__(self): self.br = tf.TransformBroadcaster() rospy.sleep(1) #wait for tf broadcaster to get active (rospy bug?) self.sss = simple_script_server() + self.filepath = rospy.get_param("/atf/bagfile_output").replace("data/", "") def execute(self): rospy.sleep(1) self.initpose() - rospy.sleep(15) + rospy.sleep(5) self.atf.start("testblock_small") - rospy.sleep(750)#600s - # listener = tf.TransformListener() - # try: - # listener.waitForTransform("/map", "/base_link_", rospy.Time(0), rospy.Duration.from_sec(10)) - # (trans, rot) = listener.lookupTransform("/map", "/base_link_", rospy.Time(0)) - # except (tf.Exception, tf.LookupException, tf.ConnectivityException) as e: - # rospy.logwarn(e) - # pass - # else: - # print "transformation at the end: ", trans - # meta = open("/home/fmw-hb/Desktop/hannes_test_long/"+"final_positions", 'wa') - # meta.write(str(5)) +# poses = rospy.get_param("/script_server/base") +# for pose in poses: +# print "moving to pose", pose +# sss.move("base",pose) + #rosnode._rosnode_cmd_info(['rosnode', 'info', '/ipa_loc_feature_source_laser_node']) + rospy.sleep(750)#750s self.atf.stop("testblock_small") - - - + # os.system('rosrun map_server map_saver map:=map_hmm -f '+self.filepath+'map_atf_stm'+str(time.time())) + # os.system('rosrun map_server map_saver map:=ref_map -f '+self.filepath+'map_atf_ltm'+str(time.time())) + #os.system('rosrun map_server map_saver map:=map_hmm -f '+self.filepath+'map_atf_stm'+str(time.time())) + #os.system('rosrun map_server map_saver map:=overlay_cells_map -f '+self.filepath+'map_atf_overlay'+str(time.time())) + #os.system('rosservice call /long_term_slam/backup') + #rospy.sleep(5) + #self.backup_changer() self.atf.shutdown() + + def backup_changer(self): + count = 0 + countfile = self.filepath+"atf_count.txt" + test_name = rospy.get_param("/atf/test_name") + print test_name + if os.path.isfile(countfile): + with open(countfile, 'r+') as file: + #print "file:",file + #count = int(file.read()) + for line in file: + count = line + print "count", count + count = int(count) + if (count > 1): + shutil.copy("/home/fmw-hb/.ipa_navigation/long_term_slam_backup/client/init_ipa.backup", "/home/fmw-hb/.ipa_navigation/long_term_slam_backup/client/long_term_slam.backup") + count = 0 + print "backups copied!!!" + else: + count += 1 + file.write(test_name+"\n"+str(count)+"\n") + + else: + with open(countfile, 'w') as file: + file.write(test_name+"\n"+str(count)+"\n") + def initpose(self): pub_initialpose = rospy.Publisher('initialpose', PoseWithCovarianceStamped, queue_size=1) diff --git a/hannes_test/scripts/robots_maker.py b/hannes_test/scripts/robots_maker.py index 1b241ad4..4342f1a6 100755 --- a/hannes_test/scripts/robots_maker.py +++ b/hannes_test/scripts/robots_maker.py @@ -10,11 +10,11 @@ class robot_maker(): def __init__(self): self.int_res = [0.35] #[0.25, 0.35, 0.5, 0.6, 0.75, 1.0, 1.5] self.part_num = [100] #[25, 50, 75, 100, 150, 200, 500] - self.cb_counter = [1] - self.mapping = [0.5, 1, 5, 10] + self.cb_counter = [1, 5, 10] + self.mapping = [1] self.ndt_match = ["true"] - self.gain = [2] - self.dyn_gain = [0.25, 0.5, 0.75, 1.0] + self.gain = [5, 25, 50] + self.dyn_gain = [0.5] self.file_path = "/home/fmw-hb/Desktop/robots/" #'/home/fmw-hb/atf_catkin_ws/src/atf/hannes_test/config/robots/' self.robots = "" From c10547d40802684a70712e5a2a7b93d691d693e5 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Wed, 21 Jun 2017 15:43:41 +0200 Subject: [PATCH 22/26] changed robots maker --- hannes_test/scripts/robots_maker.py | 62 ++++++++++++++--------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/hannes_test/scripts/robots_maker.py b/hannes_test/scripts/robots_maker.py index 4342f1a6..5b363d86 100755 --- a/hannes_test/scripts/robots_maker.py +++ b/hannes_test/scripts/robots_maker.py @@ -8,12 +8,11 @@ class robot_maker(): def __init__(self): - self.int_res = [0.35] #[0.25, 0.35, 0.5, 0.6, 0.75, 1.0, 1.5] - self.part_num = [100] #[25, 50, 75, 100, 150, 200, 500] - self.cb_counter = [1, 5, 10] + self.int_res = [0.35. 0.40, 0.45, 0.5] #[0.25, 0.35, 0.5, 0.6, 0.75, 1.0, 1.5] + self.part_num = [100, 200, 300, 500] #[25, 50, 75, 100, 150, 200, 500] self.mapping = [1] self.ndt_match = ["true"] - self.gain = [5, 25, 50] + self.gain = [2, 3, 5, 8] self.dyn_gain = [0.5] self.file_path = "/home/fmw-hb/Desktop/robots/" #'/home/fmw-hb/atf_catkin_ws/src/atf/hannes_test/config/robots/' self.robots = "" @@ -24,34 +23,33 @@ def make_robots(self): for res in self.int_res: for ndt in self.ndt_match: for gain in self.gain: - for counter in self.cb_counter: - for dyn_gain in self.dyn_gain: - for mapping in self.mapping: - - if(ndt == "true"): - filename = str(mapping)+"mapping_"+str(dyn_gain)+"overlaymap" - else: - filename = str(gain)+"gain_"+"part"+str(part)+"_"+str(int(res*1000))+"mm" - # save everything in the file - #with open(self.file_path+filename, 'w') as stream: - #print "Path: "+self.file_path+filename - print filename - robot = open(self.file_path+filename+".yaml", 'w') - robot.write("path_length:\n topics:\n - \"/tf\"\n - \"/scan_unified\"\nrobot_bringup_launch: \"launch/all.launch\"\nwait_for_topics: []\nwait_for_services: []\n" - "additional_parameters:\n \"/use_sim_time\": true\n" - "additional_arguments:\n \"int_res\": "+str(res)+"\n \"part_num\": "+str(part)+"\n \"ndt_match\": "+ndt+"\n \"gain\": "+str(gain)+ - "\n \"counter\": "+str(counter)+"\n \"mapping\": "+str(mapping)+"\n \"stmgain\": "+str(dyn_gain)) - # stream.write(yaml.dump({'path_length': {'topics': [{'"/tf"', '"/scan_unified"'}] - # 'robot_bringup_launch': '"launch/all.launch"' - # 'wait_for_topics': '[]' - # 'wait_for_services': '[]' - # 'additional_parameters': - # '"/use_sim_time"': true - # additional_arguments: - # "int_res": 0.35 - # "part_num": 75 - # "ndt_match": true}, default_flow_style=False)) - self.robots = self.robots + " - " + filename + "\n" + for dyn_gain in self.dyn_gain: + #for mapping in self.mapping: + + if(ndt == "true"): + filename = str(int(int_res*100))+"mm_"+str(part)+"part"+str(gain)+ + else: + filename = str(gain)+"gain_"+"part"+str(part)+"_"+str(int(res*1000))+"mm" + # save everything in the file + #with open(self.file_path+filename, 'w') as stream: + #print "Path: "+self.file_path+filename + print filename + robot = open(self.file_path+filename+".yaml", 'w') + robot.write("path_length:\n topics:\n - \"/tf\"\n - \"/scan_unified\"\nrobot_bringup_launch: \"launch/all.launch\"\nwait_for_topics: []\nwait_for_services: []\n" + "additional_parameters:\n \"/use_sim_time\": true\n" + "additional_arguments:\n \"int_res\": "+str(res)+"\n \"part_num\": "+str(part)+"\n \"ndt_match\": "+ndt+"\n \"gain\": "+str(gain)+ + "\n \"counter\": "+str(counter)+"\n \"mapping\": "+str(mapping)+"\n \"stmgain\": "+str(dyn_gain)) + # stream.write(yaml.dump({'path_length': {'topics': [{'"/tf"', '"/scan_unified"'}] + # 'robot_bringup_launch': '"launch/all.launch"' + # 'wait_for_topics': '[]' + # 'wait_for_services': '[]' + # 'additional_parameters': + # '"/use_sim_time"': true + # additional_arguments: + # "int_res": 0.35 + # "part_num": 75 + # "ndt_match": true}, default_flow_style=False)) + self.robots = self.robots + " - " + filename + "\n" meta = open(self.file_path+"robots", 'wa') meta.write(self.robots) From b1e152c24f8332a1a185a1bf4ad1c66dd87049f7 Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Wed, 5 Jul 2017 09:19:25 +0200 Subject: [PATCH 23/26] adjustments for testrun --- atf_presenter/scripts/presenter.py | 2 +- .../config/test_generation_config.yaml | 4 +- hannes_test/config/test_suites.yaml | 51 ++++++++++++++++-- hannes_test/launch/application.launch | 24 ++++----- hannes_test/scripts/robots_maker.py | 53 +++++++++---------- 5 files changed, 89 insertions(+), 45 deletions(-) diff --git a/atf_presenter/scripts/presenter.py b/atf_presenter/scripts/presenter.py index 3140c023..8bae2f36 100755 --- a/atf_presenter/scripts/presenter.py +++ b/atf_presenter/scripts/presenter.py @@ -181,7 +181,7 @@ def calculate_data(self, metric): (options, args) = parser.parse_args() p = presenter() - Path = "/home/fmw-hb/Documents/hannes_test_load/results_yaml/"#"/home/fmw-hb/Desktop/hannes_test_shortterm/results_yaml/"#"/tmp/hannes_test_new/results_yaml/" + Path = "/home/fmw-hb/Desktop/hannes_test_slam/results_yaml/"#"/home/fmw-hb/Desktop/hannes_test_shortterm/results_yaml/"#"/tmp/hannes_test_new/results_yaml/" filelist = os.listdir(Path) p.import_testnames(Path.replace('yaml', 'json')+"test_list.json") diff --git a/hannes_test/config/test_generation_config.yaml b/hannes_test/config/test_generation_config.yaml index 6e911aa2..8818362d 100644 --- a/hannes_test/config/test_generation_config.yaml +++ b/hannes_test/config/test_generation_config.yaml @@ -2,7 +2,7 @@ suites_file: config/test_suites.yaml # Path of th test_config_path: config/test_configs # Path of the test_config file robot_config_path: config/robots # Folder which contains the robot_config files robot_env_config_path: config/robot_envs # Folder which contains the robot_env_config files -repetitions: 15 # Number of repetitions per test +repetitions: 5 # Number of repetitions per test app_executable: application.py # Name of the application's executable file additional_launch_file: launch/application.launch # Path of the additional launch file @@ -11,7 +11,7 @@ bagfile_output: "/home/fmw-hb/Desktop/hannes_test_slam/data/" json_output: "/home/fmw-hb/Desktop/hannes_test_slam/results_json/" # Folder for the json files output yaml_output: "/home/fmw-hb/Desktop/hannes_test_slam/results_yaml/" # Folder for the yaml files output -speed_factor_analysis: 1.0 # Factor to speedup analysis (can lower accuracy if too fast, especially path_length) +speed_factor_analysis: 2.0 # Factor to speedup analysis (can lower accuracy if too fast, especially path_length) time_limit_recording: 777.0 # Time limit in seconds for recording time_limit_analysing: 800.0 # Time limit in seconds for analysing diff --git a/hannes_test/config/test_suites.yaml b/hannes_test/config/test_suites.yaml index 3c85e442..d772ea9f 100644 --- a/hannes_test/config/test_suites.yaml +++ b/hannes_test/config/test_suites.yaml @@ -3,8 +3,53 @@ testsuite_1: test_configs: # You have to define at least one test_config - test1 robots: # You have to define at least one robot - - noopt_100part - # - 5opt_25part - # - 1mapping_1count + - 2gain_part100_350mm + - 3gain_part100_350mm + - 5gain_part100_350mm + - 2gain_part100_400mm + - 3gain_part100_400mm + - 5gain_part100_400mm + - 2gain_part100_450mm + - 3gain_part100_450mm + - 5gain_part100_450mm + - 2gain_part100_500mm + - 3gain_part100_500mm + - 5gain_part100_500mm + - 2gain_part200_350mm + - 3gain_part200_350mm + - 5gain_part200_350mm + - 2gain_part200_400mm + - 3gain_part200_400mm + - 5gain_part200_400mm + - 2gain_part200_450mm + - 3gain_part200_450mm + - 5gain_part200_450mm + - 2gain_part200_500mm + - 3gain_part200_500mm + - 5gain_part200_500mm + - 2gain_part300_350mm + - 3gain_part300_350mm + - 5gain_part300_350mm + - 2gain_part300_400mm + - 3gain_part300_400mm + - 5gain_part300_400mm + - 2gain_part300_450mm + - 3gain_part300_450mm + - 5gain_part300_450mm + - 2gain_part300_500mm + - 3gain_part300_500mm + - 5gain_part300_500mm + - 2gain_part500_350mm + - 3gain_part500_350mm + - 5gain_part500_350mm + - 2gain_part500_400mm + - 3gain_part500_400mm + - 5gain_part500_400mm + - 2gain_part500_450mm + - 3gain_part500_450mm + - 5gain_part500_450mm + - 2gain_part500_500mm + - 3gain_part500_500mm + - 5gain_part500_500mm robot_envs: # You have to define at least one robot_env - env1 diff --git a/hannes_test/launch/application.launch b/hannes_test/launch/application.launch index d3f26dcd..12e41b3f 100644 --- a/hannes_test/launch/application.launch +++ b/hannes_test/launch/application.launch @@ -67,26 +67,26 @@ - + - + diff --git a/hannes_test/scripts/robots_maker.py b/hannes_test/scripts/robots_maker.py index 5b363d86..8d3478c6 100755 --- a/hannes_test/scripts/robots_maker.py +++ b/hannes_test/scripts/robots_maker.py @@ -8,11 +8,11 @@ class robot_maker(): def __init__(self): - self.int_res = [0.35. 0.40, 0.45, 0.5] #[0.25, 0.35, 0.5, 0.6, 0.75, 1.0, 1.5] + self.int_res = [0.35, 0.40, 0.45, 0.5] #[0.25, 0.35, 0.5, 0.6, 0.75, 1.0, 1.5] self.part_num = [100, 200, 300, 500] #[25, 50, 75, 100, 150, 200, 500] self.mapping = [1] self.ndt_match = ["true"] - self.gain = [2, 3, 5, 8] + self.gain = [2, 3, 5] self.dyn_gain = [0.5] self.file_path = "/home/fmw-hb/Desktop/robots/" #'/home/fmw-hb/atf_catkin_ws/src/atf/hannes_test/config/robots/' self.robots = "" @@ -23,33 +23,32 @@ def make_robots(self): for res in self.int_res: for ndt in self.ndt_match: for gain in self.gain: - for dyn_gain in self.dyn_gain: + #for dyn_gain in self.dyn_gain: #for mapping in self.mapping: - if(ndt == "true"): - filename = str(int(int_res*100))+"mm_"+str(part)+"part"+str(gain)+ - else: - filename = str(gain)+"gain_"+"part"+str(part)+"_"+str(int(res*1000))+"mm" - # save everything in the file - #with open(self.file_path+filename, 'w') as stream: - #print "Path: "+self.file_path+filename - print filename - robot = open(self.file_path+filename+".yaml", 'w') - robot.write("path_length:\n topics:\n - \"/tf\"\n - \"/scan_unified\"\nrobot_bringup_launch: \"launch/all.launch\"\nwait_for_topics: []\nwait_for_services: []\n" - "additional_parameters:\n \"/use_sim_time\": true\n" - "additional_arguments:\n \"int_res\": "+str(res)+"\n \"part_num\": "+str(part)+"\n \"ndt_match\": "+ndt+"\n \"gain\": "+str(gain)+ - "\n \"counter\": "+str(counter)+"\n \"mapping\": "+str(mapping)+"\n \"stmgain\": "+str(dyn_gain)) - # stream.write(yaml.dump({'path_length': {'topics': [{'"/tf"', '"/scan_unified"'}] - # 'robot_bringup_launch': '"launch/all.launch"' - # 'wait_for_topics': '[]' - # 'wait_for_services': '[]' - # 'additional_parameters': - # '"/use_sim_time"': true - # additional_arguments: - # "int_res": 0.35 - # "part_num": 75 - # "ndt_match": true}, default_flow_style=False)) - self.robots = self.robots + " - " + filename + "\n" + if(ndt == "true"): + filename = str(gain)+"gain_"+"part"+str(part)+"_"+str(int(res*1000))+"mm" + else: + filename = str(gain)+"gain_"+"part"+str(part)+"_"+str(int(res*1000))+"mm" + # save everything in the file + #with open(self.file_path+filename, 'w') as stream: + #print "Path: "+self.file_path+filename + print filename + robot = open(self.file_path+filename+".yaml", 'w') + robot.write("path_length:\n topics:\n - \"/tf\"\n - \"/scan_unified\"\nrobot_bringup_launch: \"launch/all.launch\"\nwait_for_topics: []\nwait_for_services: []\n" + "additional_parameters:\n \"/use_sim_time\": true\n" + "additional_arguments:\n \"int_res\": "+str(res)+"\n \"part_num\": "+str(part)+"\n \"ndt_match\": "+ndt+"\n \"gain\": "+str(gain)) + # stream.write(yaml.dump({'path_length': {'topics': [{'"/tf"', '"/scan_unified"'}] + # 'robot_bringup_launch': '"launch/all.launch"' + # 'wait_for_topics': '[]' + # 'wait_for_services': '[]' + # 'additional_parameters': + # '"/use_sim_time"': true + # additional_arguments: + # "int_res": 0.35 + # "part_num": 75 + # "ndt_match": true}, default_flow_style=False)) + self.robots = self.robots + " - " + filename + "\n" meta = open(self.file_path+"robots", 'wa') meta.write(self.robots) From 8fa244e5bbb05cc8ceb114357ecf21f9b8e81cbb Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Wed, 5 Jul 2017 09:20:14 +0200 Subject: [PATCH 24/26] added groundtruth generator --- .../config/robots/0.1mapping_10count.yaml | 16 ++++ .../config/robots/0.1mapping_1count.yaml | 16 ++++ .../config/robots/0.1mapping_20count.yaml | 16 ++++ .../config/robots/0.1mapping_50count.yaml | 16 ++++ .../config/robots/0.1mapping_5count.yaml | 16 ++++ .../robots/0.5mapping_0.25overlaymap.yaml | 17 +++++ .../robots/0.5mapping_0.5overlaymap.yaml | 17 +++++ .../robots/0.5mapping_0.75overlaymap.yaml | 17 +++++ .../robots/0.5mapping_1.0overlaymap.yaml | 17 +++++ .../config/robots/0.5mapping_10count.yaml | 16 ++++ .../config/robots/0.5mapping_1count.yaml | 17 +++++ .../config/robots/0.5mapping_20count.yaml | 16 ++++ .../config/robots/0.5mapping_50count.yaml | 16 ++++ .../config/robots/0.5mapping_5count.yaml | 16 ++++ .../robots/10mapping_0.25overlaymap.yaml | 17 +++++ .../robots/10mapping_0.5overlaymap.yaml | 17 +++++ .../robots/10mapping_0.75overlaymap.yaml | 17 +++++ .../robots/10mapping_1.0overlaymap.yaml | 17 +++++ .../config/robots/10mapping_10count.yaml | 16 ++++ .../config/robots/10mapping_1count.yaml | 16 ++++ .../config/robots/10mapping_20count.yaml | 16 ++++ .../config/robots/10mapping_50count.yaml | 16 ++++ .../config/robots/10mapping_5count.yaml | 16 ++++ .../robots/1mapping_0.25overlaymap.yaml | 17 +++++ .../config/robots/1mapping_0.5overlaymap.yaml | 17 +++++ .../robots/1mapping_0.75overlaymap.yaml | 17 +++++ .../config/robots/1mapping_1.0overlaymap.yaml | 17 +++++ .../config/robots/1mapping_10count.yaml | 16 ++++ .../config/robots/1mapping_1count.yaml | 17 +++++ .../config/robots/1mapping_20count.yaml | 16 ++++ .../config/robots/1mapping_50count.yaml | 16 ++++ .../config/robots/1mapping_5count.yaml | 16 ++++ .../config/robots/2gain_part100_350mm.yaml | 14 ++++ .../config/robots/2gain_part100_400mm.yaml | 14 ++++ .../config/robots/2gain_part100_450mm.yaml | 14 ++++ .../config/robots/2gain_part100_500mm.yaml | 14 ++++ .../config/robots/2gain_part200_350mm.yaml | 14 ++++ .../config/robots/2gain_part200_400mm.yaml | 14 ++++ .../config/robots/2gain_part200_450mm.yaml | 14 ++++ .../config/robots/2gain_part200_500mm.yaml | 14 ++++ .../config/robots/2gain_part300_350mm.yaml | 14 ++++ .../config/robots/2gain_part300_400mm.yaml | 14 ++++ .../config/robots/2gain_part300_450mm.yaml | 14 ++++ .../config/robots/2gain_part300_500mm.yaml | 14 ++++ .../config/robots/2gain_part500_350mm.yaml | 14 ++++ .../config/robots/2gain_part500_400mm.yaml | 14 ++++ .../config/robots/2gain_part500_450mm.yaml | 14 ++++ .../config/robots/2gain_part500_500mm.yaml | 14 ++++ .../config/robots/3gain_part100_350mm.yaml | 14 ++++ .../config/robots/3gain_part100_400mm.yaml | 14 ++++ .../config/robots/3gain_part100_450mm.yaml | 14 ++++ .../config/robots/3gain_part100_500mm.yaml | 14 ++++ .../config/robots/3gain_part200_350mm.yaml | 14 ++++ .../config/robots/3gain_part200_400mm.yaml | 14 ++++ .../config/robots/3gain_part200_450mm.yaml | 14 ++++ .../config/robots/3gain_part200_500mm.yaml | 14 ++++ .../config/robots/3gain_part300_350mm.yaml | 14 ++++ .../config/robots/3gain_part300_400mm.yaml | 14 ++++ .../config/robots/3gain_part300_450mm.yaml | 14 ++++ .../config/robots/3gain_part300_500mm.yaml | 14 ++++ .../config/robots/3gain_part500_350mm.yaml | 14 ++++ .../config/robots/3gain_part500_400mm.yaml | 14 ++++ .../config/robots/3gain_part500_450mm.yaml | 14 ++++ .../config/robots/3gain_part500_500mm.yaml | 14 ++++ .../config/robots/5gain_part100_350mm.yaml | 14 ++++ .../config/robots/5gain_part100_400mm.yaml | 14 ++++ .../config/robots/5gain_part100_450mm.yaml | 14 ++++ .../config/robots/5gain_part100_500mm.yaml | 14 ++++ .../config/robots/5gain_part200_350mm.yaml | 14 ++++ .../config/robots/5gain_part200_400mm.yaml | 14 ++++ .../config/robots/5gain_part200_450mm.yaml | 14 ++++ .../config/robots/5gain_part200_500mm.yaml | 14 ++++ .../config/robots/5gain_part300_350mm.yaml | 14 ++++ .../config/robots/5gain_part300_400mm.yaml | 14 ++++ .../config/robots/5gain_part300_450mm.yaml | 14 ++++ .../config/robots/5gain_part300_500mm.yaml | 14 ++++ .../config/robots/5gain_part500_350mm.yaml | 14 ++++ .../config/robots/5gain_part500_400mm.yaml | 14 ++++ .../config/robots/5gain_part500_450mm.yaml | 14 ++++ .../config/robots/5gain_part500_500mm.yaml | 14 ++++ .../robots/5mapping_0.25overlaymap.yaml | 17 +++++ .../config/robots/5mapping_0.5overlaymap.yaml | 17 +++++ .../robots/5mapping_0.75overlaymap.yaml | 17 +++++ .../config/robots/5mapping_1.0overlaymap.yaml | 17 +++++ .../config/robots/5mapping_10count.yaml | 16 ++++ .../config/robots/5mapping_1count.yaml | 17 +++++ .../config/robots/5mapping_20count.yaml | 16 ++++ .../config/robots/5mapping_50count.yaml | 16 ++++ .../config/robots/5mapping_5count.yaml | 16 ++++ hannes_test/config/robots/5opt_25part.yaml | 17 +++++ hannes_test/config/robots/noopt_100part.yaml | 17 +++++ hannes_test/config/robots/robots | 48 ++++++++++++ hannes_test/scripts/groundtruth_generator.py | 75 +++++++++++++++++++ 93 files changed, 1504 insertions(+) create mode 100644 hannes_test/config/robots/0.1mapping_10count.yaml create mode 100644 hannes_test/config/robots/0.1mapping_1count.yaml create mode 100644 hannes_test/config/robots/0.1mapping_20count.yaml create mode 100644 hannes_test/config/robots/0.1mapping_50count.yaml create mode 100644 hannes_test/config/robots/0.1mapping_5count.yaml create mode 100644 hannes_test/config/robots/0.5mapping_0.25overlaymap.yaml create mode 100644 hannes_test/config/robots/0.5mapping_0.5overlaymap.yaml create mode 100644 hannes_test/config/robots/0.5mapping_0.75overlaymap.yaml create mode 100644 hannes_test/config/robots/0.5mapping_1.0overlaymap.yaml create mode 100644 hannes_test/config/robots/0.5mapping_10count.yaml create mode 100644 hannes_test/config/robots/0.5mapping_1count.yaml create mode 100644 hannes_test/config/robots/0.5mapping_20count.yaml create mode 100644 hannes_test/config/robots/0.5mapping_50count.yaml create mode 100644 hannes_test/config/robots/0.5mapping_5count.yaml create mode 100644 hannes_test/config/robots/10mapping_0.25overlaymap.yaml create mode 100644 hannes_test/config/robots/10mapping_0.5overlaymap.yaml create mode 100644 hannes_test/config/robots/10mapping_0.75overlaymap.yaml create mode 100644 hannes_test/config/robots/10mapping_1.0overlaymap.yaml create mode 100644 hannes_test/config/robots/10mapping_10count.yaml create mode 100644 hannes_test/config/robots/10mapping_1count.yaml create mode 100644 hannes_test/config/robots/10mapping_20count.yaml create mode 100644 hannes_test/config/robots/10mapping_50count.yaml create mode 100644 hannes_test/config/robots/10mapping_5count.yaml create mode 100644 hannes_test/config/robots/1mapping_0.25overlaymap.yaml create mode 100644 hannes_test/config/robots/1mapping_0.5overlaymap.yaml create mode 100644 hannes_test/config/robots/1mapping_0.75overlaymap.yaml create mode 100644 hannes_test/config/robots/1mapping_1.0overlaymap.yaml create mode 100644 hannes_test/config/robots/1mapping_10count.yaml create mode 100644 hannes_test/config/robots/1mapping_1count.yaml create mode 100644 hannes_test/config/robots/1mapping_20count.yaml create mode 100644 hannes_test/config/robots/1mapping_50count.yaml create mode 100644 hannes_test/config/robots/1mapping_5count.yaml create mode 100644 hannes_test/config/robots/2gain_part100_350mm.yaml create mode 100644 hannes_test/config/robots/2gain_part100_400mm.yaml create mode 100644 hannes_test/config/robots/2gain_part100_450mm.yaml create mode 100644 hannes_test/config/robots/2gain_part100_500mm.yaml create mode 100644 hannes_test/config/robots/2gain_part200_350mm.yaml create mode 100644 hannes_test/config/robots/2gain_part200_400mm.yaml create mode 100644 hannes_test/config/robots/2gain_part200_450mm.yaml create mode 100644 hannes_test/config/robots/2gain_part200_500mm.yaml create mode 100644 hannes_test/config/robots/2gain_part300_350mm.yaml create mode 100644 hannes_test/config/robots/2gain_part300_400mm.yaml create mode 100644 hannes_test/config/robots/2gain_part300_450mm.yaml create mode 100644 hannes_test/config/robots/2gain_part300_500mm.yaml create mode 100644 hannes_test/config/robots/2gain_part500_350mm.yaml create mode 100644 hannes_test/config/robots/2gain_part500_400mm.yaml create mode 100644 hannes_test/config/robots/2gain_part500_450mm.yaml create mode 100644 hannes_test/config/robots/2gain_part500_500mm.yaml create mode 100644 hannes_test/config/robots/3gain_part100_350mm.yaml create mode 100644 hannes_test/config/robots/3gain_part100_400mm.yaml create mode 100644 hannes_test/config/robots/3gain_part100_450mm.yaml create mode 100644 hannes_test/config/robots/3gain_part100_500mm.yaml create mode 100644 hannes_test/config/robots/3gain_part200_350mm.yaml create mode 100644 hannes_test/config/robots/3gain_part200_400mm.yaml create mode 100644 hannes_test/config/robots/3gain_part200_450mm.yaml create mode 100644 hannes_test/config/robots/3gain_part200_500mm.yaml create mode 100644 hannes_test/config/robots/3gain_part300_350mm.yaml create mode 100644 hannes_test/config/robots/3gain_part300_400mm.yaml create mode 100644 hannes_test/config/robots/3gain_part300_450mm.yaml create mode 100644 hannes_test/config/robots/3gain_part300_500mm.yaml create mode 100644 hannes_test/config/robots/3gain_part500_350mm.yaml create mode 100644 hannes_test/config/robots/3gain_part500_400mm.yaml create mode 100644 hannes_test/config/robots/3gain_part500_450mm.yaml create mode 100644 hannes_test/config/robots/3gain_part500_500mm.yaml create mode 100644 hannes_test/config/robots/5gain_part100_350mm.yaml create mode 100644 hannes_test/config/robots/5gain_part100_400mm.yaml create mode 100644 hannes_test/config/robots/5gain_part100_450mm.yaml create mode 100644 hannes_test/config/robots/5gain_part100_500mm.yaml create mode 100644 hannes_test/config/robots/5gain_part200_350mm.yaml create mode 100644 hannes_test/config/robots/5gain_part200_400mm.yaml create mode 100644 hannes_test/config/robots/5gain_part200_450mm.yaml create mode 100644 hannes_test/config/robots/5gain_part200_500mm.yaml create mode 100644 hannes_test/config/robots/5gain_part300_350mm.yaml create mode 100644 hannes_test/config/robots/5gain_part300_400mm.yaml create mode 100644 hannes_test/config/robots/5gain_part300_450mm.yaml create mode 100644 hannes_test/config/robots/5gain_part300_500mm.yaml create mode 100644 hannes_test/config/robots/5gain_part500_350mm.yaml create mode 100644 hannes_test/config/robots/5gain_part500_400mm.yaml create mode 100644 hannes_test/config/robots/5gain_part500_450mm.yaml create mode 100644 hannes_test/config/robots/5gain_part500_500mm.yaml create mode 100644 hannes_test/config/robots/5mapping_0.25overlaymap.yaml create mode 100644 hannes_test/config/robots/5mapping_0.5overlaymap.yaml create mode 100644 hannes_test/config/robots/5mapping_0.75overlaymap.yaml create mode 100644 hannes_test/config/robots/5mapping_1.0overlaymap.yaml create mode 100644 hannes_test/config/robots/5mapping_10count.yaml create mode 100644 hannes_test/config/robots/5mapping_1count.yaml create mode 100644 hannes_test/config/robots/5mapping_20count.yaml create mode 100644 hannes_test/config/robots/5mapping_50count.yaml create mode 100644 hannes_test/config/robots/5mapping_5count.yaml create mode 100644 hannes_test/config/robots/5opt_25part.yaml create mode 100644 hannes_test/config/robots/noopt_100part.yaml create mode 100644 hannes_test/config/robots/robots create mode 100755 hannes_test/scripts/groundtruth_generator.py diff --git a/hannes_test/config/robots/0.1mapping_10count.yaml b/hannes_test/config/robots/0.1mapping_10count.yaml new file mode 100644 index 00000000..324fc625 --- /dev/null +++ b/hannes_test/config/robots/0.1mapping_10count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 10 + "mapping": 0.1 \ No newline at end of file diff --git a/hannes_test/config/robots/0.1mapping_1count.yaml b/hannes_test/config/robots/0.1mapping_1count.yaml new file mode 100644 index 00000000..3aabe614 --- /dev/null +++ b/hannes_test/config/robots/0.1mapping_1count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 0.1 \ No newline at end of file diff --git a/hannes_test/config/robots/0.1mapping_20count.yaml b/hannes_test/config/robots/0.1mapping_20count.yaml new file mode 100644 index 00000000..88dac807 --- /dev/null +++ b/hannes_test/config/robots/0.1mapping_20count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 20 + "mapping": 0.1 \ No newline at end of file diff --git a/hannes_test/config/robots/0.1mapping_50count.yaml b/hannes_test/config/robots/0.1mapping_50count.yaml new file mode 100644 index 00000000..f179670c --- /dev/null +++ b/hannes_test/config/robots/0.1mapping_50count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 50 + "mapping": 0.1 \ No newline at end of file diff --git a/hannes_test/config/robots/0.1mapping_5count.yaml b/hannes_test/config/robots/0.1mapping_5count.yaml new file mode 100644 index 00000000..419a72a9 --- /dev/null +++ b/hannes_test/config/robots/0.1mapping_5count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 5 + "mapping": 0.1 \ No newline at end of file diff --git a/hannes_test/config/robots/0.5mapping_0.25overlaymap.yaml b/hannes_test/config/robots/0.5mapping_0.25overlaymap.yaml new file mode 100644 index 00000000..a967a396 --- /dev/null +++ b/hannes_test/config/robots/0.5mapping_0.25overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 0.5 + "stmgain": 0.25 \ No newline at end of file diff --git a/hannes_test/config/robots/0.5mapping_0.5overlaymap.yaml b/hannes_test/config/robots/0.5mapping_0.5overlaymap.yaml new file mode 100644 index 00000000..34554fcd --- /dev/null +++ b/hannes_test/config/robots/0.5mapping_0.5overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 0.5 + "stmgain": 0.5 \ No newline at end of file diff --git a/hannes_test/config/robots/0.5mapping_0.75overlaymap.yaml b/hannes_test/config/robots/0.5mapping_0.75overlaymap.yaml new file mode 100644 index 00000000..192445c2 --- /dev/null +++ b/hannes_test/config/robots/0.5mapping_0.75overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 0.5 + "stmgain": 0.75 \ No newline at end of file diff --git a/hannes_test/config/robots/0.5mapping_1.0overlaymap.yaml b/hannes_test/config/robots/0.5mapping_1.0overlaymap.yaml new file mode 100644 index 00000000..4a4b0508 --- /dev/null +++ b/hannes_test/config/robots/0.5mapping_1.0overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 0.5 + "stmgain": 1.0 \ No newline at end of file diff --git a/hannes_test/config/robots/0.5mapping_10count.yaml b/hannes_test/config/robots/0.5mapping_10count.yaml new file mode 100644 index 00000000..d25b9adb --- /dev/null +++ b/hannes_test/config/robots/0.5mapping_10count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 10 + "mapping": 0.5 \ No newline at end of file diff --git a/hannes_test/config/robots/0.5mapping_1count.yaml b/hannes_test/config/robots/0.5mapping_1count.yaml new file mode 100644 index 00000000..d9e2d7c8 --- /dev/null +++ b/hannes_test/config/robots/0.5mapping_1count.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 0.5 + "stm_gain": 1.05 \ No newline at end of file diff --git a/hannes_test/config/robots/0.5mapping_20count.yaml b/hannes_test/config/robots/0.5mapping_20count.yaml new file mode 100644 index 00000000..339be6c8 --- /dev/null +++ b/hannes_test/config/robots/0.5mapping_20count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 20 + "mapping": 0.5 \ No newline at end of file diff --git a/hannes_test/config/robots/0.5mapping_50count.yaml b/hannes_test/config/robots/0.5mapping_50count.yaml new file mode 100644 index 00000000..cc767be7 --- /dev/null +++ b/hannes_test/config/robots/0.5mapping_50count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 50 + "mapping": 0.5 \ No newline at end of file diff --git a/hannes_test/config/robots/0.5mapping_5count.yaml b/hannes_test/config/robots/0.5mapping_5count.yaml new file mode 100644 index 00000000..7c47f17f --- /dev/null +++ b/hannes_test/config/robots/0.5mapping_5count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 5 + "mapping": 0.5 \ No newline at end of file diff --git a/hannes_test/config/robots/10mapping_0.25overlaymap.yaml b/hannes_test/config/robots/10mapping_0.25overlaymap.yaml new file mode 100644 index 00000000..939079c5 --- /dev/null +++ b/hannes_test/config/robots/10mapping_0.25overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 10 + "stmgain": 0.25 \ No newline at end of file diff --git a/hannes_test/config/robots/10mapping_0.5overlaymap.yaml b/hannes_test/config/robots/10mapping_0.5overlaymap.yaml new file mode 100644 index 00000000..00e2f5d8 --- /dev/null +++ b/hannes_test/config/robots/10mapping_0.5overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 10 + "stmgain": 0.5 \ No newline at end of file diff --git a/hannes_test/config/robots/10mapping_0.75overlaymap.yaml b/hannes_test/config/robots/10mapping_0.75overlaymap.yaml new file mode 100644 index 00000000..5f1f4f8d --- /dev/null +++ b/hannes_test/config/robots/10mapping_0.75overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 10 + "stmgain": 0.75 \ No newline at end of file diff --git a/hannes_test/config/robots/10mapping_1.0overlaymap.yaml b/hannes_test/config/robots/10mapping_1.0overlaymap.yaml new file mode 100644 index 00000000..c57900e5 --- /dev/null +++ b/hannes_test/config/robots/10mapping_1.0overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 10 + "stmgain": 1.0 \ No newline at end of file diff --git a/hannes_test/config/robots/10mapping_10count.yaml b/hannes_test/config/robots/10mapping_10count.yaml new file mode 100644 index 00000000..6078ea75 --- /dev/null +++ b/hannes_test/config/robots/10mapping_10count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 10 + "mapping": 10 \ No newline at end of file diff --git a/hannes_test/config/robots/10mapping_1count.yaml b/hannes_test/config/robots/10mapping_1count.yaml new file mode 100644 index 00000000..7c51f002 --- /dev/null +++ b/hannes_test/config/robots/10mapping_1count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 10 \ No newline at end of file diff --git a/hannes_test/config/robots/10mapping_20count.yaml b/hannes_test/config/robots/10mapping_20count.yaml new file mode 100644 index 00000000..a0c9af74 --- /dev/null +++ b/hannes_test/config/robots/10mapping_20count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 20 + "mapping": 10 \ No newline at end of file diff --git a/hannes_test/config/robots/10mapping_50count.yaml b/hannes_test/config/robots/10mapping_50count.yaml new file mode 100644 index 00000000..e29bbe2e --- /dev/null +++ b/hannes_test/config/robots/10mapping_50count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 50 + "mapping": 10 \ No newline at end of file diff --git a/hannes_test/config/robots/10mapping_5count.yaml b/hannes_test/config/robots/10mapping_5count.yaml new file mode 100644 index 00000000..9656afbd --- /dev/null +++ b/hannes_test/config/robots/10mapping_5count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 5 + "mapping": 10 \ No newline at end of file diff --git a/hannes_test/config/robots/1mapping_0.25overlaymap.yaml b/hannes_test/config/robots/1mapping_0.25overlaymap.yaml new file mode 100644 index 00000000..c62066f5 --- /dev/null +++ b/hannes_test/config/robots/1mapping_0.25overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 1 + "stmgain": 0.25 \ No newline at end of file diff --git a/hannes_test/config/robots/1mapping_0.5overlaymap.yaml b/hannes_test/config/robots/1mapping_0.5overlaymap.yaml new file mode 100644 index 00000000..67ad51d8 --- /dev/null +++ b/hannes_test/config/robots/1mapping_0.5overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 1 + "stmgain": 0.5 \ No newline at end of file diff --git a/hannes_test/config/robots/1mapping_0.75overlaymap.yaml b/hannes_test/config/robots/1mapping_0.75overlaymap.yaml new file mode 100644 index 00000000..9058cc55 --- /dev/null +++ b/hannes_test/config/robots/1mapping_0.75overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 1 + "stmgain": 0.75 \ No newline at end of file diff --git a/hannes_test/config/robots/1mapping_1.0overlaymap.yaml b/hannes_test/config/robots/1mapping_1.0overlaymap.yaml new file mode 100644 index 00000000..bda202d7 --- /dev/null +++ b/hannes_test/config/robots/1mapping_1.0overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 1 + "stmgain": 1.0 \ No newline at end of file diff --git a/hannes_test/config/robots/1mapping_10count.yaml b/hannes_test/config/robots/1mapping_10count.yaml new file mode 100644 index 00000000..e1f08576 --- /dev/null +++ b/hannes_test/config/robots/1mapping_10count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 10 + "mapping": 1 \ No newline at end of file diff --git a/hannes_test/config/robots/1mapping_1count.yaml b/hannes_test/config/robots/1mapping_1count.yaml new file mode 100644 index 00000000..a71c1989 --- /dev/null +++ b/hannes_test/config/robots/1mapping_1count.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 5 + "counter": 1 + "mapping": 1 + "stmgain": 0.5 diff --git a/hannes_test/config/robots/1mapping_20count.yaml b/hannes_test/config/robots/1mapping_20count.yaml new file mode 100644 index 00000000..1be5e9fa --- /dev/null +++ b/hannes_test/config/robots/1mapping_20count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 20 + "mapping": 1 \ No newline at end of file diff --git a/hannes_test/config/robots/1mapping_50count.yaml b/hannes_test/config/robots/1mapping_50count.yaml new file mode 100644 index 00000000..ce5ad46c --- /dev/null +++ b/hannes_test/config/robots/1mapping_50count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 50 + "mapping": 1 \ No newline at end of file diff --git a/hannes_test/config/robots/1mapping_5count.yaml b/hannes_test/config/robots/1mapping_5count.yaml new file mode 100644 index 00000000..acdbfd58 --- /dev/null +++ b/hannes_test/config/robots/1mapping_5count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 5 + "mapping": 1 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part100_350mm.yaml b/hannes_test/config/robots/2gain_part100_350mm.yaml new file mode 100644 index 00000000..e6e51c37 --- /dev/null +++ b/hannes_test/config/robots/2gain_part100_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part100_400mm.yaml b/hannes_test/config/robots/2gain_part100_400mm.yaml new file mode 100644 index 00000000..84b4365b --- /dev/null +++ b/hannes_test/config/robots/2gain_part100_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 100 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part100_450mm.yaml b/hannes_test/config/robots/2gain_part100_450mm.yaml new file mode 100644 index 00000000..cb0a4d2a --- /dev/null +++ b/hannes_test/config/robots/2gain_part100_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 100 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part100_500mm.yaml b/hannes_test/config/robots/2gain_part100_500mm.yaml new file mode 100644 index 00000000..fd0c17a4 --- /dev/null +++ b/hannes_test/config/robots/2gain_part100_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 100 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part200_350mm.yaml b/hannes_test/config/robots/2gain_part200_350mm.yaml new file mode 100644 index 00000000..d7bc0ca7 --- /dev/null +++ b/hannes_test/config/robots/2gain_part200_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 200 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part200_400mm.yaml b/hannes_test/config/robots/2gain_part200_400mm.yaml new file mode 100644 index 00000000..41a551d0 --- /dev/null +++ b/hannes_test/config/robots/2gain_part200_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 200 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part200_450mm.yaml b/hannes_test/config/robots/2gain_part200_450mm.yaml new file mode 100644 index 00000000..844c73bc --- /dev/null +++ b/hannes_test/config/robots/2gain_part200_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 200 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part200_500mm.yaml b/hannes_test/config/robots/2gain_part200_500mm.yaml new file mode 100644 index 00000000..b48e583d --- /dev/null +++ b/hannes_test/config/robots/2gain_part200_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 200 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part300_350mm.yaml b/hannes_test/config/robots/2gain_part300_350mm.yaml new file mode 100644 index 00000000..f6b54a17 --- /dev/null +++ b/hannes_test/config/robots/2gain_part300_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 300 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part300_400mm.yaml b/hannes_test/config/robots/2gain_part300_400mm.yaml new file mode 100644 index 00000000..f9160345 --- /dev/null +++ b/hannes_test/config/robots/2gain_part300_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 300 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part300_450mm.yaml b/hannes_test/config/robots/2gain_part300_450mm.yaml new file mode 100644 index 00000000..5eea11e5 --- /dev/null +++ b/hannes_test/config/robots/2gain_part300_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 300 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part300_500mm.yaml b/hannes_test/config/robots/2gain_part300_500mm.yaml new file mode 100644 index 00000000..74c0a78d --- /dev/null +++ b/hannes_test/config/robots/2gain_part300_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 300 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part500_350mm.yaml b/hannes_test/config/robots/2gain_part500_350mm.yaml new file mode 100644 index 00000000..4a2497bf --- /dev/null +++ b/hannes_test/config/robots/2gain_part500_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 500 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part500_400mm.yaml b/hannes_test/config/robots/2gain_part500_400mm.yaml new file mode 100644 index 00000000..aaaef71e --- /dev/null +++ b/hannes_test/config/robots/2gain_part500_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 500 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part500_450mm.yaml b/hannes_test/config/robots/2gain_part500_450mm.yaml new file mode 100644 index 00000000..c3e47ebe --- /dev/null +++ b/hannes_test/config/robots/2gain_part500_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 500 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/2gain_part500_500mm.yaml b/hannes_test/config/robots/2gain_part500_500mm.yaml new file mode 100644 index 00000000..43a8b933 --- /dev/null +++ b/hannes_test/config/robots/2gain_part500_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 500 + "ndt_match": true + "gain": 2 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part100_350mm.yaml b/hannes_test/config/robots/3gain_part100_350mm.yaml new file mode 100644 index 00000000..efea26e5 --- /dev/null +++ b/hannes_test/config/robots/3gain_part100_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part100_400mm.yaml b/hannes_test/config/robots/3gain_part100_400mm.yaml new file mode 100644 index 00000000..99fc3167 --- /dev/null +++ b/hannes_test/config/robots/3gain_part100_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 100 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part100_450mm.yaml b/hannes_test/config/robots/3gain_part100_450mm.yaml new file mode 100644 index 00000000..c992e831 --- /dev/null +++ b/hannes_test/config/robots/3gain_part100_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 100 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part100_500mm.yaml b/hannes_test/config/robots/3gain_part100_500mm.yaml new file mode 100644 index 00000000..a6e08c96 --- /dev/null +++ b/hannes_test/config/robots/3gain_part100_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 100 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part200_350mm.yaml b/hannes_test/config/robots/3gain_part200_350mm.yaml new file mode 100644 index 00000000..2078b8f9 --- /dev/null +++ b/hannes_test/config/robots/3gain_part200_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 200 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part200_400mm.yaml b/hannes_test/config/robots/3gain_part200_400mm.yaml new file mode 100644 index 00000000..e2f27bf3 --- /dev/null +++ b/hannes_test/config/robots/3gain_part200_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 200 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part200_450mm.yaml b/hannes_test/config/robots/3gain_part200_450mm.yaml new file mode 100644 index 00000000..c1a39a79 --- /dev/null +++ b/hannes_test/config/robots/3gain_part200_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 200 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part200_500mm.yaml b/hannes_test/config/robots/3gain_part200_500mm.yaml new file mode 100644 index 00000000..0a40cc33 --- /dev/null +++ b/hannes_test/config/robots/3gain_part200_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 200 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part300_350mm.yaml b/hannes_test/config/robots/3gain_part300_350mm.yaml new file mode 100644 index 00000000..d762b089 --- /dev/null +++ b/hannes_test/config/robots/3gain_part300_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 300 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part300_400mm.yaml b/hannes_test/config/robots/3gain_part300_400mm.yaml new file mode 100644 index 00000000..49f29152 --- /dev/null +++ b/hannes_test/config/robots/3gain_part300_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 300 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part300_450mm.yaml b/hannes_test/config/robots/3gain_part300_450mm.yaml new file mode 100644 index 00000000..93bdeaf0 --- /dev/null +++ b/hannes_test/config/robots/3gain_part300_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 300 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part300_500mm.yaml b/hannes_test/config/robots/3gain_part300_500mm.yaml new file mode 100644 index 00000000..3d21d51c --- /dev/null +++ b/hannes_test/config/robots/3gain_part300_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 300 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part500_350mm.yaml b/hannes_test/config/robots/3gain_part500_350mm.yaml new file mode 100644 index 00000000..7c304edd --- /dev/null +++ b/hannes_test/config/robots/3gain_part500_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 500 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part500_400mm.yaml b/hannes_test/config/robots/3gain_part500_400mm.yaml new file mode 100644 index 00000000..a39ba9bd --- /dev/null +++ b/hannes_test/config/robots/3gain_part500_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 500 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part500_450mm.yaml b/hannes_test/config/robots/3gain_part500_450mm.yaml new file mode 100644 index 00000000..27f4e92f --- /dev/null +++ b/hannes_test/config/robots/3gain_part500_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 500 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/3gain_part500_500mm.yaml b/hannes_test/config/robots/3gain_part500_500mm.yaml new file mode 100644 index 00000000..3b553c4c --- /dev/null +++ b/hannes_test/config/robots/3gain_part500_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 500 + "ndt_match": true + "gain": 3 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part100_350mm.yaml b/hannes_test/config/robots/5gain_part100_350mm.yaml new file mode 100644 index 00000000..c99b1a3e --- /dev/null +++ b/hannes_test/config/robots/5gain_part100_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part100_400mm.yaml b/hannes_test/config/robots/5gain_part100_400mm.yaml new file mode 100644 index 00000000..629fd441 --- /dev/null +++ b/hannes_test/config/robots/5gain_part100_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 100 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part100_450mm.yaml b/hannes_test/config/robots/5gain_part100_450mm.yaml new file mode 100644 index 00000000..89da56c9 --- /dev/null +++ b/hannes_test/config/robots/5gain_part100_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 100 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part100_500mm.yaml b/hannes_test/config/robots/5gain_part100_500mm.yaml new file mode 100644 index 00000000..69fb7139 --- /dev/null +++ b/hannes_test/config/robots/5gain_part100_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 100 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part200_350mm.yaml b/hannes_test/config/robots/5gain_part200_350mm.yaml new file mode 100644 index 00000000..3e46c244 --- /dev/null +++ b/hannes_test/config/robots/5gain_part200_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 200 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part200_400mm.yaml b/hannes_test/config/robots/5gain_part200_400mm.yaml new file mode 100644 index 00000000..327b1d2d --- /dev/null +++ b/hannes_test/config/robots/5gain_part200_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 200 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part200_450mm.yaml b/hannes_test/config/robots/5gain_part200_450mm.yaml new file mode 100644 index 00000000..e8b14c59 --- /dev/null +++ b/hannes_test/config/robots/5gain_part200_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 200 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part200_500mm.yaml b/hannes_test/config/robots/5gain_part200_500mm.yaml new file mode 100644 index 00000000..f937cb14 --- /dev/null +++ b/hannes_test/config/robots/5gain_part200_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 200 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part300_350mm.yaml b/hannes_test/config/robots/5gain_part300_350mm.yaml new file mode 100644 index 00000000..f19b9d39 --- /dev/null +++ b/hannes_test/config/robots/5gain_part300_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 300 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part300_400mm.yaml b/hannes_test/config/robots/5gain_part300_400mm.yaml new file mode 100644 index 00000000..e364c551 --- /dev/null +++ b/hannes_test/config/robots/5gain_part300_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 300 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part300_450mm.yaml b/hannes_test/config/robots/5gain_part300_450mm.yaml new file mode 100644 index 00000000..89a48db1 --- /dev/null +++ b/hannes_test/config/robots/5gain_part300_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 300 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part300_500mm.yaml b/hannes_test/config/robots/5gain_part300_500mm.yaml new file mode 100644 index 00000000..3b0432ea --- /dev/null +++ b/hannes_test/config/robots/5gain_part300_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 300 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part500_350mm.yaml b/hannes_test/config/robots/5gain_part500_350mm.yaml new file mode 100644 index 00000000..de064df1 --- /dev/null +++ b/hannes_test/config/robots/5gain_part500_350mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 500 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part500_400mm.yaml b/hannes_test/config/robots/5gain_part500_400mm.yaml new file mode 100644 index 00000000..31062334 --- /dev/null +++ b/hannes_test/config/robots/5gain_part500_400mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.4 + "part_num": 500 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part500_450mm.yaml b/hannes_test/config/robots/5gain_part500_450mm.yaml new file mode 100644 index 00000000..de3ca6ab --- /dev/null +++ b/hannes_test/config/robots/5gain_part500_450mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.45 + "part_num": 500 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5gain_part500_500mm.yaml b/hannes_test/config/robots/5gain_part500_500mm.yaml new file mode 100644 index 00000000..eaaf2c8f --- /dev/null +++ b/hannes_test/config/robots/5gain_part500_500mm.yaml @@ -0,0 +1,14 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.5 + "part_num": 500 + "ndt_match": true + "gain": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5mapping_0.25overlaymap.yaml b/hannes_test/config/robots/5mapping_0.25overlaymap.yaml new file mode 100644 index 00000000..274ed445 --- /dev/null +++ b/hannes_test/config/robots/5mapping_0.25overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 5 + "stmgain": 0.25 \ No newline at end of file diff --git a/hannes_test/config/robots/5mapping_0.5overlaymap.yaml b/hannes_test/config/robots/5mapping_0.5overlaymap.yaml new file mode 100644 index 00000000..1eac6578 --- /dev/null +++ b/hannes_test/config/robots/5mapping_0.5overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 5 + "stmgain": 0.5 \ No newline at end of file diff --git a/hannes_test/config/robots/5mapping_0.75overlaymap.yaml b/hannes_test/config/robots/5mapping_0.75overlaymap.yaml new file mode 100644 index 00000000..fd4cbdc3 --- /dev/null +++ b/hannes_test/config/robots/5mapping_0.75overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 5 + "stmgain": 0.75 \ No newline at end of file diff --git a/hannes_test/config/robots/5mapping_1.0overlaymap.yaml b/hannes_test/config/robots/5mapping_1.0overlaymap.yaml new file mode 100644 index 00000000..7d3a1167 --- /dev/null +++ b/hannes_test/config/robots/5mapping_1.0overlaymap.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 5 + "stmgain": 1.0 \ No newline at end of file diff --git a/hannes_test/config/robots/5mapping_10count.yaml b/hannes_test/config/robots/5mapping_10count.yaml new file mode 100644 index 00000000..8fe31267 --- /dev/null +++ b/hannes_test/config/robots/5mapping_10count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 10 + "mapping": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5mapping_1count.yaml b/hannes_test/config/robots/5mapping_1count.yaml new file mode 100644 index 00000000..b6fdbdfb --- /dev/null +++ b/hannes_test/config/robots/5mapping_1count.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 5 + "stm_gain": 1.05 \ No newline at end of file diff --git a/hannes_test/config/robots/5mapping_20count.yaml b/hannes_test/config/robots/5mapping_20count.yaml new file mode 100644 index 00000000..1059a633 --- /dev/null +++ b/hannes_test/config/robots/5mapping_20count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 20 + "mapping": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5mapping_50count.yaml b/hannes_test/config/robots/5mapping_50count.yaml new file mode 100644 index 00000000..f9c75ad2 --- /dev/null +++ b/hannes_test/config/robots/5mapping_50count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 50 + "mapping": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5mapping_5count.yaml b/hannes_test/config/robots/5mapping_5count.yaml new file mode 100644 index 00000000..aa1bb623 --- /dev/null +++ b/hannes_test/config/robots/5mapping_5count.yaml @@ -0,0 +1,16 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 5 + "mapping": 5 \ No newline at end of file diff --git a/hannes_test/config/robots/5opt_25part.yaml b/hannes_test/config/robots/5opt_25part.yaml new file mode 100644 index 00000000..b0dde466 --- /dev/null +++ b/hannes_test/config/robots/5opt_25part.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 25 + "ndt_match": true + "gain": 2 + "counter": 1 + "mapping": 0.1 + "optimize_pose": true diff --git a/hannes_test/config/robots/noopt_100part.yaml b/hannes_test/config/robots/noopt_100part.yaml new file mode 100644 index 00000000..d9d95b1d --- /dev/null +++ b/hannes_test/config/robots/noopt_100part.yaml @@ -0,0 +1,17 @@ +path_length: + topics: + - "/tf" + - "/scan_unified" +robot_bringup_launch: "launch/all.launch" +wait_for_topics: [] +wait_for_services: [] +additional_parameters: + "/use_sim_time": true +additional_arguments: + "int_res": 0.35 + "part_num": 100 + "ndt_match": true + "gain": 2 + "counter": 5 + "mapping": 0.1 + "optimize_pose": false diff --git a/hannes_test/config/robots/robots b/hannes_test/config/robots/robots new file mode 100644 index 00000000..7b9a2d91 --- /dev/null +++ b/hannes_test/config/robots/robots @@ -0,0 +1,48 @@ + - 2gain_part100_350mm + - 3gain_part100_350mm + - 5gain_part100_350mm + - 2gain_part100_400mm + - 3gain_part100_400mm + - 5gain_part100_400mm + - 2gain_part100_450mm + - 3gain_part100_450mm + - 5gain_part100_450mm + - 2gain_part100_500mm + - 3gain_part100_500mm + - 5gain_part100_500mm + - 2gain_part200_350mm + - 3gain_part200_350mm + - 5gain_part200_350mm + - 2gain_part200_400mm + - 3gain_part200_400mm + - 5gain_part200_400mm + - 2gain_part200_450mm + - 3gain_part200_450mm + - 5gain_part200_450mm + - 2gain_part200_500mm + - 3gain_part200_500mm + - 5gain_part200_500mm + - 2gain_part300_350mm + - 3gain_part300_350mm + - 5gain_part300_350mm + - 2gain_part300_400mm + - 3gain_part300_400mm + - 5gain_part300_400mm + - 2gain_part300_450mm + - 3gain_part300_450mm + - 5gain_part300_450mm + - 2gain_part300_500mm + - 3gain_part300_500mm + - 5gain_part300_500mm + - 2gain_part500_350mm + - 3gain_part500_350mm + - 5gain_part500_350mm + - 2gain_part500_400mm + - 3gain_part500_400mm + - 5gain_part500_400mm + - 2gain_part500_450mm + - 3gain_part500_450mm + - 5gain_part500_450mm + - 2gain_part500_500mm + - 3gain_part500_500mm + - 5gain_part500_500mm diff --git a/hannes_test/scripts/groundtruth_generator.py b/hannes_test/scripts/groundtruth_generator.py new file mode 100755 index 00000000..c2bebbc8 --- /dev/null +++ b/hannes_test/scripts/groundtruth_generator.py @@ -0,0 +1,75 @@ +#!/usr/bin/env python +import rospy +import tf +import math +import signal +import sys + +from rosbag import Bag +from optparse import OptionParser + +class GroundtruthGenerator: + def __init__(self, root_frame, measured_frame): + self.root_frame = root_frame + self.measured_frame = measured_frame + self.tf_sampling_freq = 20.0 # Hz + self.finished = False + self.transformations = [] + self.listener = tf.TransformListener() + self.broadcaster = tf.TransformBroadcaster() + + self.file_path = "/home/fmw-hb/bagfiles/ekf_transforms.txt" + self.shutdown = False + + #rospy.Timer(rospy.Duration.from_sec(1 / self.tf_sampling_freq), self.record_tf()) + print "Init!" + + def record_tf(self): + try: + time = rospy.Time(0) + time = self.listener.getLatestCommonTime(self.root_frame, self.measured_frame) + self.listener.waitForTransform(self.root_frame, + self.measured_frame, + time, + rospy.Duration.from_sec(1 / (2*self.tf_sampling_freq))) + (trans, rot) = self.listener.lookupTransform(self.root_frame, self.measured_frame, time) + #coords = [trans[0],trans[1],trans[2]] + self.broadcaster.sendTransform(trans, rot, time, "/base_link_ekf", "/map") + + except (tf.Exception, tf.LookupException, tf.ConnectivityException) as e: + rospy.logerr(e) + pass + + def write(self): + transforms = open(self.file_path, 'wa') + transforms.write(str(self.transformations)) + print "transformations saved to ", self.file_path + + def signal_handler(self, signal, frame): + print('You pressed Ctrl+C!') + self.shutdown = True + rospy.logwarn("node closed - write to file") + self.write() + #sys.exit(0) + + + def run(self): + rate = rospy.Rate(100) + while not rospy.is_shutdown(): + # signal.signal(signal.SIGINT, self.signal_handler) + self.record_tf() + rate.sleep() + + + + + +if __name__ == '__main__': + rospy.init_node('groundtruth_generator') + # parser = OptionParser(usage="%prog -p or --popup", prog=os.path.basename(sys.argv[0])) + # parser.add_option("-p", "--popup", action="store_true", dest="popup", default=False, help="Use to show popup on errors") + # + # (options, args) = parser.parse_args() + gg = GroundtruthGenerator("/map", "/base_link") + gg.run() + From 426f6849ca4028d9432c5ec2ca1266217d9d969e Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Wed, 5 Jul 2017 10:40:08 +0200 Subject: [PATCH 25/26] removed presenter --- atf_core/scripts/record_all.py | 2 +- atf_presenter/scripts/presenter.py | 194 ----------------------------- 2 files changed, 1 insertion(+), 195 deletions(-) delete mode 100755 atf_presenter/scripts/presenter.py diff --git a/atf_core/scripts/record_all.py b/atf_core/scripts/record_all.py index dade93b7..b92c9e8d 100755 --- a/atf_core/scripts/record_all.py +++ b/atf_core/scripts/record_all.py @@ -13,7 +13,7 @@ path_to_test_files = os.path.join(pkg_path, "test_generated/recording") filenames = [] - for (dirpath, dirnames, list_of_files) in os.walk(path_to_test_files, topdown=True): + for (dirpath, dirnames, list_of_files) in os.walk(path_to_test_files): for f in list_of_files: if f.endswith(".test"): filenames.append(f) diff --git a/atf_presenter/scripts/presenter.py b/atf_presenter/scripts/presenter.py deleted file mode 100755 index 8bae2f36..00000000 --- a/atf_presenter/scripts/presenter.py +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/env python -import numpy -import rospy -import yaml -import copy -import os -import sys -import optparse -import matplotlib.pyplot as plt - - -class presenter: - - def __init__(self): - self.filepath = "/tmp/atf_test/results_yaml/" - self.yaml_file = {} - self.testblock = [] - self.metric = set() - self.data = {} - self.tests = {} - self.testnames = [] - self.testlist = {} - - - - def import_yaml(self, file): - with open(file, 'r') as stream: - print "import file", file - try: - #print(yaml.load(stream)) - self.yaml_file = yaml.load(stream) - except yaml.YAMLError as exc: - print(exc) - for testblock, metrics in self.yaml_file.iteritems(): - for metric, values in metrics.iteritems(): - self.data.update({metric : []}) - - - def extract_yaml(self, num): - avg = copy.deepcopy(self.data) - mini = copy.deepcopy(self.data) - maxi = copy.deepcopy(self.data) - numvals = copy.deepcopy(self.data) - for testblock, metrics in self.yaml_file.iteritems(): - #print ("testblock: ", testblock) - for metric, data in metrics.iteritems(): - #print ("metric: ", metric) - self.metric.add(metric) - for values in data: - for name, result in values.iteritems(): - #print ("name:", name) - if result != None: - #print ("result: ",result) - #print type(result) - if isinstance(result, dict): - for attribute, number in result.iteritems(): - #print ("attribute: ", attribute) - if isinstance(number, list): - print "numvals", numvals - for item in number: - #print ("value: ", item) - if isinstance(item, str): - continue - else: - numvals[metric].append(item) - elif isinstance(number, float): - #print ("result: ",result) - if attribute == "average": - avg[metric].append(number) - ##print "avg:", number - if attribute == "min": - mini[metric].append(number) - #print "min:", number - if attribute == "max": - maxi[metric].append(number) - #print "max:", number - #print "avg:", avg, "min:", mini, "max:", maxi - # elif isinstance(number, int): - # print ("integer: ",number) - # elif isinstance(number, str) or isinstance(result, unicode): - # print ("string: ",number) - # elif isinstance(result, list): - # for arrval in result: - # print ("arrval:", arrval) - # elif isinstance(result, int): - # print ("number: ", result) - # elif isinstance(result, str) or isinstance(result, unicode): - # print ("string: ", result) - else: - rospy.logerr("Error, unknown result!") - vals = [avg, numvals] - #print "values", vals - self.tests.update({str(num): vals}) - # print "-------------------------------------------------" - # print "tests:\n", self.tests - # print "-------------------------------------------------" - - def import_testnames(self, file): - with open(file, 'r') as stream: - # testlist = yaml.load(stream) - # #print testlist - # for test in testlist: - # for robot in test.iteritems(): - # print "robot:", robot[1]['robot'] - # self.testnames.append(robot[1]['robot']) - self.testlist = yaml.load(stream) - - def show_results(self, single): - if(single): - print self.metric - for metric in self.metric: - (y_pos, means, devs) = self.calculate_data(metric) - plt.bar(y_pos, means, yerr=devs, alpha=0.5, color='red') - rects = plt.bar(y_pos, means, yerr=devs, alpha=0.5, color='red') - for rect in rects: - height = rect.get_height() - plt.text(rect.get_x() + rect.get_width()/2., 1.05*height, - '%.1f' % round(height, 1), - ha='center', va='bottom') - plt.xticks(y_pos+0.8/2, self.testnames, rotation='vertical') - plt.title(metric) - plt.tight_layout() - plt.tight_layout() - plt.show() - else: - self.metric.remove('time') - #print "metric: ",self.metric - counter = 0 - fig, axarr = plt.subplots(len(self.metric), sharex=True) - for metric in self.metric: - (y_pos, means, devs) = self.calculate_data(metric) - axarr[counter].bar(y_pos, means, yerr=devs, alpha=0.5, color='red') - rects = axarr[counter].bar(y_pos, means, yerr=devs, alpha=0.5, color='red') - axarr[counter].set_title(metric) - axarr[counter].set_xticks(y_pos+0.8/2) - axarr[counter].set_xticklabels(self.testnames, rotation='vertical') - for rect in rects: - height = rect.get_height() - axarr[counter].text(rect.get_x() + rect.get_width()/2., 1.05*height, - '%.1f' % round(height, 1), - ha='center', va='bottom') - counter += 1 - plt.tight_layout() - plt.show() - - - def calculate_data(self, metric): - means = [] - devs = [] - for testname in sorted(self.tests, key=lambda ts : int(ts.split('_')[2].replace('r', ''))): # Magic! - data = self.tests[testname] - # print "-------------------------------------------" - # print testname - # print sorted(self.tests, key=lambda ts : int(ts.split('_')[2].replace('r', ''))) - # print "\n data: ", data - # print "mean: ",data[0][metric] - # print "values: ", data[1][metric] - means.extend(data[0][metric]) - #for mean in data[1][metric]: - #print "dev", numpy.std(data[1][metric]), "from mean", data[1][metric] - devs.append(numpy.std(data[1][metric])) - for test in self.testlist: - #print "\n-------------------\ntest:", test, "\ntestname:", testname, "\n data: \n", data - if testname in test: - #print "\n testname:", self.testlist, " \n \n test:", test - if (test[testname]['robot'] not in self.testnames): - self.testnames.append(test[testname]['robot']) - # print("show") - # print testnames - # print self.metric - # print plotdata - y_pos = numpy.arange(len(self.testnames)) - # print "y pos", y_pos - # print "height", means - # print "deviation", devs - return (y_pos, means, devs) - -if __name__ == '__main__': - parser = optparse.OptionParser() - parser.add_option('-s', '--single', dest='single', help='Print all plots in single windows', default=False, action="store_true") - (options, args) = parser.parse_args() - - p = presenter() - Path = "/home/fmw-hb/Desktop/hannes_test_slam/results_yaml/"#"/home/fmw-hb/Desktop/hannes_test_shortterm/results_yaml/"#"/tmp/hannes_test_new/results_yaml/" - filelist = os.listdir(Path) - p.import_testnames(Path.replace('yaml', 'json')+"test_list.json") - - for file in filelist: - #print "file", file - if "merged" in str(file): - p.import_yaml(Path+file) - filename = file.replace('.yaml', '') - p.extract_yaml(filename.replace('merged_', '')) - p.show_results(options.single) From bb5e6006d99ce9ff8b669a2ebb6eb1600e4a62dd Mon Sep 17 00:00:00 2001 From: fmw-hb Date: Wed, 5 Jul 2017 10:49:11 +0200 Subject: [PATCH 26/26] mace localization error a parameter --- atf_metrics/src/atf_metrics/check_localization.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/atf_metrics/src/atf_metrics/check_localization.py b/atf_metrics/src/atf_metrics/check_localization.py index 4a7864d8..ab5a7ef4 100644 --- a/atf_metrics/src/atf_metrics/check_localization.py +++ b/atf_metrics/src/atf_metrics/check_localization.py @@ -29,11 +29,11 @@ def parse_parameter(self, testblock_name, params): rospy.logwarn("No groundtruth parameters given, skipping groundtruth evaluation for metric 'distance' in testblock '%s'", testblock_name) groundtruth = None groundtruth_epsilon = None - metrics.append(CheckLocalization(metric["root_frame"], metric["measured_frame"], groundtruth, groundtruth_epsilon)) + metrics.append(CheckLocalization(metric["root_frame"], metric["measured_frame"], metric["max_loc_error"], groundtruth, groundtruth_epsilon)) return metrics class CheckLocalization: - def __init__(self, root_frame, measured_frame, groundtruth, groundtruth_epsilon): + def __init__(self, root_frame, measured_frame, max_loc_error, groundtruth, groundtruth_epsilon): """ Class for calculating the distance to a given root frame. The tf data is sent over the tf topic given in the robot_config.yaml. @@ -51,6 +51,7 @@ def __init__(self, root_frame, measured_frame, groundtruth, groundtruth_epsilon) self.tf_sampling_freq = 1.0 # Hz self.groundtruth = groundtruth self.groundtruth_epsilon = groundtruth_epsilon + self.max_loc_error = max_loc_error; self.finished = False self.listener = tf.TransformListener() @@ -84,7 +85,7 @@ def record_tf(self, event): pass else: self.distance = math.sqrt(trans[0]**2 + trans[1]**2) - if (self.distance > 1.0): + if (self.distance > self.max_loc_error): self.lost_count += 1