-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripts-vision.js
131 lines (110 loc) · 3.99 KB
/
scripts-vision.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
function print_div(message)
{
console.log(message) // For debug purposes
//$("#print_div").append("<br/>" + message +"\n");
$("#print_div").append( message +" ");
// Scroll to the bottom in Golden Laytout as more data added.
var $textarea = $("#print_div").parent();
$textarea.scrollTop($textarea[0].scrollHeight);
}
// FOR OBJECT DETECTION TEST
function print_div_test_selected_camera(message)
{
$("#print_div_test_selected_camera").html(message)
}
function print_div_test_selected_visual(message)
{
$("#print_div_test_selected_visual").html(message)
}
function print_div_test_selected_camera_img_size(message)
{
$("#print_div_test_selected_camera_img_size").html(message)
}
function print_div_test_selected_visual_img_size(message)
{
$("#print_div_test_selected_visual_img_size").html(message)
}
function print_div_test_detected_obj_size(message)
{
$("#print_div_test_detected_obj_size").html(message)
}
function print_div_test_detected_obj_coordinates(message)
{
$("#print_div_test_detected_obj_coordinates").html(message)
}
function print_div_test_detected_obj_angle(message)
{
$("#print_div_test_detected_obj_angle").html(message)
}
// FOR CAMERA CALIBRATION
function print_div_selected_camera_matrix(message)
{
$("#print_div_selected_camera_matrix").html(message)
}
function print_div_selected_camera_distortion_coefficients(message)
{
$("#print_div_selected_camera_distortion_coefficients").html(message)
}
function print_div_selected_camera_RnT(message)
{
$("#print_div_selected_camera_RnT").html(message)
}
function print_div_selected_camera_calibration_error(message)
{
$("#print_div_selected_camera_calibration_error").html(message)
}
function print_div_num_captured_calibration_imgs(message)
{
$("#print_div_num_captured_calibration_imgs").html("Currently "+ message + " images are captured.")
}
function clear_div_modal_body_CameraCalibration(){
print_div("clearing modal<br>")
$("#modal_body_CameraCalibration div").empty()
}
// FOR ROBOT-CAMERA CALIBRATION
function print_div_selected_robotcamerapair_rotation_matrix(message)
{
$("#print_div_selected_robotcamerapair_rotation_matrix").html(message)
}
function print_div_selected_robotcamerapair_translation_vector(message)
{
$("#print_div_selected_robotcamerapair_translation_vector").html(message)
}
function print_div_robotcamera_calibration_selected_robot(message)
{
$("#print_div_robotcamera_calibration_selected_robot").html(message)
}
function print_div_robotcamera_calibration_selected_camera(message)
{
$("#print_div_robotcamera_calibration_selected_camera").html(message)
}
function print_div_num_captured_robotcamera_calibration_imgs(message)
{
$("#print_div_num_captured_robotcamera_calibration_imgs").html("Currently "+ message + " images are captured.")
}
function clear_div_modal_body_RobotCameraCalibration(){
print_div("clearing modal<br>")
$("#modal_body_RobotCameraCalibration div").empty()
}
function copy_saved_poses(){
print_div("Copying saved poses list 'select' into Robot Camera Calibration Modal<br>");
var $clone = $("#saved_poses_list").clone(true).prop('id', 'saved_poses_list_clone' );
$clone.appendTo("#table_cell_for_saved_poses");
}
function remove_copied_saved_poses(){
// print_div("Copying saved poses list 'select' into Robot Camera Calibration Modal<br>")
$("#table_cell_for_saved_poses").find("#saved_poses_list_clone").remove()
}
function run_vision(){
run_test_vision();
}
async function run_test_vision(){
await languagePluginLoader;
await pyodide.loadPackage(["numpy"]);
// const response_vision = await fetch("./RR-web_browser-Webcam/client_webcam.py", {cache: "no-store"});
// const response_vision = await fetch("./RR-Client-WebBrowser-Vision.py", {cache: "no-store"});
const response_vision = await fetch("./RR-Client-WebBrowser-Vision2.py", {cache: "no-store"});
const client_vision_py = await response_vision.text();
pyodide.runPython(client_vision_py)
}
run_vision();