Browse Source

Updated Nominal Transforms only, Saves results file with Camera SN in filename

feature/d435i_testrig
Mohamed Fazil 2 years ago
parent
commit
3a6c47c6f7
13 changed files with 186661 additions and 106 deletions
  1. +86
    -93
      stretch_camera_testrig/config/testrig_marker_info.yaml
  2. +229
    -0
      stretch_camera_testrig/data/.ipynb_checkpoints/Testrig_Data_Analyse-checkpoint.ipynb
  3. +231
    -0
      stretch_camera_testrig/data/Testrig_Data_Analyse.ipynb
  4. +9600
    -0
      stretch_camera_testrig/data/results/testrig_errors_data_134322070297_202204261813.yaml
  5. +9600
    -0
      stretch_camera_testrig/data/results/testrig_errors_data_202204261414.yaml
  6. +68
    -0
      stretch_camera_testrig/data/results/testrig_results_134322070297_202204261813.yaml
  7. +68
    -0
      stretch_camera_testrig/data/results/testrig_results_202204261414.yaml
  8. +56874
    -0
      stretch_camera_testrig/data/testrig_collected_data_202204261414.yaml
  9. +57912
    -0
      stretch_camera_testrig/data/testrig_collected_data_202204261559.yaml
  10. +51976
    -0
      stretch_camera_testrig/data/testrig_collected_data_202204261813.yaml
  11. +9
    -5
      stretch_camera_testrig/nodes/testrig_analyze_data.py
  12. +2
    -2
      stretch_camera_testrig/nodes/testrig_collect_data
  13. +6
    -6
      stretch_camera_testrig/nodes/testrig_dashboard.py

+ 86
- 93
stretch_camera_testrig/config/testrig_marker_info.yaml View File

@ -1,93 +1,86 @@
# This file contains the nominal poses of the each Aruco markers
# that is to be used in the test rig. Each aruco marker's pose
# are to be measured and inserted as a 4x4 Homogeneous matrix
'testrig_aruco_marker_info':
'base_left_marker_pose':
- - 1.0
- 0.0
- 0.0
- 0.0
- - 0.0
- 1.0
- 0.0
- 0.0
- - 0.0
- 0.0
- 1.0
- 0.0
- - 0.0
- 0.0
- 0.0
- 1.0
'base_right_marker_pose':
- - 1.0
- 0.0
- 0.0
- 0.0
- - 0.0
- 1.0
- 0.0
- 0.0
- - 0.0
- 0.0
- 1.0
- 0.0
- - 0.0
- 0.0
- 0.0
- 1.0
'shoulder_marker_pose':
- - 1.0
- 0.0
- 0.0
- 0.0
- - 0.0
- 1.0
- 0.0
- 0.0
- - 0.0
- 0.0
- 1.0
- 0.0
- - 0.0
- 0.0
- 0.0
- 1.0
'wrist_inside_marker_pose':
- - 1.0
- 0.0
- 0.0
- 0.0
- - 0.0
- 1.0
- 0.0
- 0.0
- - 0.0
- 0.0
- 1.0
- 0.0
- - 0.0
- 0.0
- 0.0
- 1.0
'wrist_top_marker_pose':
- - 1.0
- 0.0
- 0.0
- 0.0
- - 0.0
- 1.0
- 0.0
- 0.0
- - 0.0
- 0.0
- 1.0
- 0.0
- - 0.0
- 0.0
- 0.0
- 1.0
testrig_aruco_marker_info:
base_left_marker_pose:
- - 1.0
- 0.0
- 0.0
- 0.009
- - 0.0
- 1.0
- 0.0
- -0.06418
- - 0.0
- 0.0
- 1.0
- 0.97551
- - 0.0
- 0.0
- 0.0
- 1.0
base_right_marker_pose:
- - 1.0
- 0.0
- 0.0
- 0.078
- - 0.0
- 1.0
- 0.0
- -0.06418
- - 0.0
- 0.0
- 1.0
- 0.97551
- - 0.0
- 0.0
- 0.0
- 1.0
shoulder_marker_pose:
- - 1.0
- 0.0
- 0.0
- 0.0858
- - 0.0
- 1.0
- 0.0
- -0.12048
- - 0.0
- 0.0
- 1.0
- 0.97551
- - 0.0
- 0.0
- 0.0
- 1.0
wrist_inside_marker_pose:
- - 1.0
- 0.0
- 0.0
- -0.00275
- - 0.0
- 1.0
- 0.0
- -0.12443
- - 0.0
- 0.0
- 1.0
- 0.97551
- - 0.0
- 0.0
- 0.0
- 1.0
wrist_top_marker_pose:
- - 1.0
- 0.0
- 0.0
- 0.03935
- - 0.0
- 1.0
- 0.0
- -0.12443
- - 0.0
- 0.0
- 1.0
- 0.97551
- - 0.0
- 0.0
- 0.0
- 1.0

+ 229
- 0
stretch_camera_testrig/data/.ipynb_checkpoints/Testrig_Data_Analyse-checkpoint.ipynb View File

@ -0,0 +1,229 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
"import yaml\n",
"import numpy as np\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [],
"source": [
"filename = 'testrig_collected_data_202204261559.yaml'"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {},
"outputs": [],
"source": [
"data_keys = ['base_left_marker_pose',\n",
" 'base_right_marker_pose',\n",
" 'wrist_inside_marker_pose',\n",
" 'wrist_top_marker_pose',\n",
" 'shoulder_marker_pose']\n",
"\n",
"def get_dict(filename):\n",
" with open(filename,'r') as file:\n",
" data = yaml.safe_load(file)\n",
" return data\n",
"\n",
"def get_avg_pos_vals(data):\n",
" avg_pose_sums = {}\n",
" null_cnt = {}\n",
" for key in data_keys:\n",
" avg_pose_sums[key] = np.zeros(3)\n",
" null_cnt[key] = 0\n",
" for d in data:\n",
" for key in data_keys:\n",
" m = np.array(d['camera_measurements'][key])\n",
" try:\n",
" pose = m[:3,3]\n",
" avg_pose_sums[key] = avg_pose_sums[key] + pose\n",
" except:\n",
" null_cnt[key] = null_cnt[key] + 1\n",
" for key in data_keys:\n",
" avg_pose_sums[key] = avg_pose_sums[key]/(len(data)-null_cnt[key])\n",
" return avg_pose_sums"
]
},
{
"cell_type": "code",
"execution_count": 54,
"metadata": {},
"outputs": [],
"source": [
"data = get_dict(filename)"
]
},
{
"cell_type": "code",
"execution_count": 55,
"metadata": {},
"outputs": [
{
"ename": "TypeError",
"evalue": "unsupported operand type(s) for -: 'int' and 'dict'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-55-42cc4761766e>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mget_avg_pos_vals\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m<ipython-input-53-b02bf3890354>\u001b[0m in \u001b[0;36mget_avg_pos_vals\u001b[0;34m(data)\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[0mnull_cnt\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnull_cnt\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 26\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mdata_keys\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 27\u001b[0;31m \u001b[0mavg_pose_sums\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mavg_pose_sums\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m/\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0mnull_cnt\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 28\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mavg_pose_sums\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mTypeError\u001b[0m: unsupported operand type(s) for -: 'int' and 'dict'"
]
}
],
"source": [
"get_avg_pos_vals(data)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['shoulder_marker_pose',\n",
" 'd435i_acceleration',\n",
" 'wrist_inside_marker_pose',\n",
" 'wrist_top_marker_pose',\n",
" 'base_right_marker_pose',\n",
" 'base_left_marker_pose']"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data[0]['camera_measurements'].keys()"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[ 0.99989452, -0.01255395, -0.00730402, 0.0239161 ],\n",
" [-0.01277629, -0.99943037, -0.03123614, -0.03452451],\n",
" [-0.00690772, 0.03132616, -0.99948535, 0.96807451],\n",
" [ 0. , 0. , 0. , 1. ]])"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m = np.array(data[0]['camera_measurements'][data_keys[0]])\n",
"m"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([ 0.0239161 , -0.03452451, 0.96807451])"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m = np.array(m)[:3,3]\n",
"m"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3,)"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m.shape"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3,)"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.zeros(3).shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.17"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

+ 231
- 0
stretch_camera_testrig/data/Testrig_Data_Analyse.ipynb View File

@ -0,0 +1,231 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
"import yaml\n",
"import numpy as np\n",
"import pandas as pd"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [],
"source": [
"filename = 'testrig_collected_data_202204261559.yaml'"
]
},
{
"cell_type": "code",
"execution_count": 56,
"metadata": {},
"outputs": [],
"source": [
"data_keys = ['base_left_marker_pose',\n",
" 'base_right_marker_pose',\n",
" 'wrist_inside_marker_pose',\n",
" 'wrist_top_marker_pose',\n",
" 'shoulder_marker_pose']\n",
"\n",
"def get_dict(filename):\n",
" with open(filename,'r') as file:\n",
" data = yaml.safe_load(file)\n",
" return data\n",
"\n",
"def get_avg_pos_vals(data):\n",
" avg_pose_sums = {}\n",
" null_cnt = {}\n",
" for key in data_keys:\n",
" avg_pose_sums[key] = np.zeros(3)\n",
" null_cnt[key] = 0\n",
" for d in data:\n",
" for key in data_keys:\n",
" m = np.array(d['camera_measurements'][key])\n",
" try:\n",
" pose = m[:3,3]\n",
" avg_pose_sums[key] = avg_pose_sums[key] + pose\n",
" except:\n",
" null_cnt[key] = null_cnt[key] + 1\n",
" for key in data_keys:\n",
" avg_pose_sums[key] = avg_pose_sums[key]/(len(data)-null_cnt[key])\n",
" return avg_pose_sums"
]
},
{
"cell_type": "code",
"execution_count": 57,
"metadata": {},
"outputs": [],
"source": [
"data = get_dict(filename)"
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'base_left_marker_pose': array([ 0.0239215, -0.0345387, 0.9687601]),\n",
" 'base_right_marker_pose': array([ 0.09184391, -0.03379975, 0.96848354]),\n",
" 'shoulder_marker_pose': array([ 0.09992021, -0.08972844, 0.97250558]),\n",
" 'wrist_inside_marker_pose': array([ 0.01281881, -0.09311278, 0.97060522]),\n",
" 'wrist_top_marker_pose': array([ 0.05436245, -0.09324136, 0.97268975])}"
]
},
"execution_count": 58,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"get_avg_pos_vals(data)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['shoulder_marker_pose',\n",
" 'd435i_acceleration',\n",
" 'wrist_inside_marker_pose',\n",
" 'wrist_top_marker_pose',\n",
" 'base_right_marker_pose',\n",
" 'base_left_marker_pose']"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"data[0]['camera_measurements'].keys()"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[ 0.99989452, -0.01255395, -0.00730402, 0.0239161 ],\n",
" [-0.01277629, -0.99943037, -0.03123614, -0.03452451],\n",
" [-0.00690772, 0.03132616, -0.99948535, 0.96807451],\n",
" [ 0. , 0. , 0. , 1. ]])"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m = np.array(data[0]['camera_measurements'][data_keys[0]])\n",
"m"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([ 0.0239161 , -0.03452451, 0.96807451])"
]
},
"execution_count": 32,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m = np.array(m)[:3,3]\n",
"m"
]
},
{
"cell_type": "code",
"execution_count": 33,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3,)"
]
},
"execution_count": 33,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"m.shape"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(3,)"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"np.zeros(3).shape"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.17"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

+ 9600
- 0
stretch_camera_testrig/data/results/testrig_errors_data_134322070297_202204261813.yaml
File diff suppressed because it is too large
View File


+ 9600
- 0
stretch_camera_testrig/data/results/testrig_errors_data_202204261414.yaml
File diff suppressed because it is too large
View File


+ 68
- 0
stretch_camera_testrig/data/results/testrig_results_134322070297_202204261813.yaml View File

@ -0,0 +1,68 @@
Realsense Details:
firmware: 05.13.00.50
serial: '134322070297'
usb: '3.2'
capture_id: '202204261813'
lighting_condition:
brightness: null
temperature: null
null_frames:
base_left_marker_pose: 272
base_right_marker_pose: 192
shoulder_marker_pose: 0
wrist_inside_marker_pose: 0
wrist_top_marker_pose: 0
number_samples: 600
performance_metrics:
angle_rotation_error:
base_left_marker_pose:
maximum: 3.1258827310374016
mean: 3.0725028300116475
median: 3.0746407646264298
rmse: 3.0725811678416126
base_right_marker_pose:
maximum: 3.1415600463725744
mean: 3.1281164385598323
median: 3.131120104508878
rmse: 3.1281361865272763
shoulder_marker_pose:
maximum: 3.1389336379556836
mean: 3.0512989442373804
median: 3.0493995194523613
rmse: 3.0515383390778847
wrist_inside_marker_pose:
maximum: 3.13906352088329
mean: 2.9671124450790147
median: 2.9631123705678677
rmse: 2.967834290736253
wrist_top_marker_pose:
maximum: 3.1415549339204576
mean: 3.0767871487676173
median: 3.084675730671946
rmse: 3.07717660415396
euclidean_error:
base_left_marker_pose:
maximum: 0.03414611432137011
mean: 0.03399378330856081
median: 0.03399530706887118
rmse: 0.033993842471503145
base_right_marker_pose:
maximum: 0.03455412890846682
mean: 0.03436417794040963
median: 0.03436250360749031
rmse: 0.03436421681807256
shoulder_marker_pose:
maximum: 0.0345151353685676
mean: 0.03424525455350311
median: 0.0342402193054973
rmse: 0.03424533774691318
wrist_inside_marker_pose:
maximum: 0.03582231291904326
mean: 0.035335379096608645
median: 0.03532788514175855
rmse: 0.03533579402749221
wrist_top_marker_pose:
maximum: 0.03533980379142684
mean: 0.034731985234355375
median: 0.034705777990379355
rmse: 0.03473224997401931

+ 68
- 0
stretch_camera_testrig/data/results/testrig_results_202204261414.yaml View File

@ -0,0 +1,68 @@
Realsense Details:
firmware: 05.13.00.50
serial: '134322070297'
usb: '3.2'
capture_id: '202204261414'
lighting_condition:
brightness: null
temperature: null
null_frames:
base_left_marker_pose: 59
base_right_marker_pose: 90
shoulder_marker_pose: 4
wrist_inside_marker_pose: 0
wrist_top_marker_pose: 0
number_samples: 600
performance_metrics:
angle_rotation_error:
base_left_marker_pose:
maximum: 3.1275576076978107
mean: 3.0844446192804003
median: 3.085289002989193
rmse: 3.084509116150328
base_right_marker_pose:
maximum: 3.1415675780257146
mean: 3.120280746109533
median: 3.1220539908722342
rmse: 3.1203188088447393
shoulder_marker_pose:
maximum: 3.1412206574486286
mean: 3.0803388462890138
median: 3.086926562084815
rmse: 3.0805747860699184
wrist_inside_marker_pose:
maximum: 3.140033572342562
mean: 3.028636293238632
median: 3.034294458026425
rmse: 3.0294976506020994
wrist_top_marker_pose:
maximum: 3.1414217232795028
mean: 2.9309349672425977
median: 2.9226252953142797
rmse: 2.9319990113675507
euclidean_error:
base_left_marker_pose:
maximum: 0.9724175395587147
mean: 0.9711948725610475
median: 0.9711874765852018
rmse: 0.9711949482590717
base_right_marker_pose:
maximum: 0.9739097812523311
mean: 0.9731779719411534
median: 0.9731709697130762
rmse: 0.973177992657312
shoulder_marker_pose:
maximum: 0.9860701882814852
mean: 0.9846072444944528
median: 0.9846312727709248
rmse: 0.9846073629903658
wrist_inside_marker_pose:
maximum: 0.9834809515322587
mean: 0.9805508942375426
median: 0.9805141568620914
rmse: 0.9805512942588581
wrist_top_marker_pose:
maximum: 0.9819304933010518
mean: 0.9784622428409652
median: 0.9783632048498961
rmse: 0.9784627071336145

+ 56874
- 0
stretch_camera_testrig/data/testrig_collected_data_202204261414.yaml
File diff suppressed because it is too large
View File


+ 57912
- 0
stretch_camera_testrig/data/testrig_collected_data_202204261559.yaml
File diff suppressed because it is too large
View File


+ 51976
- 0
stretch_camera_testrig/data/testrig_collected_data_202204261813.yaml
File diff suppressed because it is too large
View File


+ 9
- 5
stretch_camera_testrig/nodes/testrig_analyze_data.py View File

@ -23,8 +23,8 @@ data_file = None
class TestRig_Analyze:
def __init__(self, data_filename=None):
self.ros_package_dir = os.path.expanduser('~/catkin_ws/src/stretch_ros/stretch_camera_testrig')
self.data_directory = self.ros_package_dir+'/data'
self.nominal_poses_filename = self.ros_package_dir+'/config/testrig_marker_info.yaml'
self.data_directory = self.ros_package_dir + '/data'
self.nominal_poses_filename = self.ros_package_dir + '/config/testrig_marker_info.yaml'
self.data_keys = ['base_left_marker_pose',
'base_right_marker_pose',
'wrist_inside_marker_pose',
@ -48,6 +48,8 @@ class TestRig_Analyze:
files.sort()
if files[-1].startswith("testrig_collected_data_"):
self.data_filename = self.data_directory + '/' + files[-1]
else:
print('[Error] No Test Data Found')
capture_date = self.data_filename.split('_')[-1]
capture_date = capture_date.split('.')[0]
@ -107,7 +109,7 @@ class TestRig_Analyze:
nulls = 0
for x in self.data_dict[key]:
if x is None:
nulls = nulls+1
nulls = nulls + 1
null_counts[key] = nulls
return null_counts
@ -228,14 +230,16 @@ class TestRig_Analyze:
error['error_data'][key] = vals
testrig_results.append(error)
filename = self.data_directory + '/results/testrig_errors_data_' + capture_date + '.yaml'
filename = self.data_directory + '/results/testrig_errors_data_' + self.realsense_details[
'serial'] + '_' + capture_date + '.yaml'
with open(filename, 'w') as file:
documents = yaml.dump(testrig_results, file)
print('Test Rig Computed Error Data Saved to : {}'.format(filename))
def save_testrig_results(self):
filename = self.data_directory + '/results/testrig_results_' + self.data_capture_date + '.yaml'
filename = self.data_directory + '/results/testrig_results_' + self.realsense_details[
'serial'] + '_' + self.data_capture_date + '.yaml'
with open(filename, 'w') as file:
documents = yaml.dump(self.test_results_dict, file)
print('Test Rig Results Data Saved to : {}'.format(filename))

+ 2
- 2
stretch_camera_testrig/nodes/testrig_collect_data View File

@ -5,9 +5,9 @@ import rospy
if __name__ == '__main__':
rospy.sleep(15) # Wait until Aruco Detector stabilizes
rospy.sleep(15) # Wait until Aruco Detector stabilizes
try:
node = CollectHeadCalibrationDataNode(test_rig=True)
node.main()
except rospy.ROSInterruptException:
pass
pass

+ 6
- 6
stretch_camera_testrig/nodes/testrig_dashboard.py View File

@ -79,13 +79,13 @@ class TestRig_dashboard():
vi = vi + 1
self.nominal_poses_radiobuttons.append(r)
for i in range(len(self.nominal_poses_radiobuttons)):
self.nominal_poses_radiobuttons[i].place(x=x_off + 155, y=y_off + 150 + i * 20)
self.nominal_poses_radiobuttons[i].place(x=x_off + 250, 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.test_results_title.place(x=self.x_off_mid + 50, y=self.y_off_mid + 330)
self.metric_title = None
self.test_info_title = None
@ -116,7 +116,7 @@ class TestRig_dashboard():
del info_dict['performance_metrics']
except KeyError:
print('Performance Metrics not found.')
info_txt = str(yaml.safe_dump(info_dict, allow_unicode=True, default_flow_style=False))
info_txt = str(yaml.safe_dump(info_dict, allow_unicode=True, default_flow_style=False, indent=4))
self.info_print = Label(self.window, text=info_txt, anchor="w", font=("Arial", 11), justify=LEFT)
self.info_print.place(x=x_pos, y=y_pos)
@ -167,9 +167,9 @@ class TestRig_dashboard():
for j in range(cols):
# append your StringVar and Entry
self.matrix_text_var[i].append(StringVar())
self.matrix_entries[i].append(Entry(self.window, textvariable=self.matrix_text_var[i][j], width=3))
self.matrix_entries[i].append(Entry(self.window, textvariable=self.matrix_text_var[i][j], width=6))
self.matrix_entries[i][j].place(x=pos_x + x2, y=pos_y + y2)
x2 += 30
x2 += 55
y2 += 30
x2 = 0
@ -280,7 +280,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(380, 140)
self.test_data_info(480, 140)
return test_rig
def mainloop(self):

Loading…
Cancel
Save