byml commited on
Commit
118b03c
·
verified ·
1 Parent(s): 26c5637

Add files using upload-large-folder tool

Browse files
_download.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import snapshot_download
2
+ import os
3
+
4
+ snapshot_download(repo_id="TianxingChen/RoboTwin",
5
+ allow_patterns=['textures.zip', 'objects.zip', 'messy_objects.zip'],
6
+ local_dir='.',
7
+ repo_type="dataset",
8
+ resume_download=True)
9
+
10
+ snapshot_download(repo_id="TianxingChen/Embodiments",
11
+ allow_patterns=['aloha-agilex.zip'],
12
+ local_dir='.',
13
+ repo_type="dataset",
14
+ resume_download=True)
_upload.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from huggingface_hub import login, upload_file, upload_folder, create_repo
2
+
3
+ upload_folder(
4
+ folder_path="./upload_cache/embodiments_zip",
5
+ path_in_repo="./",
6
+ repo_id="TianxingChen/Embodiments",
7
+ repo_type="dataset",
8
+ )
9
+
10
+ upload_file(
11
+ path_or_fileobj="./upload_cache/objects.zip",
12
+ path_in_repo="./objects.zip",
13
+ repo_id="TianxingChen/RoboTwin",
14
+ repo_type="dataset",
15
+ )
16
+
17
+ upload_file(
18
+ path_or_fileobj="./upload_cache/messy_objects.zip",
19
+ path_in_repo="./messy_objects.zip",
20
+ repo_id="TianxingChen/RoboTwin",
21
+ repo_type="dataset",
22
+ )
23
+
24
+ upload_file(
25
+ path_or_fileobj="./upload_cache/textures.zip",
26
+ path_in_repo="./textures.zip",
27
+ repo_id="TianxingChen/RoboTwin",
28
+ repo_type="dataset",
29
+ )
messy_objects/bowl_017/017.obj.mtl ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # Wavefront material file
3
+ # Converted by Meshlab Group
4
+ #
5
+
6
+ newmtl material_0
7
+ Ka 0.200000 0.200000 0.200000
8
+ Kd 1.000000 1.000000 1.000000
9
+ Ks 1.000000 1.000000 1.000000
10
+ illum 2
11
+ Ns 0.000000
12
+ map_Kd 017.jpg
13
+
messy_objects/bowl_017/coacd_collision.obj ADDED
The diff for this file is too large to render. See raw diff
 
messy_objects/bowl_017/model.urdf ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <robot name="model.urdf">
3
+ <link name="baseLink">
4
+ <contact>
5
+ <friction_anchor />
6
+ <lateral_friction value="0.3" />
7
+ <rolling_friction value="0.0" />
8
+ <contact_cfm value="0.0" />
9
+ <contact_erp value="1.0" />
10
+ </contact>
11
+ <inertial>
12
+ <origin rpy="0 0 0" xyz="0 0 0" />
13
+ <mass value="0.1" />
14
+ <inertia ixx="8e-05" ixy="0" ixz="0" iyy="0.0002" iyz="0" izz="0.0002" />
15
+ </inertial>
16
+ <visual>
17
+ <geometry>
18
+ <mesh filename="textured.obj" scale="0.001 0.001 0.001" />
19
+ </geometry>
20
+
21
+ </visual>
22
+ <collision>
23
+ <geometry>
24
+ <mesh filename="coacd_collision.obj" scale="0.001 0.001 0.001" />
25
+ </geometry>
26
+ </collision>
27
+ </link>
28
+ </robot>
messy_objects/bowl_017/model_annnotation.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"direction_axis": {"axis": 2, "axis_sign": 1}, "approach_axis": {"axis": 0, "axis_sign": 1}, "object_symmetry": 3, "object_size": [0.031906284114999996, 0.057230487669999996, 0.05685877138]}
messy_objects/bowl_017/textured.obj ADDED
The diff for this file is too large to render. See raw diff
 
messy_objects/can_004/coacd_collision.obj ADDED
The diff for this file is too large to render. See raw diff
 
messy_objects/can_004/model_annnotation.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"direction_axis": {"axis": 2, "axis_sign": 1}, "approach_axis": {"axis": 0, "axis_sign": 1}, "object_symmetry": 3, "object_size": [0.021852546435000002, 0.043265668925, 0.043106667785]}
messy_objects/can_004/textured.obj ADDED
The diff for this file is too large to render. See raw diff
 
messy_objects/handbag_001/coacd_collision.obj ADDED
The diff for this file is too large to render. See raw diff
 
messy_objects/handbag_001/model_annnotation.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"direction_axis": {"axis": 2, "axis_sign": 1}, "approach_axis": {"axis": 0, "axis_sign": 1}, "object_symmetry": 2, "object_size": [0.09279825511, 0.06670545108999999, 0.11554223162999999]}
messy_objects/handbag_001/textured.obj ADDED
The diff for this file is too large to render. See raw diff
 
messy_objects/tissue_004/004.obj.mtl ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #
2
+ # Wavefront material file
3
+ # Converted by Meshlab Group
4
+ #
5
+
6
+ newmtl material_0
7
+ Ka 0.200000 0.200000 0.200000
8
+ Kd 1.000000 1.000000 1.000000
9
+ Ks 1.000000 1.000000 1.000000
10
+ illum 2
11
+ Ns 0.000000
12
+ map_Kd 004.jpg
13
+
messy_objects/tissue_004/coacd_collision.obj ADDED
The diff for this file is too large to render. See raw diff
 
messy_objects/tissue_004/model.urdf ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <robot name="model.urdf">
3
+ <link name="baseLink">
4
+ <contact>
5
+ <friction_anchor />
6
+ <lateral_friction value="0.3" />
7
+ <rolling_friction value="0.0" />
8
+ <contact_cfm value="0.0" />
9
+ <contact_erp value="1.0" />
10
+ </contact>
11
+ <inertial>
12
+ <origin rpy="0 0 0" xyz="0 0 0" />
13
+ <mass value="0.1" />
14
+ <inertia ixx="8e-05" ixy="0" ixz="0" iyy="0.0002" iyz="0" izz="0.0002" />
15
+ </inertial>
16
+ <visual>
17
+ <geometry>
18
+ <mesh filename="textured.obj" scale="0.001 0.001 0.001" />
19
+ </geometry>
20
+
21
+ </visual>
22
+ <collision>
23
+ <geometry>
24
+ <mesh filename="coacd_collision.obj" scale="0.001 0.001 0.001" />
25
+ </geometry>
26
+ </collision>
27
+ </link>
28
+ </robot>
messy_objects/tissue_004/model_annnotation.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"direction_axis": {"axis": 1, "axis_sign": 1}, "approach_axis": {"axis": 0, "axis_sign": 1}, "object_symmetry": 2, "object_size": [0.070306440525, 0.032228353115, 0.045417376094999996]}
messy_objects/tissue_004/textured.obj ADDED
The diff for this file is too large to render. See raw diff
 
objects/models.py ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import trimesh
2
+ import urdfpy
3
+ import json
4
+ import numpy as np
5
+
6
+
7
+ PI = np.pi
8
+
9
+ red_color = [1.0, 0.0, 0.0, 0.5] # red, A=1 表示不透明
10
+ green_color = [0.0, 1.0, 0.0, 0.5] # green, A=1 表示不透明
11
+ blue_color = [0.0, 0.0, 1.0, 0.5] # blue, A=1 表示不透明
12
+
13
+ def create_model_data(id):
14
+ file_path = f"./base{id}.glb"
15
+ save_path = f"./model_data{id}.json"
16
+
17
+ with open(save_path, 'r') as json_file:
18
+ data = json.load(json_file)
19
+
20
+ with open(file_path, 'rb') as file_obj:
21
+ mesh = trimesh.load(file_obj, file_type='glb')
22
+ # 创建一个场景
23
+ scene = trimesh.Scene(mesh)
24
+
25
+ oriented_bounding_box = mesh.bounding_box_oriented
26
+
27
+ scale = [0.05,0.05,0.05]
28
+
29
+ target_sphere = trimesh.creation.icosphere(subdivisions=2, radius=0.15)
30
+ target_trans_matrix_sphere = trimesh.transformations.translation_matrix([0,0,0])
31
+
32
+ target_sphere.apply_transform(target_trans_matrix_sphere)
33
+ target_sphere.visual.vertex_colors = np.array([red_color] * len(target_sphere.vertices))
34
+ target_points_list = [target_trans_matrix_sphere.tolist()]
35
+
36
+ # # 可视化网格和坐标轴
37
+ scene.add_geometry(target_sphere)
38
+
39
+ contact_points_list = []
40
+ contact_point_discription_list = []
41
+ orientation_point_list = []
42
+ functional_matrix = []
43
+
44
+ def add_contact_point(point_radius, pose:list, euler:list, discription: str):
45
+ contact_sphere = trimesh.creation.icosphere(subdivisions=2, radius=point_radius)
46
+ contact_trans_matrix_sphere = trimesh.transformations.translation_matrix(pose) @ trimesh.transformations.euler_matrix(euler[0], euler[1], euler[2])
47
+ contact_sphere.apply_transform(contact_trans_matrix_sphere)
48
+ contact_sphere.visual.vertex_colors = np.array([red_color] * len(contact_sphere.vertices))
49
+ contact_points_list.append(contact_trans_matrix_sphere.tolist())
50
+
51
+ axis = trimesh.creation.axis(axis_length=1.5)
52
+ axis.apply_transform(contact_trans_matrix_sphere)
53
+ scene.add_geometry(axis)
54
+ scene.add_geometry(contact_sphere)
55
+ contact_point_discription_list.append(discription)
56
+
57
+ # add_contact_point(0.3, [0, 0, 0], [0, 0, 0], "Grasping the side of the bottle.")
58
+ # add_contact_point(0.3, [0, 0, 0], [0, PI/2, 0], "Grasping the side of the bottle.")
59
+ # add_contact_point(0.3, [0, 0, 0], [0, PI, 0], "Grasping the side of the bottle.")
60
+ # add_contact_point(0.3, [0, 0, 0], [0, -PI/2, 0], "Grasping the side of the bottle.")
61
+
62
+
63
+ # 旋转矩阵的参数顺序是 (X, Y, Z) to endpose axis
64
+ transform_matrix = trimesh.transformations.euler_matrix(0,0,0)
65
+ transform_matrix = transform_matrix.tolist()
66
+
67
+ # 方向点
68
+ # orientation_point = trimesh.creation.icosphere(subdivisions=2, radius=0.1)
69
+ # orientation_point_sphere = trimesh.transformations.translation_matrix([0,oriented_bounding_box.extents[1]/2,0])
70
+ # orientation_point.apply_transform(orientation_point_sphere)
71
+ # orientation_point.visual.vertex_colors = np.array([green_color] * len(orientation_point.vertices))
72
+ # orientation_point_list = orientation_point_sphere.tolist()
73
+ # scene.add_geometry(orientation_point)
74
+
75
+ # axis1
76
+ axis1 = trimesh.creation.axis(axis_length=1.5)
77
+ axis1.apply_transform(transform_matrix)
78
+
79
+ # functional_sphere = trimesh.creation.icosphere(subdivisions=2, radius=0.15)
80
+ # functional_trans_matrix_sphere = trimesh.transformations.translation_matrix([0,0,0]) @ trimesh.transformations.euler_matrix(0,0,0)
81
+ # functional_sphere.apply_transform(functional_trans_matrix_sphere)
82
+ # functional_sphere.visual.vertex_colors = np.array([blue_color] * len(functional_sphere.vertices))
83
+ # functional_matrix = functional_trans_matrix_sphere.tolist()
84
+ # axis = trimesh.creation.axis(axis_length=1.5)
85
+ # axis.apply_transform(functional_trans_matrix_sphere)
86
+ # scene.add_geometry(axis)
87
+ # scene.add_geometry(functional_sphere)
88
+
89
+ data = {
90
+ 'center': oriented_bounding_box.centroid.tolist(), # 中心点
91
+ 'extents': oriented_bounding_box.extents.tolist(), # 尺寸
92
+ 'scale': scale, # 缩放
93
+ 'target_pose': target_points_list, # 目标点矩阵
94
+ 'contact_points_pose' : contact_points_list, # 抓取点矩阵(多个)
95
+ 'transform_matrix': transform_matrix, # 模型到标轴的旋转矩阵
96
+ "functional_matrix": functional_matrix, # 功能点矩阵
97
+ 'orientation_point': orientation_point_list,
98
+ 'contact_points_group': [[0]],
99
+ 'contact_points_mask': [True],
100
+ 'contact_points_discription': contact_point_discription_list, # 抓取点描述
101
+ 'target_point_discription': ["The center of the object."], # 目标点描述
102
+ 'functional_point_discription': [""],
103
+ 'orientation_point_discription': [""]
104
+ }
105
+ with open(save_path, 'w') as json_file:
106
+ json.dump(data, json_file, indent=4, separators=(',', ': '))
107
+
108
+ # 将坐标轴添加到场���
109
+ axis = trimesh.creation.axis(axis_length=1.5,origin_size= 0.05)
110
+ # scene.add_geometry(axis1)
111
+ scene.show()
112
+
113
+ if __name__ == "__main__":
114
+ id = ""
115
+ create_model_data(id)
objects/square_cylinder/model_data.json ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "center": [
3
+ 0.000764428347100258,
4
+ 6.630637143469917e-05,
5
+ -0.0009445592317205928
6
+ ],
7
+ "extents": [
8
+ 0.09270996178588131,
9
+ 0.09113055406854671,
10
+ 0.07790317673093121
11
+ ],
12
+ "scale": [
13
+ 1,
14
+ 1,
15
+ 1
16
+ ],
17
+ "target_pose": [
18
+ [
19
+ 1.0,
20
+ 0.0,
21
+ 0.0,
22
+ 0.0
23
+ ],
24
+ [
25
+ 0.0,
26
+ 1.0,
27
+ 0.0,
28
+ 0.0
29
+ ],
30
+ [
31
+ 0.0,
32
+ 0.0,
33
+ 1.0,
34
+ 0.0
35
+ ],
36
+ [
37
+ 0.0,
38
+ 0.0,
39
+ 0.0,
40
+ 1.0
41
+ ]
42
+ ],
43
+ "contact_pose": [
44
+ [
45
+ [
46
+ 1.0,
47
+ 0.0,
48
+ 0.0,
49
+ 0.0
50
+ ],
51
+ [
52
+ 0.0,
53
+ 1.0,
54
+ 0.0,
55
+ 0.0
56
+ ],
57
+ [
58
+ 0.0,
59
+ 0.0,
60
+ 1.0,
61
+ 0.0
62
+ ],
63
+ [
64
+ 0.0,
65
+ 0.0,
66
+ 0.0,
67
+ 1.0
68
+ ]
69
+ ]
70
+ ],
71
+ "trans_matrix": [
72
+ [
73
+ 1.0,
74
+ 0.0,
75
+ 0.0,
76
+ 0.0
77
+ ],
78
+ [
79
+ 0.0,
80
+ 1.0,
81
+ 0.0,
82
+ 0.0
83
+ ],
84
+ [
85
+ -0.0,
86
+ 0.0,
87
+ 1.0,
88
+ 0.0
89
+ ],
90
+ [
91
+ 0.0,
92
+ 0.0,
93
+ 0.0,
94
+ 1.0
95
+ ]
96
+ ]
97
+ }
objects/square_cylinder/texture.mtl ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Blender 4.3.2 MTL File: '四边形突起金属块.blend'
2
+ # www.blender.org
3
+
4
+ newmtl 材质
5
+ Ns 730.999146
6
+ Ka 1.000000 1.000000 1.000000
7
+ Kd 0.780308 0.801085 0.571671
8
+ Ks 0.500000 0.500000 0.500000
9
+ Ke 0.000000 0.000000 0.000000
10
+ Ni 1.000000
11
+ d 1.000000
12
+ illum 3
objects/square_cylinder/textured.mtl ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Blender 4.3.0 MTL File: 'None'
2
+ # www.blender.org
3
+
4
+ newmtl 材质.001
5
+ Ns 0.000000
6
+ Ka 1.000000 1.000000 1.000000
7
+ Kd 0.800000 0.800000 0.800000
8
+ Ks 0.000000 0.000000 0.000000
9
+ Ke 0.000000 0.000000 0.000000
10
+ Ni 1.500000
11
+ d 1.000000
12
+ illum 1
objects/square_cylinder/textured.obj ADDED
The diff for this file is too large to render. See raw diff
 
objects/tools/model_data5.json ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "center": [
3
+ -0.00035625568346149105,
4
+ -0.0007271684891307807,
5
+ -0.0005203154001654477
6
+ ],
7
+ "extents": [
8
+ 0.19819526495917353,
9
+ 1.9091073505858716,
10
+ 0.19798373915737602
11
+ ],
12
+ "scale": [
13
+ 0.13,
14
+ 0.13,
15
+ 0.13
16
+ ],
17
+ "target_pose": [
18
+ [
19
+ 1.0,
20
+ 0.0,
21
+ 0.0,
22
+ 0.0
23
+ ],
24
+ [
25
+ 0.0,
26
+ 1.0,
27
+ 0.0,
28
+ 0.0
29
+ ],
30
+ [
31
+ 0.0,
32
+ 0.0,
33
+ 1.0,
34
+ 0.0
35
+ ],
36
+ [
37
+ 0.0,
38
+ 0.0,
39
+ 0.0,
40
+ 1.0
41
+ ]
42
+ ],
43
+ "contact_pose": [
44
+ [
45
+ [
46
+ 1.0,
47
+ 0.0,
48
+ 0.0,
49
+ 0.0
50
+ ],
51
+ [
52
+ 0.0,
53
+ 1.0,
54
+ 0.0,
55
+ -0.2
56
+ ],
57
+ [
58
+ 0.0,
59
+ 0.0,
60
+ 1.0,
61
+ 0.0
62
+ ],
63
+ [
64
+ 0.0,
65
+ 0.0,
66
+ 0.0,
67
+ 1.0
68
+ ]
69
+ ]
70
+ ],
71
+ "trans_matrix": [
72
+ [
73
+ 1.0,
74
+ 0.0,
75
+ 0.0,
76
+ 0.0
77
+ ],
78
+ [
79
+ 0.0,
80
+ 1.0,
81
+ 0.0,
82
+ 0.0
83
+ ],
84
+ [
85
+ -0.0,
86
+ 0.0,
87
+ 1.0,
88
+ 0.0
89
+ ],
90
+ [
91
+ 0.0,
92
+ 0.0,
93
+ 0.0,
94
+ 1.0
95
+ ]
96
+ ]
97
+ }