-
Notifications
You must be signed in to change notification settings - Fork 0
/
f3b_rob_cam_members.py
113 lines (91 loc) · 2.92 KB
/
f3b_rob_cam_members.py
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
# PYTHON IMPORTS
import json
# LOCAL IMPORTS
from src.robot_camera import robot_camera_aquisition
from src.io import _generate_range
from src.process_pcd import (
pcd_stitch_individual_rob,
pcd_stitch_combine_rob,
)
def aquisition_members(rob_nums, save_config_n=False, pose_range=False, transform=False):
"""perform camera aquisition for the post-disassembly scanning process"""
folders = [
"configs/stitch_members/R{}",
"data/stitch_members/R{}",
"input_settings",
"transformations", # needed if transformation specified
]
filenames = [
"stitch_members_{0:0{width}}.json",
"pos{:02d}.yaml",
"img{:02d}", # if transformation, save .ply, otherwise .zdf
"capture_settings_z{}_shed.yml",
"R{}_H2_tool0_cam.yaml", # needed if transformation specified (hard-coded)
"R{}_H4_world0_rbase.yaml", # needed if transformation specified (hard-coded)
]
robot_camera_aquisition(rob_nums, folders, filenames, save_config_n, pose_range, transform)
def stitch_members(rob_nums, stitch=False, stitch_full=False, pose_range=False, vis_on=False):
folders = [
"transformations",
"configs/stitch_members/R{}",
"data/stitch_members/R{}",
"data/stitch_members",
]
filenames = [
"img{:02d}.zdf",
"img{:02d}_trns.ply",
"R{}_H2_tool0_cam.yaml",
"pos{:02d}.yaml",
"R{}_H4_world0_rbase.yaml",
"_R{}_pcd_stitched.pts",
"_o3d_view_settings_R{}.json",
"_o3d_view_settings_full.json",
"pcd_full.pts",
]
pose_range = _generate_range(folders[1].format(rob_nums[0]), pose_range)
if stitch:
# HD
pcd_vars = {
"voxels": 0.0005,
"neighbors": 8,
"std_dev": 2.0,
"radius": 0.08,
"radius_pnts": 30,
}
# LD
# pcd_vars = {
# "voxels": 0.005,
# "neighbors": 20,
# "std_dev": 1.0,
# "radius": 0.08,
# "radius_pnts": 30,
# }
pcd_stitch_individual_rob(rob_nums, pose_range, folders, filenames, pcd_vars, vis_on)
if stitch_full:
# HD
pcd_vars = {
"voxels": 0.001,
"neighbors": 30,
"std_dev": 2.0,
"radius": 0.08,
"radius_pnts": 30,
}
# LD
pcd_vars = {
"voxels": 0.010,
"neighbors": 30,
"std_dev": 2.0,
"radius": 0.08,
"radius_pnts": 30,
}
pcd_stitch_combine_rob(folders, filenames, pcd_vars, vis_on)
if __name__ == "__main__":
rob_nums = [1]
# set "save_config_n" to FALSE to execute aquisition
# aquisition_members(rob_nums, save_config_n=False, pose_range=range(26, 31), transform=True)
stitch_members(
rob_nums,
stitch=True,
stitch_full=False,
vis_on=True,
)