Browse Source

Testrig Dashboard updates

feature/d435i_testrig
Mohamed Fazil 2 years ago
parent
commit
d280fd9121
10 changed files with 3640 additions and 9710 deletions
  1. +0
    -3
      stretch_camera_testrig/.idea/.gitignore
  2. +0
    -6
      stretch_camera_testrig/.idea/inspectionProfiles/profiles_settings.xml
  3. +0
    -4
      stretch_camera_testrig/.idea/misc.xml
  4. +0
    -8
      stretch_camera_testrig/.idea/modules.xml
  5. +0
    -8
      stretch_camera_testrig/.idea/stretch_camera_testrig.iml
  6. +0
    -6
      stretch_camera_testrig/.idea/vcs.xml
  7. +3599
    -9599
      stretch_camera_testrig/data/results/testrig_errors_data_202202171855.yaml
  8. +4
    -63
      stretch_camera_testrig/data/results/testrig_results_202202171855.yaml
  9. +13
    -8
      stretch_camera_testrig/nodes/testrig_analyze_data.py
  10. +24
    -5
      stretch_camera_testrig/nodes/testrig_dashboard.py

+ 0
- 3
stretch_camera_testrig/.idea/.gitignore View File

@ -1,3 +0,0 @@
# Default ignored files
/shelf/
/workspace.xml

+ 0
- 6
stretch_camera_testrig/.idea/inspectionProfiles/profiles_settings.xml View File

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

+ 0
- 4
stretch_camera_testrig/.idea/misc.xml View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
</project>

+ 0
- 8
stretch_camera_testrig/.idea/modules.xml View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/stretch_camera_testrig.iml" filepath="$PROJECT_DIR$/.idea/stretch_camera_testrig.iml" />
</modules>
</component>
</project>

+ 0
- 8
stretch_camera_testrig/.idea/stretch_camera_testrig.iml View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

+ 0
- 6
stretch_camera_testrig/.idea/vcs.xml View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

+ 3599
- 9599
stretch_camera_testrig/data/results/testrig_errors_data_202202171855.yaml
File diff suppressed because it is too large
View File


+ 4
- 63
stretch_camera_testrig/data/results/testrig_results_202202171855.yaml View File

@ -1,65 +1,6 @@
capture_id: '202202171855'
lighting_condition:
brightness: null
temperature: null
null_frames:
base_left_marker_pose: 0
base_right_marker_pose: 0
shoulder_marker_pose: 327
wrist_inside_marker_pose: 0
wrist_top_marker_pose: 0
lighting_condition: {brightness: null, temperature: null}
null_frames: {base_left_marker_pose: 0, base_right_marker_pose: 0, shoulder_marker_pose: 327,
wrist_inside_marker_pose: 0, wrist_top_marker_pose: 0}
number_samples: 600
performance_metrics:
angle_rotation_error:
base_left_marker_pose:
maximum: 3.130310772767618
mean: 3.1123105605302857
median: 3.1121101802740316
rmse: 3.1123183433291164
base_right_marker_pose:
maximum: 3.141490159715747
mean: 3.126268687591132
median: 3.1270113289070975
rmse: 3.1262809684459114
shoulder_marker_pose:
maximum: 3.1351679171566076
mean: 3.112359136964902
median: 3.1132823943622094
rmse: 3.112370862795674
wrist_inside_marker_pose:
maximum: 3.1351074913380303
mean: 3.091203628929577
median: 3.0897949788692305
rmse: 3.09122966284615
wrist_top_marker_pose:
maximum: 3.1412404426476863
mean: 3.1094737772610457
median: 3.1103044636557806
rmse: 3.1095094548879647
euclidean_error:
base_left_marker_pose:
maximum: 0.5824225026965391
mean: 0.5820963567556977
median: 0.5820901959143456
rmse: 0.5820963644996675
base_right_marker_pose:
maximum: 0.5793795286072739
mean: 0.578940614355908
median: 0.5789297846748012
rmse: 0.5789406328075614
shoulder_marker_pose:
maximum: 0.5814463353933174
mean: 0.5812017213971998
median: 0.5812040960870808
rmse: 0.5812017272530052
wrist_inside_marker_pose:
maximum: 0.5788094647317441
mean: 0.5784990979155296
median: 0.5784922563334053
rmse: 0.5784991059700069
wrist_top_marker_pose:
maximum: 0.5806082586912994
mean: 0.5802254663635843
median: 0.5802384545676887
rmse: 0.5802254782763624
realsense_firmware: 05.13.00.50
realsense_firmware: null

+ 13
- 8
stretch_camera_testrig/nodes/testrig_analyze_data.py View File

@ -101,10 +101,15 @@ class TestRig_Analyze:
return null_counts
def get_realsense_fw(self):
fw_details = Popen("rs-fw-update -l | grep -i 'firmware'", shell=True, bufsize=64, stdin=PIPE, stdout=PIPE,
close_fds=True).stdout.read()
fw_details = fw_details.split(',')[3]
fw_version = fw_details.split(' ')[-1]
fw_version = None
try:
fw_details = Popen("rs-fw-update -l | grep -i 'firmware'", shell=True, bufsize=64, stdin=PIPE, stdout=PIPE,
close_fds=True).stdout.read()
fw_v = fw_details.split(',')[3]
fw_v = fw_details.split(' ')[-1]
except:
print('[Error] Realsense FW not found.')
return fw_version
def testrg_data_parse(self, filename):
@ -131,7 +136,7 @@ class TestRig_Analyze:
data_dict[key].append(None)
return data_dict
except IOError:
print('[Error]:Unable to open Testrig Data file: {0}'.format(filename))
print('[Error] Unable to open Testrig Data file: {0}'.format(filename))
def get_euclidean_errors(self, data_dict, nominal_poses_dict):
error_dict = {}
@ -140,7 +145,7 @@ class TestRig_Analyze:
for key in self.data_keys:
error_dict[key] = []
if Num_samples != len(data_dict[key]):
print('[Warning]: Number of samples found inconsistent for each Marker tag.')
print('[Warning] Number of samples found inconsistent for each Marker tag.')
for key in error_dict.keys():
for i in range(Num_samples):
@ -157,7 +162,7 @@ class TestRig_Analyze:
for key in self.data_keys:
error_dict[key] = []
if Num_samples != len(data_dict[key]):
print('[Warning]: Number of samples found inconsistent for each Marker tag.')
print('[Warning] Number of samples found inconsistent for each Marker tag.')
for key in error_dict.keys():
for i in range(Num_samples):
@ -187,7 +192,7 @@ class TestRig_Analyze:
nominal_poses_dict[key] = np.array(data['testrig_aruco_marker_info'][key])
return nominal_poses_dict
except IOError:
print('[Error]:Unable to open Testrig Nominal Poses file: {0}'.format(filename))
print('[Error] Unable to open Testrig Nominal Poses file: {0}'.format(filename))
def save_error_computations(self):
t = time.localtime()

+ 24
- 5
stretch_camera_testrig/nodes/testrig_dashboard.py View File

@ -1,11 +1,12 @@
#!/usr/bin/env python
from tkinter import *
from Tkinter import *
from testrig_analyze_data import TestRig_Analyze
import os
import yaml
import numpy as np
from tabulate import tabulate
import math
import pprint
class TestRig_dashboard():
@ -64,7 +65,7 @@ class TestRig_dashboard():
self.nominal_poses_label.place(x=x_off + 20, y=y_off + 120)
self.matrix_text_var = None
self.matrix_entries = None
self.create_matrix_entry(x_off + 50, y_off + 150)
self.create_matrix_entry(x_off + 30, y_off + 150)
self.update_nominal_poses_btn = Button(self.window, text="Update Nominal Poses",
command=self.update_nominal_poses)
self.update_nominal_poses_btn.place(x=x_off + 20, y=y_off + 280)
@ -77,13 +78,15 @@ class TestRig_dashboard():
command=self.radiobutton_sel)
self.nominal_poses_radiobuttons.append(r)
for i in range(len(self.nominal_poses_radiobuttons)):
self.nominal_poses_radiobuttons[i].place(x=x_off + 220, y=y_off + 165 + i * 20)
self.nominal_poses_radiobuttons[i].place(x=x_off + 155, y=y_off + 150 + i * 20)
################## Test Results Display Pane ########################
self.x_off_mid = 0
self.y_off_mid = 0
self.test_results_title = Label(self.window, text="Testrig Computed Results", font=("Arial", 18))
self.test_results_title.place(x=self.x_off_mid + 20, y=self.y_off_mid + 330)
self.metric_title = None
self.test_info_title = None
################### Bottom Pane #########################
x_off_bottom = 0
@ -103,6 +106,19 @@ class TestRig_dashboard():
self.target_samples_lbl = Label(self.window, text="Enter Target frames:")
self.target_samples_lbl.place(x=x_off_bottom + 310, y=y_off_bottom + 546)
def test_data_info(self, x_pos, y_pos):
self.test_info_title = Label(self.window, text='Test Info', font=("Arial", 13, 'bold'))
self.test_info_title.place(x=x_pos, y=y_pos - 25)
info_dict = self.test_rig.test_results_dict
try:
del info_dict['performance_metrics']
except KeyError:
None
info_txt = str(yaml.safe_dump(info_dict, allow_unicode=True, default_flow_style=False))
self.info_print = Label(self.window, text=info_txt, anchor="w", font=("Arial", 12), justify=LEFT)
self.info_print.place(x=x_pos, y=y_pos)
def metrics_table_print(self, pos_x, pos_y, error_key):
n_rows = len(self.data_keys) + 1
n_columns = len(self.metrics_keys) + 1
@ -114,10 +130,12 @@ class TestRig_dashboard():
d.append(results[key][mkey])
data_list.append(d)
mkeys = self.metrics_keys
mkeys = ['Marker Tag'] + mkeys
mkeys = ['Marker Tags'] + mkeys
data_list = [mkeys] + data_list
x2 = 0
y2 = 0
self.metric_title = Label(self.window, text=error_key + ' Metrics', font=("Arial", 13, 'bold'))
self.metric_title.place(x=pos_x, y=pos_y - 25)
for i in range(n_rows):
for j in range(n_columns):
if j == 0:
@ -182,7 +200,7 @@ class TestRig_dashboard():
self.test_capture_id_lbl.configure(
text="Testrig Data Capture ID : {} loaded".format(self.test_rig.data_capture_date))
self.log('Loaded Test Rig data file : {}'.format(self.test_rig.data_filename.split('/')[-1]))
except:
except IOError:
self.log('Unable to load given data file:{}'.format(self.data_file_path.get()))
else:
self.log('Enter a data file path.')
@ -201,6 +219,7 @@ class TestRig_dashboard():
self.test_rig = test_rig
self.metrics_table_print(self.x_off_mid + 130, self.y_off_mid + 420, 'euclidean_error')
self.metrics_table_print(self.x_off_mid + 130, self.y_off_mid + 620, 'angle_rotation_error')
self.test_data_info(360, 150)
return test_rig
def mainloop(self):

Loading…
Cancel
Save