├── output ├── result │ ├── Fourth_round │ │ ├── G4_3cm.csv │ │ ├── A2_3cm.csv │ │ ├── A4_3cm.csv │ │ ├── A6_3cm.csv │ │ ├── C0_3cm.csv │ │ ├── C2_3cm.csv │ │ ├── C4_3cm.csv │ │ ├── C6_3cm.csv │ │ ├── E0_3cm.csv │ │ ├── E2_3cm.csv │ │ ├── E6_3cm.csv │ │ ├── G0_3cm.csv │ │ ├── G2_3cm.csv │ │ ├── G6_3cm.csv │ │ └── obj3_3cm.csv │ ├── First_round │ │ ├── G0_bare_1.csv │ │ ├── G4_crusher_low_1.csv │ │ ├── G4_crusher_up_1.csv │ │ ├── E0_crusher_low_2.csv │ │ ├── E0_bare_2.csv │ │ ├── G0_cutter_2.csv │ │ ├── A0_for_all.csv │ │ ├── A2_for_all.csv │ │ ├── A4_for_all.csv │ │ ├── A6_for_all.csv │ │ ├── C0_for_all.csv │ │ ├── C2_for_all.csv │ │ ├── C4_bare.csv │ │ ├── C6_bare.csv │ │ ├── E0_bare_1.csv │ │ ├── G0_cutter_1.csv │ │ ├── E0_crusher_low_1.csv │ │ ├── obj1_bare.csv │ │ ├── C4_crusher_com.csv │ │ ├── E0_crusher_com.csv │ │ ├── G0_crusher_com.csv │ │ ├── G2_crusher_com.csv │ │ ├── G4_crusher_com.csv │ │ ├── G6_crusher_com.csv │ │ ├── obj1_crusher_com.csv │ │ ├── obj3_crusher_com.csv │ │ ├── G4_crusher_low_2.csv │ │ ├── C4_val.csv │ │ ├── E0_val.csv │ │ ├── E6_val.csv │ │ ├── G0_val.csv │ │ ├── G2_crusher_low.csv │ │ ├── G2_val.csv │ │ ├── G4_val.csv │ │ ├── G6_val.csv │ │ ├── E0_cutter.csv │ │ ├── E2_bare.csv │ │ ├── E4_bare.csv │ │ ├── E6_bare.csv │ │ ├── G0_bare_2.csv │ │ ├── G2_bare.csv │ │ ├── G2_cutter_1.csv │ │ ├── G2_cutter_2.csv │ │ ├── G4_bare.csv │ │ ├── G4_cutter.csv │ │ ├── G6_bare.csv │ │ ├── G6_cutter.csv │ │ ├── C4_crusher_up.csv │ │ ├── E0_crusher_up.csv │ │ ├── E2_crusher_up.csv │ │ ├── G2_crusher_up.csv │ │ ├── G4_crusher_up_2.csv │ │ ├── G6_crusher_low.csv │ │ └── G6_crusher_up.csv │ ├── Third_round │ │ ├── G4_small_2.csv │ │ ├── G6_small_1.csv │ │ ├── G4_small_1.csv │ │ ├── C0_big.csv │ │ ├── E0_big.csv │ │ ├── G0_big.csv │ │ ├── G2_big.csv │ │ ├── G4_big.csv │ │ ├── G6_big.csv │ │ ├── C4_small.csv │ │ ├── E0_small.csv │ │ ├── G0_small.csv │ │ ├── G2_small.csv │ │ ├── G6_small_2.csv │ │ ├── obj1_big.csv │ │ ├── obj1_small.csv │ │ ├── obj3_big.csv │ │ └── obj3_small.csv │ └── Second_round │ │ ├── C4_cutter7.csv │ │ ├── E0_cutter7.csv │ │ ├── G0_cutter7.csv │ │ ├── G2_cutter7.csv │ │ ├── G4_cutter7.csv │ │ ├── obj1_cutter3.csv │ │ ├── obj1_cutter5.csv │ │ ├── obj1_cutter7.csv │ │ ├── obj3_cutter3.csv │ │ ├── obj3_cutter5.csv │ │ ├── obj3_cutter7.csv │ │ ├── G6_cutter7.csv │ │ ├── C4_cutter3.csv │ │ ├── E0_cutter3.csv │ │ ├── G0_cutter3.csv │ │ ├── G2_cutter3.csv │ │ ├── G4_cutter3.csv │ │ └── G6_cutter3.csv └── cali_data │ ├── 2021-04-04-17:29:29.845119.npz │ ├── 2021-04-06-15:46:54.985955.npz │ ├── 2021-04-06-15:53:59.031430.npz │ ├── 2021-04-06-15:56:24.971024.npz │ ├── 2021-04-06-15:59:50.494395.npz │ ├── 2021-04-06-16:01:22.938339.npz │ ├── 2021-04-06-16:02:54.839241.npz │ ├── 2021-04-06-16:05:49.003709.npz │ ├── 2021-04-06-16:08:11.547885.npz │ ├── 2021-04-06-16:09:11.591813.npz │ ├── 2021-04-06-16:24:57.689214.npz │ ├── 2021-04-06-16:26:46.745055.npz │ ├── 2021-04-06-16:32:10.512707.npz │ ├── 2021-04-04-17:29:29.845106.csv │ ├── 2021-04-06-15:46:54.985943.csv │ ├── 2021-04-06-15:53:59.031417.csv │ ├── 2021-04-06-15:56:24.971011.csv │ ├── 2021-04-06-15:59:50.494385.csv │ ├── 2021-04-06-16:01:22.938328.csv │ ├── 2021-04-06-16:02:54.839231.csv │ ├── 2021-04-06-16:08:11.547875.csv │ ├── 2021-04-06-16:09:11.591801.csv │ ├── 2021-04-06-16:24:57.689205.csv │ ├── 2021-04-06-16:26:46.745043.csv │ ├── 2021-04-06-16:05:49.003695.csv │ └── 2021-04-06-16:32:10.512696.csv ├── Driver ├── __pycache__ │ ├── CH340.cpython-36.pyc │ └── realsense_wapper.cpython-36.pyc ├── Franka_status.py ├── Franka_move.py ├── CH340.py └── realsense_wapper.py ├── Utils ├── __pycache__ │ ├── ar_marker.cpython-36.pyc │ ├── calibration.cpython-36.pyc │ └── get_obj_by_color.cpython-36.pyc ├── calibration_display.py ├── camera_check.py ├── get_obj_by_color.py ├── ar_marker.py └── calibration.py ├── config ├── franka.yaml ├── cali2D.yaml ├── calibration.yaml ├── camera_rs_d435.yaml └── 2D_grasping.yaml ├── requirements.txt ├── Data_process ├── CSVProcess.py ├── Bar_Graph.py └── Plot.py ├── README.md ├── grasping_colorseg_OLD.py ├── 2D_grasping_soft.py ├── 2D_grasping_rigid.py └── grasping_by_ME336.py /output/result/Fourth_round/G4_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,0 4 | 2,0 5 | 3,0 6 | -------------------------------------------------------------------------------- /output/result/First_round/G0_bare_1.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,0 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | -------------------------------------------------------------------------------- /Driver/__pycache__/CH340.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/Driver/__pycache__/CH340.cpython-36.pyc -------------------------------------------------------------------------------- /Utils/__pycache__/ar_marker.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/Utils/__pycache__/ar_marker.cpython-36.pyc -------------------------------------------------------------------------------- /Utils/__pycache__/calibration.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/Utils/__pycache__/calibration.cpython-36.pyc -------------------------------------------------------------------------------- /output/cali_data/2021-04-04-17:29:29.845119.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-04-17:29:29.845119.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-15:46:54.985955.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-15:46:54.985955.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-15:53:59.031430.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-15:53:59.031430.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-15:56:24.971024.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-15:56:24.971024.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-15:59:50.494395.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-15:59:50.494395.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:01:22.938339.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-16:01:22.938339.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:02:54.839241.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-16:02:54.839241.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:05:49.003709.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-16:05:49.003709.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:08:11.547885.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-16:08:11.547885.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:09:11.591813.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-16:09:11.591813.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:24:57.689214.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-16:24:57.689214.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:26:46.745055.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-16:26:46.745055.npz -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:32:10.512707.npz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/output/cali_data/2021-04-06-16:32:10.512707.npz -------------------------------------------------------------------------------- /Driver/__pycache__/realsense_wapper.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/Driver/__pycache__/realsense_wapper.cpython-36.pyc -------------------------------------------------------------------------------- /Utils/__pycache__/get_obj_by_color.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iLori-Jiang/Grasping_Franka/HEAD/Utils/__pycache__/get_obj_by_color.cpython-36.pyc -------------------------------------------------------------------------------- /output/result/Third_round/G4_small_2.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,0 11 | 9,1 12 | -------------------------------------------------------------------------------- /output/result/Third_round/G6_small_1.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,0 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,0 9 | 7,1 10 | 8,1 11 | 9,0 12 | -------------------------------------------------------------------------------- /output/result/First_round/G4_crusher_low_1.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,0 8 | 6,0 9 | 7,1 10 | 8,1 11 | 9,1 12 | -------------------------------------------------------------------------------- /output/result/First_round/G4_crusher_up_1.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,0 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | -------------------------------------------------------------------------------- /output/result/First_round/E0_crusher_low_2.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,0 9 | 7,1 10 | 8,0 11 | 9,1 12 | 10,1 13 | -------------------------------------------------------------------------------- /output/result/First_round/E0_bare_2.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,0 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,0 9 | 7,1 10 | 8,0 11 | 9,1 12 | 10,0 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,0 22 | -------------------------------------------------------------------------------- /output/result/First_round/G0_cutter_2.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | -------------------------------------------------------------------------------- /config/franka.yaml: -------------------------------------------------------------------------------- 1 | # the units of the parameters is m, rad, m/s, m/s^2, g, pixel 2 | #robot ip and port 3 | name: Franka1 4 | ip: 192.168.1.102 5 | port: 30003 6 | velocity: 25 #scale [0~100] 7 | acceleration: 1.2 8 | home_joint: [0.6, 0.0, 0.4, 3.14, 0.0, 0.0] 9 | home_pose: None 10 | -------------------------------------------------------------------------------- /config/cali2D.yaml: -------------------------------------------------------------------------------- 1 | # robot base coordinate, unit meter 2 | # [x, y] 3 | xy1: [0.5, 0.0] #Point 1 4 | xy2: [0.5, 0.2] 5 | xy3: [0.4, -0.2] 6 | xy4: [0.3, -0.25] 7 | # camera base coordinate 8 | # [col, row] 9 | uv1: [678, 414] #Point 1 10 | uv2: [835, 420] 11 | uv3: [524, 328] 12 | uv4: [491, 251] 13 | -------------------------------------------------------------------------------- /output/result/First_round/A0_for_all.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/First_round/A2_for_all.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/First_round/A4_for_all.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/First_round/A6_for_all.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/First_round/C0_for_all.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/First_round/C2_for_all.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/First_round/C4_bare.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,0 4 | 2,1 5 | 3,0 6 | 4,0 7 | 5,1 8 | 6,1 9 | 7,0 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/First_round/C6_bare.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/First_round/E0_bare_1.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,0 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,0 15 | 13,0 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,0 20 | 18,1 21 | 19,1 22 | 20,0 23 | 21,1 24 | 22,0 25 | 23,0 26 | 24,0 27 | 25,0 28 | 26,0 29 | 27,0 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/Second_round/C4_cutter7.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,0 5 | 3,1 6 | 4,1 7 | 5,0 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/Second_round/E0_cutter7.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,0 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,0 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,0 17 | 15,1 18 | 16,0 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,0 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,0 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/Second_round/G0_cutter7.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,0 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/Second_round/G2_cutter7.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,0 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,0 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,0 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/Second_round/G4_cutter7.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,0 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,0 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,0 19 | 17,0 20 | 18,0 21 | 19,0 22 | 20,0 23 | 21,0 24 | 22,1 25 | 23,0 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,0 32 | -------------------------------------------------------------------------------- /output/result/Second_round/obj1_cutter3.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,0 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/Second_round/obj1_cutter5.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,0 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/Second_round/obj1_cutter7.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/Second_round/obj3_cutter3.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,0 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,0 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,0 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/Second_round/obj3_cutter5.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,0 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/Second_round/obj3_cutter7.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,0 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,0 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,0 28 | 26,0 29 | 27,1 30 | 28,1 31 | 29,1 32 | -------------------------------------------------------------------------------- /output/result/First_round/G0_cutter_1.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,0 33 | 31,1 34 | -------------------------------------------------------------------------------- /output/result/Second_round/G6_cutter7.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,0 32 | 30,1 33 | 31,1 34 | -------------------------------------------------------------------------------- /output/result/Third_round/G4_small_1.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,0 19 | 17,0 20 | 18,0 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,0 26 | 24,1 27 | 25,1 28 | 26,0 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # pip install -r requirements.txt 2 | 3 | # base ---------------------------------------- 4 | # ---------------------------L 5 | Cython 6 | matplotlib>=3.2.2 7 | numpy>=1.18.5 8 | opencv-python>=4.1.2 9 | pillow 10 | PyYAML>=5.3 11 | scipy>=1.4.1 12 | tensorboard>=2.2 13 | tqdm>=4.41.0 14 | 15 | pyrealsense2 16 | torch==1.6.0 17 | torchvision==0.7.0 18 | 19 | #---------------F 20 | sympy 21 | 22 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-04-17:29:29.845106.csv: -------------------------------------------------------------------------------- 1 | 1.959094284203961589e-01,9.739114819599186124e-01,-1.145247622247210217e-01,4.666834239531215678e-01 2 | 4.777646044518319979e-01,7.194342693903621466e-03,8.784584362200564822e-01,-6.496596525071893780e-01 3 | 8.563646878456503408e-01,-2.268141678551802154e-01,-4.638909943846549755e-01,7.677977631473040798e-01 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-15:46:54.985943.csv: -------------------------------------------------------------------------------- 1 | 1.417700500613726655e-01,9.582839455713915155e-01,-2.481796376935912207e-01,4.307156608752160665e-01 2 | -8.936312287771960294e-01,2.317432603157864035e-01,3.843413694261502700e-01,-9.085747576902565570e-02 3 | 4.258221223231065111e-01,1.672929794054013042e-01,8.892067134147770835e-01,-1.431365338685211541e-01 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-15:53:59.031417.csv: -------------------------------------------------------------------------------- 1 | 3.033074418645044235e-01,9.515665715431484983e-01,5.025590145672951398e-02,2.401648704910504251e-01 2 | -9.465945103561389518e-01,3.069371483759798513e-01,-9.873408687197793299e-02,2.453684703380759613e-01 3 | -1.093774596214042300e-01,-1.762517711797186373e-02,9.938440141482608459e-01,-1.611701677908120578e-01 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-15:56:24.971011.csv: -------------------------------------------------------------------------------- 1 | 9.668458061172219287e-01,5.293497566535085991e-02,-2.498140819586593953e-01,6.946787643249152655e-01 2 | -6.843615106892628197e-02,9.962053115006078707e-01,-5.377239593739576579e-02,-3.000327845817620243e-01 3 | 2.460196748644510045e-01,6.908592974901378581e-02,9.667995934475271946e-01,3.388263982951179032e-01 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-15:59:50.494385.csv: -------------------------------------------------------------------------------- 1 | 1.289186073038948166e-01,9.894330474107037032e-01,-6.634935856805561361e-02,5.593308645249951416e-01 2 | 9.454867062580679660e-01,-1.024635425847262304e-01,3.091215145056358526e-01,-3.412720939334911163e-01 3 | 2.990566517904160726e-01,-1.025839516325837558e-01,-9.487052502686752486e-01,1.326646375311472337e+00 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:01:22.938328.csv: -------------------------------------------------------------------------------- 1 | 1.908565694504281707e-01,8.777592259627948756e-01,-4.394456862170900702e-01,7.398205044815232556e-01 2 | -9.768737729338813347e-01,2.137987627154881443e-01,2.778635501475423472e-03,-6.155143426204053858e-01 3 | 9.639191694088034001e-02,4.287526446548425296e-01,8.982648651984227461e-01,-1.953640650090628372e-01 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:02:54.839231.csv: -------------------------------------------------------------------------------- 1 | 1.285940803764376028e-01,8.831490053903441328e-01,-4.511223744951965431e-01,2.378361006263295663e-01 2 | -2.817498543041316861e-01,4.686895212178439074e-01,8.372258669559780042e-01,-5.602644813178048189e-01 3 | 9.508315214020509609e-01,1.944137285878570418e-02,3.090978015606498097e-01,4.707529872938103210e-01 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:08:11.547875.csv: -------------------------------------------------------------------------------- 1 | 7.536950351111657564e-01,7.899688275687810624e-02,6.524594137289113638e-01,-9.758366449664684916e-02 2 | 5.583028529136503382e-01,4.468289409308743299e-01,-6.990291996584063750e-01,2.651751520162705100e-01 3 | -3.467588765659179728e-01,8.911247892754916577e-01,2.926685693091299889e-01,9.008425667450502550e-01 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:09:11.591801.csv: -------------------------------------------------------------------------------- 1 | -1.324904535365563074e-01,9.252439496759861104e-01,-3.554854614603233376e-01,8.534563025187119623e-01 2 | 9.818884757677479591e-01,1.715200025466541156e-01,8.047303822327306344e-02,-2.029982905495705814e-02 3 | 1.354300589831008983e-01,-3.383851685792053088e-01,-9.312111343886824155e-01,1.441479524932477219e+00 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:24:57.689205.csv: -------------------------------------------------------------------------------- 1 | 8.987202442772630473e-01,-4.373602156121644824e-01,-3.190555321410088602e-02,1.883453595299610095e-01 2 | 2.820865241905803900e-01,6.322897390434660814e-01,-7.215517159361640731e-01,-4.626353734407386287e-01 3 | 3.357515679729491942e-01,6.394730077962842429e-01,6.916250117684290544e-01,6.098064474621490705e-01 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:26:46.745043.csv: -------------------------------------------------------------------------------- 1 | 1.638180404547595614e-01,9.331488842006921969e-01,3.199950148620537282e-01,5.596312775577232390e-01 2 | 5.136173064054406767e-01,1.962632607012673169e-01,-8.352712104817968664e-01,1.118502131869190119e+00 3 | -8.422356630910273756e-01,3.011874705460197976e-01,-4.471299535970587602e-01,8.064262443800161995e-01 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:05:49.003695.csv: -------------------------------------------------------------------------------- 1 | -5.768561988256593054e-02,9.556914474700337614e-01,-2.886628249210416164e-01,8.590041290464962564e-01 2 | 9.982368347693559851e-01,5.926672914715824803e-02,-3.267495348861699546e-03,-4.569250509901498503e-02 3 | 1.398538409989365065e-02,-2.883423521594238315e-01,-9.574252435478967094e-01,1.471523626101649551e+00 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/cali_data/2021-04-06-16:32:10.512696.csv: -------------------------------------------------------------------------------- 1 | -1.126194341821007416e-01,9.905335097680514345e-01,-7.848712678579214397e-02,6.793084052780328230e-01 2 | 9.543626326849730113e-01,8.584134168208668036e-02,-2.860475998725150459e-01,7.045813245244239020e-01 3 | -2.766022927943851406e-01,-1.071196997979584620e-01,-9.549955714745930191e-01,1.442015736299691264e+00 4 | 0.000000000000000000e+00,0.000000000000000000e+00,0.000000000000000000e+00,1.000000000000000000e+00 5 | -------------------------------------------------------------------------------- /output/result/First_round/E0_crusher_low_1.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,0 17 | 15,1 18 | 16,0 19 | 17,1 20 | 18,1 21 | 19,0 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,0 26 | 24,0 27 | 25,1 28 | 26,1 29 | 27,0 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | -------------------------------------------------------------------------------- /output/result/Third_round/C0_big.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,0 9 | 7,0 10 | 8,0 11 | 9,0 12 | 10,0 13 | 11,0 14 | 12,1 15 | 13,1 16 | 14,0 17 | 15,1 18 | 16,1 19 | 17,0 20 | 18,0 21 | 19,0 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,0 38 | 36,0 39 | 37,0 40 | 38,0 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Third_round/E0_big.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,0 4 | 2,1 5 | 3,0 6 | 4,0 7 | 5,0 8 | 6,0 9 | 7,1 10 | 8,1 11 | 9,0 12 | 10,0 13 | 11,0 14 | 12,0 15 | 13,1 16 | 14,0 17 | 15,0 18 | 16,1 19 | 17,0 20 | 18,1 21 | 19,0 22 | 20,1 23 | 21,0 24 | 22,1 25 | 23,0 26 | 24,1 27 | 25,0 28 | 26,1 29 | 27,0 30 | 28,1 31 | 29,0 32 | 30,1 33 | 31,1 34 | 32,0 35 | 33,0 36 | 34,0 37 | 35,0 38 | 36,0 39 | 37,1 40 | 38,0 41 | 39,0 42 | -------------------------------------------------------------------------------- /output/result/Third_round/G0_big.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,0 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,0 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Third_round/G2_big.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,0 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,0 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Third_round/G4_big.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,0 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,0 18 | 16,0 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,0 25 | 23,1 26 | 24,0 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Third_round/G6_big.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,0 10 | 8,0 11 | 9,0 12 | 10,0 13 | 11,0 14 | 12,1 15 | 13,0 16 | 14,1 17 | 15,0 18 | 16,0 19 | 17,1 20 | 18,0 21 | 19,1 22 | 20,1 23 | 21,0 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,0 32 | 30,0 33 | 31,0 34 | 32,1 35 | 33,0 36 | 34,1 37 | 35,0 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/First_round/obj1_bare.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,0 9 | 7,0 10 | 8,0 11 | 9,0 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,0 18 | 16,1 19 | 17,0 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,0 34 | 32,0 35 | 33,0 36 | 34,0 37 | 35,1 38 | 36,0 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/A2_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/A4_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,0 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,0 21 | 19,1 22 | 20,1 23 | 21,0 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,0 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/A6_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/C0_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/C2_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,0 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,0 12 | 10,0 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,0 19 | 17,1 20 | 18,0 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,0 41 | 39,0 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/C4_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,0 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/C6_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,1 4 | 2,0 5 | 3,1 6 | 4,0 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,0 20 | 18,0 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/E0_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/E2_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,0 19 | 17,0 20 | 18,1 21 | 19,1 22 | 20,0 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,0 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/E6_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,0 8 | 6,0 9 | 7,0 10 | 8,0 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,0 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,0 32 | 30,1 33 | 31,0 34 | 32,1 35 | 33,0 36 | 34,0 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,0 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/G0_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,0 4 | 2,1 5 | 3,0 6 | 4,0 7 | 5,0 8 | 6,0 9 | 7,0 10 | 8,0 11 | 9,0 12 | 10,0 13 | 11,0 14 | 12,1 15 | 13,1 16 | 14,0 17 | 15,0 18 | 16,0 19 | 17,0 20 | 18,0 21 | 19,0 22 | 20,0 23 | 21,0 24 | 22,0 25 | 23,0 26 | 24,0 27 | 25,1 28 | 26,0 29 | 27,0 30 | 28,0 31 | 29,0 32 | 30,0 33 | 31,0 34 | 32,0 35 | 33,0 36 | 34,0 37 | 35,0 38 | 36,0 39 | 37,0 40 | 38,0 41 | 39,0 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/G2_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,0 4 | 2,0 5 | 3,1 6 | 4,0 7 | 5,0 8 | 6,0 9 | 7,0 10 | 8,0 11 | 9,0 12 | 10,0 13 | 11,0 14 | 12,0 15 | 13,0 16 | 14,0 17 | 15,0 18 | 16,0 19 | 17,0 20 | 18,1 21 | 19,0 22 | 20,0 23 | 21,0 24 | 22,0 25 | 23,0 26 | 24,0 27 | 25,0 28 | 26,0 29 | 27,0 30 | 28,0 31 | 29,0 32 | 30,0 33 | 31,0 34 | 32,0 35 | 33,0 36 | 34,0 37 | 35,0 38 | 36,0 39 | 37,0 40 | 38,0 41 | 39,0 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/G6_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,0 7 | 5,0 8 | 6,0 9 | 7,0 10 | 8,0 11 | 9,0 12 | 10,0 13 | 11,0 14 | 12,0 15 | 13,0 16 | 14,0 17 | 15,0 18 | 16,0 19 | 17,0 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,0 33 | 31,0 34 | 32,0 35 | 33,0 36 | 34,0 37 | 35,0 38 | 36,0 39 | 37,0 40 | 38,0 41 | 39,0 42 | -------------------------------------------------------------------------------- /output/result/Fourth_round/obj3_3cm.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,0 4 | 2,0 5 | 3,0 6 | 4,0 7 | 5,0 8 | 6,0 9 | 7,0 10 | 8,0 11 | 9,0 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,0 28 | 26,0 29 | 27,0 30 | 28,0 31 | 29,0 32 | 30,0 33 | 31,0 34 | 32,0 35 | 33,0 36 | 34,0 37 | 35,0 38 | 36,0 39 | 37,1 40 | 38,0 41 | 39,0 42 | -------------------------------------------------------------------------------- /output/result/Third_round/C4_small.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,0 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,0 34 | 32,0 35 | 33,1 36 | 34,1 37 | 35,0 38 | 36,0 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Third_round/E0_small.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,0 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,0 14 | 12,1 15 | 13,0 16 | 14,1 17 | 15,0 18 | 16,1 19 | 17,1 20 | 18,0 21 | 19,0 22 | 20,1 23 | 21,0 24 | 22,1 25 | 23,0 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,0 30 | 28,1 31 | 29,1 32 | 30,0 33 | 31,1 34 | 32,0 35 | 33,0 36 | 34,1 37 | 35,0 38 | 36,0 39 | 37,1 40 | 38,0 41 | 39,0 42 | -------------------------------------------------------------------------------- /output/result/Third_round/G0_small.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,0 4 | 2,0 5 | 3,1 6 | 4,1 7 | 5,0 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,0 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,0 19 | 17,1 20 | 18,0 21 | 19,1 22 | 20,0 23 | 21,0 24 | 22,0 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,0 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Third_round/G2_small.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,0 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,0 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,0 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,0 39 | 37,1 40 | 38,0 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Third_round/G6_small_2.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,0 4 | 2,1 5 | 3,1 6 | 4,0 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Third_round/obj1_big.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/Third_round/obj1_small.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,0 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,0 42 | -------------------------------------------------------------------------------- /output/result/Third_round/obj3_big.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,0 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,0 16 | 14,1 17 | 15,1 18 | 16,0 19 | 17,1 20 | 18,0 21 | 19,1 22 | 20,1 23 | 21,0 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,0 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,0 42 | -------------------------------------------------------------------------------- /output/result/Third_round/obj3_small.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,0 21 | 19,1 22 | 20,0 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,0 32 | 30,0 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,0 38 | 36,1 39 | 37,0 40 | 38,0 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/First_round/C4_crusher_com.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/First_round/E0_crusher_com.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,0 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,0 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,0 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,0 30 | 28,0 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,0 41 | 39,0 42 | -------------------------------------------------------------------------------- /output/result/First_round/G0_crusher_com.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/First_round/G2_crusher_com.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/First_round/G4_crusher_com.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/First_round/G6_crusher_com.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/First_round/obj1_crusher_com.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /output/result/First_round/obj3_crusher_com.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,0 10 | 8,0 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,0 19 | 17,1 20 | 18,0 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | -------------------------------------------------------------------------------- /config/calibration.yaml: -------------------------------------------------------------------------------- 1 | initial_position: 2 | - 0.45 3 | - -0.25 4 | - 0.4 5 | - 0.5 6 | - 0.0 7 | - 0.0 8 | 9 | x_stride: 0.1 10 | y_stride: 0.15 11 | z_stride: 0.15 12 | 13 | rotation_upper_limit: 0.5 14 | rotation_lower_limit: -0.5 15 | 16 | marker_size: 0.055 # in meter 17 | marker_repeat_sample: 10 18 | 19 | sample_cube_size: 3 # Totally sampled points = size ^ 3 20 | 21 | board_offset_x: 0 22 | board_offset_y: 0 23 | board_offset_z: 0 24 | 25 | save_dir: /cali_data/ 26 | -------------------------------------------------------------------------------- /output/result/First_round/G4_crusher_low_2.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,0 4 | 2,0 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,0 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,0 23 | 21,0 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,0 43 | -------------------------------------------------------------------------------- /Data_process/CSVProcess.py: -------------------------------------------------------------------------------- 1 | import csv 2 | 3 | result = {'0': 0, '1': 0} 4 | 5 | count = 0 6 | with open('/home/doyle/Me336/ME336-2021Spring/Grasping_Franka/output/result/obj3_3cm.csv') as file: 7 | f_csv = csv.reader(file) 8 | for row in f_csv: 9 | if count != 0: 10 | result[row[1]] += 1 11 | count += 1 12 | 13 | 14 | # previous adding 15 | i = 0 16 | j = 0 17 | success_rate = float((result['1'] + i) / (result['0'] + result['1'] + j)) 18 | 19 | print(result['1']) 20 | print(result['0'] + result['1']) 21 | print(success_rate) 22 | -------------------------------------------------------------------------------- /output/result/First_round/C4_val.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,0 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,0 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/E0_val.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,0 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,0 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,0 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,0 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,0 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/E6_val.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,0 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G0_val.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,0 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G2_crusher_low.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,0 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,0 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,0 49 | 47,1 50 | 48,1 51 | -------------------------------------------------------------------------------- /output/result/First_round/G2_val.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,0 8 | 6,1 9 | 7,0 10 | 8,1 11 | 9,0 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,0 25 | 23,0 26 | 24,0 27 | 25,0 28 | 26,0 29 | 27,1 30 | 28,0 31 | 29,1 32 | 30,1 33 | 31,0 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,0 39 | 37,0 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,0 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G4_val.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,0 4 | 2,0 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,0 20 | 18,0 21 | 19,0 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,0 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,0 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,0 48 | 46,1 49 | 47,0 50 | 48,0 51 | 49,0 52 | -------------------------------------------------------------------------------- /output/result/First_round/G6_val.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,0 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/E0_cutter.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,0 26 | 24,1 27 | 25,0 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,0 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,0 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,0 45 | 43,1 46 | 44,1 47 | 45,0 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,0 52 | -------------------------------------------------------------------------------- /output/result/First_round/E2_bare.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,0 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/E4_bare.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/E6_bare.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,0 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,0 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G0_bare_2.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,0 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,0 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,0 44 | 42,0 45 | 43,1 46 | 44,1 47 | 45,0 48 | 46,1 49 | 47,1 50 | 48,0 51 | 49,0 52 | -------------------------------------------------------------------------------- /output/result/First_round/G2_bare.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,0 12 | 10,0 13 | 11,1 14 | 12,1 15 | 13,0 16 | 14,0 17 | 15,0 18 | 16,0 19 | 17,0 20 | 18,0 21 | 19,0 22 | 20,0 23 | 21,0 24 | 22,0 25 | 23,0 26 | 24,0 27 | 25,0 28 | 26,0 29 | 27,0 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,0 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,0 46 | 44,0 47 | 45,0 48 | 46,1 49 | 47,0 50 | 48,0 51 | 49,0 52 | -------------------------------------------------------------------------------- /output/result/First_round/G2_cutter_1.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,0 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,0 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,0 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,0 30 | 28,0 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,0 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,0 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G2_cutter_2.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,0 7 | 5,0 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,0 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,0 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,0 41 | 39,1 42 | 40,0 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,0 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G4_bare.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,0 7 | 5,1 8 | 6,0 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,0 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G4_cutter.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,0 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,0 18 | 16,1 19 | 17,0 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,0 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G6_bare.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,0 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G6_cutter.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,0 15 | 13,0 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,0 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,0 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/Second_round/C4_cutter3.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,0 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,0 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,0 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/Second_round/E0_cutter3.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,0 4 | 2,0 5 | 3,0 6 | 4,0 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,0 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,0 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,0 29 | 27,1 30 | 28,1 31 | 29,0 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,0 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/Second_round/G0_cutter3.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,0 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,0 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,0 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/Second_round/G2_cutter3.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,0 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,0 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/Second_round/G4_cutter3.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,0 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,0 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,0 44 | 42,1 45 | 43,0 46 | 44,0 47 | 45,1 48 | 46,0 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/Second_round/G6_cutter3.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,0 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,0 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,0 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/C4_crusher_up.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/E0_crusher_up.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,0 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,0 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/E2_crusher_up.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G2_crusher_up.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,0 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,0 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G4_crusher_up_2.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,0 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G6_crusher_low.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,0 10 | 8,0 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,0 24 | 22,1 25 | 23,1 26 | 24,1 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /output/result/First_round/G6_crusher_up.csv: -------------------------------------------------------------------------------- 1 | num,if_success 2 | 0,1 3 | 1,1 4 | 2,1 5 | 3,1 6 | 4,1 7 | 5,1 8 | 6,1 9 | 7,1 10 | 8,1 11 | 9,1 12 | 10,1 13 | 11,1 14 | 12,1 15 | 13,1 16 | 14,1 17 | 15,1 18 | 16,1 19 | 17,1 20 | 18,1 21 | 19,1 22 | 20,1 23 | 21,1 24 | 22,1 25 | 23,1 26 | 24,0 27 | 25,1 28 | 26,1 29 | 27,1 30 | 28,1 31 | 29,1 32 | 30,1 33 | 31,1 34 | 32,1 35 | 33,1 36 | 34,1 37 | 35,1 38 | 36,1 39 | 37,1 40 | 38,1 41 | 39,1 42 | 40,1 43 | 41,1 44 | 42,1 45 | 43,1 46 | 44,1 47 | 45,1 48 | 46,1 49 | 47,1 50 | 48,1 51 | 49,1 52 | -------------------------------------------------------------------------------- /Utils/calibration_display.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | _root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 5 | sys.path.append(_root_path) 6 | os.chdir(_root_path) 7 | print('work_dir: ', _root_path) 8 | 9 | from Grasping_Franka.Utils.calibration import check_trans_matrix_from_file 10 | 11 | if __name__ == '__main__': 12 | # filename_npz = './Grasping_Franka/output/cali_data/2021-04-06-16:09:11.591813.npz' 13 | filename_npz = './Grasping_Franka/output/cali_data/2021-04-06-16:32:10.512707.npz' 14 | check_trans_matrix_from_file(filename_npz) 15 | -------------------------------------------------------------------------------- /Driver/Franka_status.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | from deepclaw.driver.arms.franka.FrankaController import FrankaController 4 | 5 | if __name__ == '__main__': 6 | _root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 7 | sys.path.append(_root_path) 8 | os.chdir(_root_path) 9 | print('work_dir: ', _root_path) 10 | FC = FrankaController('./Grasping_Franka/config/franka.yaml') 11 | 12 | # print('My Cartesian Pose: ', FC.getCartesianPose()) 13 | 14 | allState = FC.get_state() 15 | print('My state: ', allState) 16 | # move_p position 17 | print('My current position in base: ', allState['TCP_Pose']) 18 | # move_j position 19 | print('My current joint space: ', FC.getJoint()) 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Grasping_Franka 2 | Robotic grasping with Franka Emika and RealSense D435 and penumatic gripper with soft adaptive fingers. 3 | 4 | Pull this repository under https://github.com/bionicdl-sustech/ME336-2021Spring, the path should be "./ME336-2021Spring/Grasping_Franka". 5 | 6 | Object detection method is based on color difference, which is a white object on a black background. Can only grasp one object a time. 7 | 8 | Location transformation method is based on 2D location transformation (x, y), while the gripper approach the platform as close as possible (z). Grasping pose is perpendicular toward the platform (3.14, 0, alpha) 9 | 10 | Grasping can be finished automatically for multiple times, human labor only need to participate in finger and object replacement during the experiment. 11 | -------------------------------------------------------------------------------- /config/camera_rs_d435.yaml: -------------------------------------------------------------------------------- 1 | #camera parameters 2 | name: D435 3 | serial_number: 'None' 4 | # For D435, the resolution of RGB camera 320*180, 320*240, 424*240, 640*360, 640*480, 848*480, 960*540, 1280*720, 1920*1080 5 | # For 60 fps, the max resolution is 960*540. for 1280*720, 1920*1080 ,the max fps is 30. 6 | # for L515, the resolution of rgb is 1280*720, 60fps; 1920*1080, 30fps. 7 | color: 8 | width: 1280 9 | height: 720 10 | fps: 30 11 | exposure: None # None 12 | 13 | # the depth and infrared are corresponding, have same resolution 14 | # For D435, the resolution is multi, 640*480, 90fps; 1280*720, 30fps; 1280*800, 30fps 15 | # For L515, the resolution of rgb is 1024*768 or 640*480, and fps is 30 16 | depth_infrared: 17 | width: 1280 18 | height: 720 19 | fps: 30 20 | 21 | 22 | # for realsense, the align function is depth image aligned to other images or vice versa. 23 | # color or depth 24 | align_image: 'color' 25 | 26 | 27 | #inner_matrix: 28 | ## [fx,s,cx;0,fy,cy;0,0,1] 29 | # - [500,0,300] 30 | # - [0,520,200] 31 | # - [0,0,1] 32 | #distortion_coefficients: [0,0,0,0,0] 33 | 34 | 35 | -------------------------------------------------------------------------------- /Driver/Franka_move.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | from deepclaw.driver.arms.ArmController import ArmController 5 | 6 | import yaml 7 | import numpy as np 8 | from deepclaw.driver.arms.franka.FrankaController import FrankaController 9 | 10 | 11 | if __name__ == '__main__': 12 | _root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 13 | sys.path.append(_root_path) 14 | os.chdir(_root_path) 15 | print('work_dir: ', _root_path) 16 | FC = FrankaController('./Grasping_Franka/config/franka.yaml') 17 | 18 | ''' 19 | joint_target = np.array([-0.0137566, 0.0150639, 0.06416, -2.50988, -0.00736516, 2.80153, -1.8411]) 20 | FC.move_j(joint_target) 21 | pose = [0.5, 0, 0.4, 3.14, 0.0, 0.0] 22 | FC.move_p(pose) 23 | # speed_j 24 | joint_speed = [0, 0, 0, 0, 0, 0, 0.1] 25 | FC.speed_j(joint_speed) 26 | time.sleep(2) 27 | FC.stopSpeed() 28 | print('===========') 29 | ''' 30 | 31 | # -----look this 32 | # FC.move_p([0.420997, 0.123974, 0.350515, 3.14, -0.0, 2.037585010536264]) 33 | 34 | # FC.move_p([0.5437009, -0.01225163, 0.360596, 3.14, 0.0, 1.539121572633681]) 35 | 36 | 37 | -------------------------------------------------------------------------------- /Data_process/Bar_Graph.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | #%matplotlib inline 3 | 4 | obj1 = [0.8, 0.92, 0.84, 0.86, 0.88, 0.64] 5 | obj2 = [0.88, 0.75, 0.92, 0.96, 1, 1] 6 | obj3 = [0.36, 0.61, 0.74, 0.74, 0.92, 0.72] 7 | x=['Bare', 'No7_val', 'No1', 'No2', 'No3', 'No5'] 8 | 9 | plt.bar(x, obj1, 0.3, color='orange') 10 | #plt.plot(x, obj1, 'o-', mfc="none", mec="orange", c='orange', ms=10) 11 | for a, b in zip(x, obj1): 12 | plt.text(a, b+0.05, (b), ha='center', va='bottom', fontsize=10, c='orange') 13 | plt.ylabel("Success Rate") 14 | plt.ylim(0,1.1) 15 | #plt.title("Graph of the Root-mean-square Error") 16 | plt.show() 17 | 18 | plt.bar(x, obj2, 0.3, color='purple') 19 | #plt.xlabel() 20 | for a, b in zip(x, obj2): 21 | plt.text(a, b+0.05, (b), ha='center', va='bottom', fontsize=10, c='purple') 22 | plt.ylabel("Success Rate") 23 | plt.ylim(0,1.1) 24 | #plt.title("Graph of the Root-mean-square Error") 25 | plt.show() 26 | 27 | plt.bar(x, obj3, 0.3, color='g') 28 | #plt.xlabel() 29 | for a, b in zip(x, obj3): 30 | plt.text(a, b+0.05, (b), ha='center', va='bottom', fontsize=10, c='g') 31 | plt.ylabel("Success Rate") 32 | plt.ylim(0,1.1) 33 | #plt.title("Graph of the Root-mean-square Error") 34 | plt.show() 35 | 36 | 37 | -------------------------------------------------------------------------------- /Utils/camera_check.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | ''' 5 | output should be: 6 | work_dir: /home/doyle/Me336/ME336-2021Spring 7 | work_dir: /home/doyle/Me336/ME336-2021Spring 8 | work_dir: /home/doyle/Me336/ME336-2021Spring 9 | ''' 10 | 11 | _root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 12 | sys.path.append(_root_path) 13 | os.chdir(_root_path) 14 | print('work_dir: ', _root_path) 15 | 16 | import cv2 17 | 18 | # from deepclaw.driver.sensors.camera.Realsense_L515 import Realsense 19 | from Grasping_Franka.Driver.realsense_wapper import Realsense 20 | 21 | 22 | if __name__ == '__main__': 23 | # camera and robot driver 24 | print('work_dir: ', _root_path) 25 | ''' 26 | camera = Realsense('./Grasping_Franka/config/camera_rs_d435.yaml') 27 | 28 | frame = camera.get_frame() 29 | color = frame.color_image[0] 30 | depth_img = frame.depth_image[0] 31 | ''' 32 | 33 | camera = Realsense(frame_width=1280, frame_height=720, fps=30) 34 | depth, color = camera.get_frame_cv() 35 | 36 | cv2.imshow("img", color) 37 | cv2.waitKey(1000) 38 | 39 | crop = color[178:542, 433:891] 40 | cv2.imshow("crop", crop) 41 | cv2.waitKey(10000) 42 | 43 | cv2.destroyAllWindows() 44 | -------------------------------------------------------------------------------- /Driver/CH340.py: -------------------------------------------------------------------------------- 1 | # MIT License. 2 | # Copyright (c) 2021 by BioicDL. All rights reserved. 3 | # Created by LiuXb on 2021/2/27 4 | # -*- coding:utf-8 -*- 5 | 6 | """ 7 | @Modified: 8 | @Description: check the device port "ls /dev/ttyUSB*", for example the device is ttyUSB0. 9 | "sudo chmod 777 /dev/ttyUSB0" to set permissions of ttyUSB0. 10 | 11 | """ 12 | 13 | """ 14 | 安装serial串口通迅模块: 15 | pip install pyserial 16 | 查询CH340单片机模块是否驱动 17 | 1.首先确认系统支持USBSerial,输入以下命令: 18 | lsmod | grep usbserial 19 | 2.接上USB串口线,看看系统是否可以识别。输入以下命令: 20 | dmesg | grep ttyUSB 21 | 或者直接可以到/ dev下看看有没有ttyUSB0或ttyUSB1 22 | 单片机模板:CH340 23 | """ 24 | 25 | import serial 26 | 27 | 28 | class ComSwitch(object): 29 | def __init__(self, com="/dev/ttyUSB0"): 30 | self.__open_cmd = [0xA0, 0x01, 0x01, 0xA2] 31 | self.__close_cmd = [0xA0, 0x01, 0x00, 0xA1] 32 | self.sc = serial.Serial(port=com, baudrate=9600) 33 | 34 | def open(self): 35 | self.sc.write(self.__open_cmd) 36 | 37 | def close(self): 38 | self.sc.write(self.__close_cmd) 39 | 40 | 41 | if __name__ == "__main__": 42 | print('CH430 serial test!') 43 | import time 44 | 45 | cs = ComSwitch() 46 | 47 | for i in range(5): 48 | cs.open() 49 | print('Gripper is opened') 50 | time.sleep(3) 51 | 52 | cs.close() 53 | print('Gripper is closed') 54 | time.sleep(3) 55 | -------------------------------------------------------------------------------- /Data_process/Plot.py: -------------------------------------------------------------------------------- 1 | import matplotlib.pyplot as plt 2 | #%matplotlib inline 3 | 4 | obj1 = [0.8, 0.92, 0.84, 0.86, 0.88, 0.64] 5 | obj2 = [0.88, 0.75, 0.92, 0.96, 1, 1] 6 | obj3 = [0.36, 0.61, 0.74, 0.74, 0.92, 0.72] 7 | x=['Bare', 'No7_val', 'No1', 'No2', 'No3', 'No5'] 8 | 9 | plt.plot(x, obj1, 'o-', mfc="none", mec="orange", c='orange', ms=10) 10 | #plt.xlabel() 11 | for a, b in zip(x, obj1): 12 | plt.text(a, b+0.05, (b), ha='center', va='bottom', fontsize=10, c='orange') 13 | plt.ylabel("Success Rate") 14 | plt.ylim(0,1.1) 15 | #plt.title("Graph of the Root-mean-square Error") 16 | plt.show() 17 | 18 | 19 | plt.plot(x, obj2, 'o-', mfc="none", mec="purple", c='purple', ms=10) 20 | #plt.xlabel() 21 | for a, b in zip(x, obj2): 22 | plt.text(a, b+0.05, (b), ha='center', va='bottom', fontsize=10, c='purple') 23 | plt.ylabel("Success Rate") 24 | plt.ylim(0,1.1) 25 | #plt.title("Graph of the Root-mean-square Error") 26 | plt.show() 27 | 28 | 29 | plt.plot(x, obj3, 'o-', mfc="none", mec="g", c='g', ms=10) 30 | #plt.xlabel() 31 | for a, b in zip(x, obj3): 32 | plt.text(a, b+0.05, (b), ha='center', va='bottom', fontsize=10, c='g') 33 | plt.ylabel("Success Rate") 34 | plt.ylim(0,1.1) 35 | #plt.title("Graph of the Root-mean-square Error") 36 | plt.show() 37 | 38 | ''' 39 | plt.legend() 40 | #plt.xlabel() 41 | plt.ylabel("Success Rate") 42 | plt.ylim(0,) 43 | #plt.title("Graph of the Root-mean-square Error") 44 | plt.show() 45 | ''' 46 | 47 | -------------------------------------------------------------------------------- /config/2D_grasping.yaml: -------------------------------------------------------------------------------- 1 | initial_position: 2 | - 0.2 3 | - 0.0 4 | - 0.7 5 | - 3.14 6 | - 0 7 | - 1.57 # -0.785 8 | 9 | initial_joint: 10 | - 0.016889297269194355 11 | - -0.9558921143950705 12 | - -0.006456802549563263 13 | - -2.1330765712441857 14 | - -0.00542805631322928 15 | - 1.1762153487693685 16 | - -1.558628718536133 17 | 18 | check_position: 19 | - 0.35 20 | - 0.5 21 | - 0.4 22 | - 3.14 23 | - 0 24 | - 0.785 25 | 26 | check_joint: 27 | - -1.494359990636408 28 | - -0.2851035552468367 29 | - 2.394858798563542 30 | - -1.8701083893458574 31 | - 0.21556217130056773 32 | - 2.0676722230762334 33 | - 0.030457724331140697 34 | 35 | drop_position: 36 | - 0.4 37 | - 0.0 38 | - 0.28 39 | - 3.14 40 | - 0 41 | - 1.57 42 | 43 | initial_angle: 1.57 # angle for the gripper 44 | effector_offset: 0.2 # distance from flann center to the grasping center (in meter) 45 | effector_offset_2: 0.213 46 | grasp_prepare_offset: 0.15 # grasping prepare height 47 | 48 | width: 1280 # desired width of camera stream 49 | height: 720 # desired height of camera stream 50 | fps: 30 # desired frame rate from camera 51 | 52 | attmp_num: 40 53 | 54 | check_threshold: 25 # threshold of the white area in the frame, to judge whether an object is left in the frame 55 | 56 | matrix_path: /home/doyle/Me336/ME336-2021Spring/Grasping_Franka/output/cali_data/2021-04-06-16:09:11.591801.csv 57 | 58 | grasping_area: 59 | - 178 60 | - 542 61 | - 433 62 | - 891 63 | -------------------------------------------------------------------------------- /Utils/get_obj_by_color.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | 4 | _root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 5 | sys.path.append(_root_path) 6 | os.chdir(_root_path) 7 | print('work_dir: ', _root_path) 8 | 9 | # from deepclaw.driver.sensors.camera.Realsense_L515 import Realsense 10 | from Grasping_Franka.Driver.realsense_wapper import Realsense 11 | import cv2 12 | 13 | 14 | def get_obj_bbox(img, y1, y2, x1, x2): 15 | crop = img[y1:y2, x1:x2] 16 | 17 | gray = cv2.cvtColor(crop, cv2.COLOR_BGR2GRAY) 18 | blur = cv2.blur(gray, (4, 4)) 19 | _, binary = cv2.threshold(blur, 130, 256, cv2.THRESH_BINARY) 20 | 21 | x, y, w, h = cv2.boundingRect(binary) 22 | 23 | x += x1 24 | y += y1 25 | 26 | # cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2) 27 | 28 | # cv2.imshow('original', img) 29 | # cv2.imshow('crop', crop) 30 | # cv2.imshow('Gray image', gray) 31 | # cv2.imshow('Blur', blur) 32 | # cv2.imshow('binary', binary) 33 | # cv2.imshow('bbox', img) 34 | 35 | # cv2.waitKey(10) 36 | 37 | return x, y, w, h 38 | 39 | 40 | def check_gripper_bbox(img, y1, y2, x1, x2): 41 | 42 | crop = img[y1:y2, x1:x2] 43 | 44 | gray = cv2.cvtColor(crop, cv2.COLOR_BGR2GRAY) 45 | blur = cv2.blur(gray, (4, 4)) 46 | _, binary = cv2.threshold(blur, 130, 256, cv2.THRESH_BINARY) 47 | 48 | x, y, w, h = cv2.boundingRect(binary) 49 | 50 | x += x1 51 | y += y1 52 | 53 | # cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2) 54 | 55 | # cv2.imshow('original', img) 56 | # cv2.imshow('crop', crop) 57 | # cv2.imshow('Gray image', gray) 58 | # cv2.imshow('Blur', blur) 59 | # cv2.imshow('binary', binary) 60 | # cv2.imshow('bbox', img) 61 | 62 | # cv2.waitKey(10) 63 | 64 | return x, y, w, h 65 | 66 | 67 | if __name__ == '__main__': 68 | 69 | """ Initialization """ 70 | # camera and robot driver 71 | print('work_dir: ', _root_path) 72 | cam = Realsense(frame_width=1280, frame_height=720, fps=30, exposure=800, white_balance=3500, contrast=80, sharpness=80) 73 | 74 | _, img = cam.get_frame_cv() 75 | 76 | y1 = 269 77 | y2 = 542 78 | x1 = 475 79 | x2 = 799 80 | 81 | crop = img[y1:y2, x1:x2] 82 | 83 | gray = cv2.cvtColor(crop, cv2.COLOR_BGR2GRAY) 84 | blur = cv2.blur(gray, (4, 4)) 85 | _, binary = cv2.threshold(blur, 130, 256, cv2.THRESH_BINARY) 86 | 87 | x, y, w, h = cv2.boundingRect(binary) 88 | 89 | x += x1 90 | y += y1 91 | 92 | cv2.rectangle(img, (x, y), (x + w, y + h), (0, 255, 0), 2) 93 | print("bbox: {}, {}, {}, {}".format(x, y, w, h)) 94 | 95 | cv2.imshow('original', img) 96 | cv2.imshow('crop', crop) 97 | # cv2.imshow('Gray image', gray) 98 | # cv2.imshow('Blur', blur) 99 | cv2.imshow('binary', binary) 100 | cv2.imshow('bbox', img) 101 | 102 | cv2.waitKey(0) 103 | cv2.destroyAllWindows() 104 | -------------------------------------------------------------------------------- /Utils/ar_marker.py: -------------------------------------------------------------------------------- 1 | import cv2 as cv 2 | import numpy as np 3 | 4 | 5 | def detect_ar_marker(color_frame, intr_matrix, dist_coeff): 6 | # Load the dictionary that was used to generate the markers. 7 | dictionary = cv.aruco.Dictionary_get(cv.aruco.DICT_7X7_1000) 8 | 9 | # Initialize the detector parameters using default values 10 | parameters = cv.aruco.DetectorParameters_create() 11 | 12 | # Detect the markers in the image 13 | marker_corners, marker_ids, rejected_candidates = cv.aruco.detectMarkers(color_frame, dictionary, 14 | parameters=parameters, 15 | cameraMatrix=intr_matrix, 16 | distCoeff=dist_coeff) 17 | 18 | # target_corners = [] 19 | # target_ids = [] 20 | 21 | # Get desired marker with id 22 | # if marker_ids != None: 23 | # for i, marker_id in enumerate(marker_ids): 24 | # if marker_id == target_id: 25 | # target_ids.append(marker_id) 26 | # target_corners.append(target_corners[i]) 27 | 28 | return marker_corners, marker_ids 29 | 30 | 31 | def get_mat_cam_T_marker(color_frame, maker_size, intr_matrix, dist_coeff, repeat_num): 32 | corners, ids = detect_ar_marker(color_frame, intr_matrix, dist_coeff) 33 | 34 | if len(corners) > 0: 35 | R_list = [] 36 | t_list = [] 37 | 38 | for i in range(repeat_num): 39 | R_tmp, t_tmp, _ = cv.aruco.estimatePoseSingleMarkers(corners, maker_size, intr_matrix, dist_coeff) 40 | 41 | R_list.append(R_tmp) 42 | t_list.append(t_tmp) 43 | 44 | R = np.mean(R_list, 0) 45 | t = np.mean(t_list, 0) 46 | 47 | visualize_img = cv.aruco.drawAxis(color_frame, intr_matrix, dist_coeff, R, t, 0.03) 48 | 49 | # convert from 3x1 rotation vector to 3x3 rotation matrix 50 | R, _ = cv.Rodrigues(R) 51 | # Squeeze t for stacking 52 | t = np.squeeze(t, 1).squeeze() 53 | 54 | # padding = np.array([0, 0, 0, 1]) 55 | 56 | # Stack arrays to get transformation matrix H 57 | # H = np.vstack((np.hstack((R, t)), padding)) 58 | # print("Found marker, H = ", "\n", H) 59 | 60 | return R, t, visualize_img 61 | 62 | # print("No marker found in this frame !") 63 | return [], [], color_frame 64 | 65 | 66 | if __name__ == '__main__': 67 | 68 | from Grasping_Franka.Driver.realsense_wapper import Realsense 69 | 70 | cam = Realsense(frame_width=1280, frame_height=720, fps=30) 71 | 72 | while (True): 73 | _, color_frame = cam.get_frame_cv() 74 | 75 | corners, ids = detect_ar_marker(color_frame, cam.get_intrinsics_matrix(), cam.get_distortion_coeffs()) 76 | 77 | # print("Cornors:", corners) 78 | # print("IDs: ", ids) 79 | 80 | visualize_img = color_frame 81 | 82 | if (len(corners) > 0): 83 | R, t, _ = cv.aruco.estimatePoseSingleMarkers(corners, 0.05, cam.get_intrinsics_matrix(), 84 | cam.get_distortion_coeffs()) 85 | 86 | R_mat, _ = cv.Rodrigues(R) 87 | # R_mat = np.squeeze(R_mat, 0) 88 | t = np.squeeze(t, 1).transpose() 89 | 90 | print("R: ", type(R_mat), "Shape: ", R_mat.shape, "\n", R_mat) 91 | print("t: ", type(t), "Shape: ", t.shape, "\n", t) 92 | 93 | padding = np.array([0, 0, 0, 1]) 94 | tmp = np.hstack((R_mat, t)) 95 | 96 | H = np.vstack((tmp, padding)) 97 | 98 | print("H: ", type(H), "Shape: ", H.shape, "\n", H) 99 | 100 | visualize_img = cv.aruco.drawDetectedMarkers(color_frame, corners, ids) 101 | visualize_img = cv.aruco.drawAxis(visualize_img, cam.get_intrinsics_matrix(), cam.get_distortion_coeffs(), 102 | R, t, 0.03) 103 | 104 | cv.imshow("ar marker detection", visualize_img) 105 | cv.waitKey(1) 106 | -------------------------------------------------------------------------------- /Driver/realsense_wapper.py: -------------------------------------------------------------------------------- 1 | import pyrealsense2 as rs 2 | import numpy as np 3 | import cv2 4 | 5 | 6 | class Realsense(object): 7 | def __init__(self, frame_width=640, frame_height=480, fps=30, color_format="bgr8", exposure=None, white_balance=None, contrast=50, sharpness=50): 8 | # Configure depth and color streams 9 | self.pipeline = rs.pipeline() 10 | 11 | config = rs.config() 12 | config.enable_stream(rs.stream.depth, frame_width, frame_height, rs.format.z16, fps) 13 | 14 | if color_format == "bgr8": 15 | config.enable_stream(rs.stream.color, frame_width, frame_height, rs.format.bgr8, fps) 16 | elif color_format == "rgb8": 17 | config.enable_stream(rs.stream.color, frame_width, frame_height, rs.format.rgb8, fps) 18 | 19 | self.color_frame_width = frame_width 20 | self.color_frame_height = frame_height 21 | self.depth_frame_width = frame_width 22 | self.depth_frame_height = frame_height 23 | 24 | # Start streaming 25 | self.cfg = self.pipeline.start(config) 26 | 27 | # Align depth frame to color frame 28 | align_to = rs.stream.color 29 | self.align = rs.align(align_to) 30 | 31 | profile = self.cfg.get_stream(rs.stream.color) # Fetch stream profile for color stream 32 | intr = profile.as_video_stream_profile().get_intrinsics() # Downcast to video_stream_profile and fetch intrinsics 33 | # print(intr.coeffs) 34 | self.distortion_coeffs = intr.coeffs 35 | self.intrinsics = {'cx': intr.ppx, 'cy': intr.ppy, 'fx': intr.fx, 'fy': intr.fy} 36 | 37 | depth_sensor = self.cfg.get_device().first_depth_sensor() 38 | self.depth_scale = round(depth_sensor.get_depth_scale(), 4) 39 | 40 | print("------ Realsense start info ------ ") 41 | print("Frame size: " + str(frame_width) + "*" + str(frame_height)) 42 | print("FPS: " + str(fps)) 43 | print("Color frame format: ", color_format) 44 | print("Depth frame format: ", rs.format.z16) 45 | print("Depth scale: " + str(self.depth_scale)) 46 | print("Intrinsics: " + str(self.intrinsics)) 47 | 48 | # set camera parameters 49 | for i in range(len(self.cfg.get_device().sensors)): 50 | if self.cfg.get_device().sensors[i].is_color_sensor(): 51 | color_sensor = self.cfg.get_device().sensors[i] 52 | 53 | # exposure 54 | if exposure is not None: 55 | # manual exposure 56 | color_sensor.set_option(rs.option.enable_auto_exposure, False) 57 | color_sensor.set_option(rs.option.exposure, exposure) 58 | else: 59 | # auto exposure 60 | color_sensor.set_option(rs.option.enable_auto_exposure, True) 61 | color_sensor.set_option(rs.option.auto_exposure_priority, True) 62 | 63 | print("Exposure: ", color_sensor.get_option(rs.option.exposure) * 0.1, 'ms') 64 | 65 | # white balance 66 | if white_balance is not None: 67 | # manual white balance 68 | color_sensor.set_option(rs.option.enable_auto_white_balance, False) 69 | color_sensor.set_option(rs.option.white_balance, white_balance) 70 | else: 71 | # auto white balance 72 | color_sensor.set_option(rs.option.enable_auto_white_balance, True) 73 | 74 | print("White balance: ", color_sensor.get_option(rs.option.white_balance)) 75 | 76 | # contrast 77 | color_sensor.set_option(rs.option.contrast, contrast) 78 | print("Contrast: ", color_sensor.get_option(rs.option.contrast)) 79 | 80 | # sharpness 81 | color_sensor.set_option(rs.option.sharpness, sharpness) 82 | print("Sharpness: ", color_sensor.get_option(rs.option.sharpness)) 83 | 84 | print("---------------------------------- ") 85 | 86 | # Get a frame that can be processed in opencv 87 | def get_frame_cv(self): 88 | frames = self.pipeline.wait_for_frames() 89 | aligned_frames = self.align.process(frames) 90 | 91 | color_frame = aligned_frames.get_color_frame() 92 | depth_frame = aligned_frames.get_depth_frame() 93 | 94 | # Convert images to numpy arrays ( can be read with opencv ) 95 | depth_image = np.asanyarray(depth_frame.get_data()) 96 | color_image = np.asanyarray(color_frame.get_data()) 97 | 98 | return depth_image, color_image 99 | 100 | def get_intrinsics_matrix(self): 101 | return np.array( 102 | [self.intrinsics["fx"], 0, self.intrinsics["cx"], 0, self.intrinsics["fy"], self.intrinsics["cy"], 0, 0, 103 | 1]).reshape(3, 3) 104 | 105 | def get_distortion_coeffs(self): 106 | return np.array(self.distortion_coeffs) 107 | 108 | 109 | if __name__ == '__main__': 110 | cam = Realsense() 111 | intr = cam.get_intrinsics_matrix() 112 | print(intr) 113 | coeffs = cam.get_distortion_coeffs() 114 | print(coeffs) 115 | # depth, color = cam.get_frame_cv() 116 | # cv2.imwrite('test.jpg', color) 117 | -------------------------------------------------------------------------------- /grasping_colorseg_OLD.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | _root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 5 | sys.path.append(_root_path) 6 | os.chdir(_root_path) 7 | print('work_dir: ', _root_path) 8 | 9 | import time 10 | import csv 11 | from datetime import datetime 12 | import yaml 13 | 14 | import numpy as np 15 | import cv2 as cv 16 | 17 | # import gripper_control as gripper 18 | from Grasping_Franka.Driver.CH340 import ComSwitch 19 | 20 | # from deepclaw.driver.sensors.camera.Realsense_L515 import Realsense 21 | from Grasping_Franka.Driver.realsense_wapper import Realsense 22 | from deepclaw.driver.arms.franka.FrankaController import FrankaController 23 | from Grasping_Franka.Utils.get_obj_by_color import get_obj_bbox 24 | 25 | 26 | def read_cfg(path): 27 | with open(path, 'r') as stream: 28 | out = yaml.safe_load(stream) 29 | return out 30 | 31 | 32 | def load_cam_T_base_matrix(file_path): 33 | H = np.loadtxt(file_path, delimiter=',') 34 | 35 | cam_T_base_R = H[:3, :3] 36 | cam_T_base_t = H[:3, 3:].squeeze(1) 37 | 38 | return cam_T_base_R, cam_T_base_t 39 | 40 | 41 | def location_transformation(): 42 | time.sleep(0.5) 43 | 44 | ''' Load image ''' 45 | depth_img, color_img = cam.get_frame_cv() 46 | 47 | bbox = get_obj_bbox(color_img, y1, y2, x1, x2) 48 | 49 | cv.rectangle(color_img, (bbox[0], bbox[1]), (bbox[0] + bbox[2], bbox[1] + bbox[3]), (0, 255, 0), 2) 50 | 51 | obj_center_row = int(bbox[1] + bbox[3] / 2) 52 | obj_center_col = int(bbox[0] + bbox[2] / 2) 53 | # print("row: {}, col: {}".format(obj_center_row, obj_center_col)) 54 | 55 | cv.circle(color_img, (obj_center_col, obj_center_row), 2, (0, 255, 0), 2) 56 | 57 | ''' Visualization ''' 58 | cv.imshow('result', color_img) 59 | cv.waitKey(10) 60 | 61 | ''' Compute target coordinate in camera frame ''' 62 | target_in_cam_z = depth_img[obj_center_row, obj_center_col] * cam.depth_scale 63 | target_in_cam_x = np.multiply(obj_center_col - cam.intrinsics['cx'], target_in_cam_z / cam.intrinsics['fx']) 64 | target_in_cam_y = np.multiply(obj_center_row - cam.intrinsics['cy'], target_in_cam_z / cam.intrinsics['fy']) 65 | 66 | # print("Target in camera frame:\n", [target_in_cam_x, target_in_cam_y, target_in_cam_z]) 67 | 68 | target_in_cam = np.array([target_in_cam_x, target_in_cam_y, target_in_cam_z]) 69 | target_in_base = R.dot(target_in_cam) + t 70 | 71 | # print("Target in base frame:\n", target_in_base) 72 | 73 | return target_in_base 74 | 75 | 76 | def print_detection_info(res): 77 | print("Detection number: ", res.size()) 78 | print("----------------------------------") 79 | for r in res: 80 | print("classid: ", r.classid) 81 | 82 | 83 | if __name__ == '__main__': 84 | """ Initialization """ 85 | # camera and robot driver 86 | print('work_dir: ', _root_path) 87 | cam = Realsense(frame_width=1280, frame_height=720, fps=30) 88 | cfg = read_cfg('./Grasping_Franka/config/grasping _colorseg.yaml') 89 | arm = FrankaController('./Grasping_Franka/config/franka.yaml') 90 | cs = ComSwitch() # gripper 91 | 92 | ''' Loading config ''' 93 | initial_pose = cfg['initial_position'] # should be outside the grasping area 94 | # check_position = cfg['check_position'] 95 | drop_position = cfg['drop_position'] 96 | 97 | grasp_pre_offset = cfg['grasp_prepare_offset'] 98 | effector_offset = cfg['effector_offset'] # distance between the flange and the center of gripper, positive value 99 | 100 | check_threshold = cfg['check_threshold'] 101 | 102 | attmp_num = cfg['attmp_num'] # total grasp number 103 | 104 | cropping_area_temp = cfg['grasping_area'] 105 | 106 | y1 = cropping_area_temp[0] 107 | y2 = cropping_area_temp[1] 108 | x1 = cropping_area_temp[2] 109 | x2 = cropping_area_temp[3] 110 | 111 | ''' Load calibration matrix ''' 112 | R, t = load_cam_T_base_matrix(cfg['matrix_path']) 113 | print("Load R, t from file:\nR:\n", R, "\nt:\n", t) 114 | 115 | print("Moving to initial position...") 116 | arm.move_p(initial_pose) 117 | print("Moving to initial position... Done") 118 | 119 | stored_exception = None 120 | 121 | ''' Ready to store the data ''' 122 | csv_filename = "./Grasping_Franka/output/result/" + str(datetime.now()).replace(' ', '-') + ".csv" 123 | csv_header = ['num', 'if_success'] 124 | 125 | with open(csv_filename, 'w', encoding='utf-8', newline='') as f: 126 | writer = csv.writer(f) 127 | writer.writerow(csv_header) 128 | 129 | ''' Starting Grasping ''' 130 | # arm.move_p(check_position) # Test 131 | current_num = 0 # recording the grasping attempt 132 | while current_num < attmp_num: 133 | 134 | try: 135 | if stored_exception: 136 | break 137 | 138 | ''' Get the location of the object ''' 139 | target_in_base = location_transformation() 140 | 141 | ''' Exerting grasping ''' 142 | prepare_pos = [target_in_base[0], target_in_base[1], target_in_base[2] + grasp_pre_offset + effector_offset, 143 | 3.14, 0, 0] # pose: perpendicular to the plane 144 | arm.move_p(prepare_pos) 145 | 146 | cs.open() 147 | arm.move_p([target_in_base[0], target_in_base[1], target_in_base[2] + effector_offset, 3.14, 0, 0]) 148 | cs.close() 149 | time.sleep(0.5) 150 | 151 | ''' Move to check position ''' 152 | # arm.move_p(check_position) 153 | arm.move_p(initial_pose) 154 | 155 | ''' Perform success check ''' 156 | _, color_check = cam.get_frame_cv() 157 | bbox_check = get_obj_bbox(color_check, y1, y2, x1, x2) 158 | 159 | data = [] 160 | 161 | print("current area = %f" % (bbox_check[2] * bbox_check[3])) 162 | print("threshold area = %f" % check_threshold) 163 | 164 | if (bbox_check[2] * bbox_check[3] < check_threshold): 165 | print("Grasping SUCCESS in attempt {}".format(current_num)) 166 | data.append(str(current_num)) 167 | data.append(str(1)) # Success 168 | else: 169 | print("Grasping FAIL in attempt {}".format(current_num)) 170 | data.append(str(current_num)) 171 | data.append(str(0)) # Fail 172 | 173 | ''' 174 | with open(csv_filename, 'a+', encoding='utf-8', newline='') as f: 175 | writer = csv.writer(f) 176 | writer.writerow(data) 177 | ''' 178 | 179 | ''' Move to drop position and drop object ''' 180 | arm.move_p(drop_position) 181 | cs.open() 182 | 183 | ''' Back to initial position ''' 184 | arm.move_p(initial_pose) 185 | 186 | current_num += 1 187 | 188 | except KeyboardInterrupt: 189 | stored_exception = sys.exc_info() 190 | 191 | cv.destroyAllWindows() 192 | -------------------------------------------------------------------------------- /2D_grasping_soft.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | _root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 5 | sys.path.append(_root_path) 6 | os.chdir(_root_path) 7 | print('work_dir: ', _root_path) 8 | 9 | import time 10 | import csv 11 | from datetime import datetime 12 | import yaml 13 | 14 | import numpy as np 15 | import cv2 as cv 16 | 17 | # import gripper_control as gripper 18 | from Grasping_Franka.Driver.CH340 import ComSwitch 19 | 20 | # from deepclaw.driver.sensors.camera.Realsense_L515 import Realsense 21 | from Grasping_Franka.Driver.realsense_wapper import Realsense 22 | from deepclaw.driver.arms.franka.FrankaController import FrankaController 23 | from Grasping_Franka.Utils.get_obj_by_color import get_obj_bbox 24 | from deepclaw.modules.calibration.Calibration2D import Calibration2D 25 | 26 | 27 | def read_cfg(path): 28 | with open(path, 'r') as stream: 29 | out = yaml.safe_load(stream) 30 | return out 31 | 32 | 33 | def load_cam_T_base_matrix(file_path): 34 | H = np.loadtxt(file_path, delimiter=',') 35 | 36 | cam_T_base_R = H[:3, :3] 37 | cam_T_base_t = H[:3, 3:].squeeze(1) 38 | 39 | return cam_T_base_R, cam_T_base_t 40 | 41 | 42 | def location_transformation(crop_bounding, hand_eye): 43 | bbox = [0, 0, 0, 0] 44 | temp = [0.5, 0] 45 | time.sleep(0.5) 46 | 47 | ''' Load image ''' 48 | isObject = False 49 | while (isObject == False): 50 | depth_img, color_img = cam.get_frame_cv() 51 | 52 | bbox = get_obj_bbox(color_img, crop_bounding[0], crop_bounding[1], crop_bounding[2], crop_bounding[3]) 53 | 54 | cv.rectangle(color_img, (bbox[0], bbox[1]), (bbox[0] + bbox[2], bbox[1] + bbox[3]), (0, 255, 0), 2) 55 | 56 | obj_center_row = int(bbox[1] + bbox[3] / 2) 57 | obj_center_col = int(bbox[0] + bbox[2] / 2) 58 | # print("row: {}, col: {}".format(obj_center_row, obj_center_col)) 59 | if (bbox[2] * bbox[3] >= check_threshold): 60 | isObject = True 61 | cv.circle(color_img, (obj_center_col, obj_center_row), 2, (0, 255, 0), 2) 62 | 63 | ''' Visualization ''' 64 | cv.imshow('result', color_img) 65 | cv.waitKey(10) 66 | 67 | temp = hand_eye.cvt(obj_center_col, obj_center_row) 68 | break 69 | else: 70 | print("No object detected!") 71 | time.sleep(2) 72 | 73 | ''' Compute target coordinate in camera frame ''' 74 | if bbox[3] >= bbox[2]: 75 | angle = initial_angle 76 | else: 77 | angle = initial_angle - 1.57 78 | 79 | # grasp pose in euler angle 80 | target_in_base = [temp[0], temp[1], effector_offset, 3.14, 0, angle] 81 | 82 | return target_in_base 83 | 84 | 85 | if __name__ == '__main__': 86 | """ Initialization """ 87 | # camera and robot driver 88 | print('work_dir: ', _root_path) 89 | cam = Realsense(frame_width=1280, frame_height=720, fps=30) 90 | cfg = read_cfg('./Grasping_Franka/config/2D_grasping.yaml') 91 | arm = FrankaController('./Grasping_Franka/config/franka.yaml') 92 | cs = ComSwitch() # gripper 93 | 94 | ''' Loading config ''' 95 | initial_pose = cfg['initial_position'] # should be outside the grasping area 96 | initial_joint = cfg['initial_joint'] 97 | drop_position = cfg['drop_position'] 98 | check_position = cfg['check_position'] 99 | check_joint = cfg['check_joint'] 100 | 101 | grasp_pre_offset = cfg['grasp_prepare_offset'] 102 | effector_offset = cfg['effector_offset_2'] # distance between the flange and the center of gripper, positive value 103 | initial_angle = cfg['initial_angle'] 104 | 105 | check_threshold = cfg['check_threshold'] 106 | 107 | attmp_num = cfg['attmp_num'] # total grasp number 108 | 109 | crop_bounding = cfg['grasping_area'] 110 | cali_path = './configs/basic_config/cali2D.yaml' 111 | hand_eye = Calibration2D(cali_path) 112 | print("Calibration2D complete") 113 | 114 | print("Moving to initial position...") 115 | arm.move_j(initial_joint) 116 | print("Moving to initial position... Done") 117 | 118 | stored_exception = None 119 | 120 | ''' Ready to store the data ''' 121 | csv_filename = "./Grasping_Franka/output/result/" + str(datetime.now()).replace(' ', '-') + ".csv" 122 | csv_header = ['num', 'if_success'] 123 | 124 | with open(csv_filename, 'w', encoding='utf-8', newline='') as f: 125 | writer = csv.writer(f) 126 | writer.writerow(csv_header) 127 | 128 | ''' Starting Grasping ''' 129 | # arm.move_p(check_position) # Test 130 | current_num = 0 # recording the grasping attempt 131 | while current_num < attmp_num: 132 | 133 | try: 134 | if stored_exception: 135 | break 136 | 137 | ''' Get the location of the object ''' 138 | target_in_base = location_transformation(crop_bounding=crop_bounding, hand_eye=hand_eye) 139 | 140 | ''' Exerting grasping ''' 141 | prepare_pos = target_in_base.copy() # pose: perpendicular to the plane 142 | prepare_pos[2] = prepare_pos[2] + grasp_pre_offset 143 | arm.move_p(prepare_pos) 144 | 145 | cs.open() 146 | # arm.gripperOpen() 147 | arm.move_p(target_in_base) 148 | cs.close() 149 | # arm.gripperGrasp() 150 | time.sleep(0.5) 151 | 152 | ''' Move to check position ''' 153 | lift_up = target_in_base.copy() 154 | lift_up[2] = check_position[2] 155 | arm.move_p(lift_up) 156 | 157 | #arm.move_j(check_joint) 158 | arm.move_p(check_position) 159 | 160 | ''' Perform success check ''' 161 | _, color_check = cam.get_frame_cv() 162 | bbox_check = get_obj_bbox(color_check, crop_bounding[0], crop_bounding[1], crop_bounding[2], 163 | crop_bounding[3]) 164 | 165 | data = [] 166 | 167 | cv.imshow('result', color_check) 168 | cv.waitKey(10) 169 | 170 | print("current area = %f" % (bbox_check[2] * bbox_check[3])) 171 | print("threshold area = %f" % check_threshold) 172 | 173 | if (bbox_check[2] * bbox_check[3] < check_threshold): 174 | print("Grasping SUCCESS in attempt {}".format(current_num)) 175 | data.append(str(current_num)) 176 | data.append(str(1)) # Success 177 | else: 178 | print("Grasping FAIL in attempt {}".format(current_num)) 179 | data.append(str(current_num)) 180 | data.append(str(0)) # Fail 181 | 182 | with open(csv_filename, 'a+', encoding='utf-8', newline='') as f: 183 | writer = csv.writer(f) 184 | writer.writerow(data) 185 | 186 | ''' Move to drop position and drop object ''' 187 | drop_up = drop_position.copy() 188 | drop_up[2] = check_position[2] 189 | arm.move_p(drop_up) 190 | arm.move_p(drop_position) 191 | cs.open() 192 | # arm.gripperOpen() 193 | 194 | ''' Back to initial position ''' 195 | depart_pos = drop_position.copy() 196 | depart_pos[2] = depart_pos[2] + grasp_pre_offset 197 | arm.move_p(depart_pos) 198 | #arm.move_p(initial_pose) 199 | arm.move_j(initial_joint) 200 | 201 | current_num += 1 202 | 203 | except KeyboardInterrupt: 204 | stored_exception = sys.exc_info() 205 | 206 | cv.destroyAllWindows() 207 | -------------------------------------------------------------------------------- /2D_grasping_rigid.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | _root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 5 | sys.path.append(_root_path) 6 | os.chdir(_root_path) 7 | print('work_dir: ', _root_path) 8 | 9 | import time 10 | import csv 11 | from datetime import datetime 12 | import yaml 13 | 14 | import numpy as np 15 | import cv2 as cv 16 | 17 | # import gripper_control as gripper 18 | from Grasping_Franka.Driver.CH340 import ComSwitch 19 | 20 | # from deepclaw.driver.sensors.camera.Realsense_L515 import Realsense 21 | from Grasping_Franka.Driver.realsense_wapper import Realsense 22 | from deepclaw.driver.arms.franka.FrankaController import FrankaController 23 | from Grasping_Franka.Utils.get_obj_by_color import get_obj_bbox 24 | from deepclaw.modules.calibration.Calibration2D import Calibration2D 25 | 26 | 27 | def read_cfg(path): 28 | with open(path, 'r') as stream: 29 | out = yaml.safe_load(stream) 30 | return out 31 | 32 | 33 | def load_cam_T_base_matrix(file_path): 34 | H = np.loadtxt(file_path, delimiter=',') 35 | 36 | cam_T_base_R = H[:3, :3] 37 | cam_T_base_t = H[:3, 3:].squeeze(1) 38 | 39 | return cam_T_base_R, cam_T_base_t 40 | 41 | 42 | def location_transformation(crop_bounding, hand_eye): 43 | bbox = [0, 0, 0, 0] 44 | temp = [0.5, 0] 45 | time.sleep(0.5) 46 | 47 | ''' Load image ''' 48 | isObject = False 49 | while (isObject == False): 50 | depth_img, color_img = cam.get_frame_cv() 51 | 52 | bbox = get_obj_bbox(color_img, crop_bounding[0], crop_bounding[1], crop_bounding[2], crop_bounding[3]) 53 | 54 | cv.rectangle(color_img, (bbox[0], bbox[1]), (bbox[0] + bbox[2], bbox[1] + bbox[3]), (0, 255, 0), 2) 55 | 56 | obj_center_row = int(bbox[1] + bbox[3] / 2) 57 | obj_center_col = int(bbox[0] + bbox[2] / 2) 58 | # print("row: {}, col: {}".format(obj_center_row, obj_center_col)) 59 | if (bbox[2] * bbox[3] >= check_threshold): 60 | isObject = True 61 | cv.circle(color_img, (obj_center_col, obj_center_row), 2, (0, 255, 0), 2) 62 | 63 | ''' Visualization ''' 64 | cv.imshow('result', color_img) 65 | cv.waitKey(10) 66 | 67 | temp = hand_eye.cvt(obj_center_col, obj_center_row) 68 | break 69 | else: 70 | print("No object detected!") 71 | time.sleep(2) 72 | 73 | ''' Compute target coordinate in camera frame ''' 74 | if bbox[3] >= bbox[2]: 75 | angle = initial_angle 76 | else: 77 | angle = initial_angle - 1.57 78 | 79 | # grasp pose in euler angle 80 | target_in_base = [temp[0], temp[1], effector_offset, 3.14, 0, angle] 81 | 82 | return target_in_base 83 | 84 | 85 | if __name__ == '__main__': 86 | """ Initialization """ 87 | # camera and robot driver 88 | print('work_dir: ', _root_path) 89 | cam = Realsense(frame_width=1280, frame_height=720, fps=30) 90 | cfg = read_cfg('./Grasping_Franka/config/2D_grasping.yaml') 91 | arm = FrankaController('./Grasping_Franka/config/franka.yaml') 92 | # cs = ComSwitch() # gripper 93 | 94 | ''' Loading config ''' 95 | initial_pose = cfg['initial_position'] # should be outside the grasping area 96 | initial_pose[2] += -0.17 97 | initial_pose[5] += -1.57 98 | drop_position = cfg['drop_position'] 99 | drop_position[2] += -0.17 100 | drop_position[5] += -1.57 101 | check_position = cfg['check_position'] 102 | check_position[2] += -0.17 103 | check_position[5] += -1.57 104 | 105 | grasp_pre_offset = cfg['grasp_prepare_offset'] 106 | effector_offset = cfg['effector_offset'] # distance between the flange and the center of gripper, positive value 107 | effector_offset += -0.14 108 | initial_angle = cfg['initial_angle'] 109 | initial_angle += -1.57 110 | 111 | check_threshold = cfg['check_threshold'] 112 | 113 | attmp_num = cfg['attmp_num'] # total grasp number 114 | 115 | crop_bounding = cfg['grasping_area'] 116 | cali_path = './configs/basic_config/cali2D.yaml' 117 | hand_eye = Calibration2D(cali_path) 118 | print("Calibration2D complete") 119 | 120 | print("Moving to initial position...") 121 | arm.move_p(initial_pose, 0.8, 0.8) 122 | print("Moving to initial position... Done") 123 | 124 | stored_exception = None 125 | 126 | ''' Ready to store the data ''' 127 | csv_filename = "./Grasping_Franka/output/result/" + str(datetime.now()).replace(' ', '-') + ".csv" 128 | csv_header = ['num', 'if_success'] 129 | 130 | with open(csv_filename, 'w', encoding='utf-8', newline='') as f: 131 | writer = csv.writer(f) 132 | writer.writerow(csv_header) 133 | 134 | ''' Starting Grasping ''' 135 | # arm.move_p(check_position) # Test 136 | current_num = 0 # recording the grasping attempt 137 | while current_num < attmp_num: 138 | 139 | try: 140 | if stored_exception: 141 | break 142 | 143 | ''' Get the location of the object ''' 144 | target_in_base = location_transformation(crop_bounding=crop_bounding, hand_eye=hand_eye) 145 | 146 | ''' Exerting grasping ''' 147 | prepare_pos = target_in_base.copy() # pose: perpendicular to the plane 148 | prepare_pos[2] = prepare_pos[2] + grasp_pre_offset 149 | arm.move_p(prepare_pos) 150 | 151 | # cs.open() 152 | arm.gripperOpen() 153 | arm.move_p(target_in_base, velocity=0.1, accelerate=0.1) 154 | # cs.close() 155 | arm.gripperGrasp() 156 | time.sleep(0.5) 157 | 158 | ''' Move to check position ''' 159 | lift_up = target_in_base.copy() 160 | lift_up[2] = check_position[2] 161 | arm.move_p(lift_up) 162 | arm.move_p(check_position) 163 | 164 | ''' Perform success check ''' 165 | _, color_check = cam.get_frame_cv() 166 | bbox_check = get_obj_bbox(color_check, crop_bounding[0], crop_bounding[1], crop_bounding[2], 167 | crop_bounding[3]) 168 | 169 | data = [] 170 | 171 | cv.imshow('result', color_check) 172 | cv.waitKey(10) 173 | 174 | print("current area = %f" % (bbox_check[2] * bbox_check[3])) 175 | print("threshold area = %f" % check_threshold) 176 | 177 | if (bbox_check[2] * bbox_check[3] < check_threshold): 178 | print("Grasping SUCCESS in attempt {}".format(current_num)) 179 | data.append(str(current_num)) 180 | data.append(str(1)) # Success 181 | else: 182 | print("Grasping FAIL in attempt {}".format(current_num)) 183 | data.append(str(current_num)) 184 | data.append(str(0)) # Fail 185 | 186 | with open(csv_filename, 'a+', encoding='utf-8', newline='') as f: 187 | writer = csv.writer(f) 188 | writer.writerow(data) 189 | 190 | ''' Move to drop position and drop object ''' 191 | drop_up = drop_position.copy() 192 | drop_up[2] = check_position[2] 193 | arm.move_p(drop_up) 194 | arm.move_p(drop_position) 195 | # cs.open() 196 | arm.gripperOpen() 197 | 198 | ''' Back to initial position ''' 199 | depart_pos = drop_position.copy() 200 | depart_pos[2] = depart_pos[2] + grasp_pre_offset 201 | arm.move_p(depart_pos) 202 | arm.move_p(initial_pose) 203 | 204 | current_num += 1 205 | 206 | except KeyboardInterrupt: 207 | stored_exception = sys.exc_info() 208 | 209 | cv.destroyAllWindows() 210 | -------------------------------------------------------------------------------- /grasping_by_ME336.py: -------------------------------------------------------------------------------- 1 | # MIT License. 2 | # Copyright (c) 2021 by BionicDL. All rights reserved. 3 | # Created by LiuXb on 2021/1/31 4 | # -*- coding:utf-8 -*- 5 | 6 | """ 7 | @Modified: 8 | @Description: 9 | """ 10 | import sys 11 | import os 12 | 13 | # append the DeepClawDev directory to python path and set it as working directory 14 | 15 | _root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 16 | sys.path.append(_root_path) 17 | os.chdir(_root_path) 18 | print('work_dir: ', _root_path) 19 | 20 | import time 21 | import yaml 22 | import numpy as np 23 | import matplotlib.pyplot as plt 24 | import cv2 25 | from scipy.spatial.transform import Rotation as R 26 | 27 | from deepclaw.driver.arms.ArmController import ArmController 28 | from deepclaw.modules.end2end.yolov5.YOLO5 import Yolo5 29 | from deepclaw.driver.sensors.camera.Realsense_L515 import Realsense 30 | from deepclaw.driver.arms.franka.FrankaController import FrankaController 31 | from deepclaw.modules.grasp_planning.GeoGrasp import GeoGrasp 32 | 33 | 34 | def pick_place(robot_server: ArmController, gripper_server: object, home_joint, pick_xyzrt, pick_xyzrt_up, place_xyzrt): 35 | # go to pick above 36 | robot_server.gripperOpen() 37 | up_pos = pick_xyzrt.copy() 38 | #up_pos[2] = up_pos[2] + 0.1 39 | robot_server.move_p(up_pos, 0.5, 0.5) 40 | time.sleep(0.1) 41 | # go to pick 42 | pick_xyzrt[2] = pick_xyzrt[2] - 0.13 43 | robot_server.move_p(pick_xyzrt, 0.5, 0.5) 44 | time.sleep(0.1) 45 | # pick 46 | robot_server.gripperGrasp() 47 | time.sleep(1) 48 | # go up 49 | robot_server.move_p(up_pos, 0.5, 0.5) 50 | time.sleep(0.1) 51 | # go to release 52 | robot_server.move_p(place_xyzrt, 0.5, 0.5) 53 | # release 54 | robot_server.gripperOpen() 55 | time.sleep(0.8) 56 | # go back home 57 | robot_server.move_j(home_joint, 0.5, 0.5) 58 | 59 | 60 | def detectObject(detector_algo: Yolo5, color, crop_bounding=[300, 1000, 300, 1000]): 61 | region_class = detector_algo.detect(color) 62 | if region_class is None: 63 | return False, None, None, None 64 | 65 | # object on the tray 66 | uv_roi = [] 67 | cla_roi = [] 68 | cfi_roi = [] 69 | for i in range(len(region_class)): 70 | uv_temp = np.array(region_class[i][0:4], np.int16) 71 | cla_temp = int(region_class[i][5]) 72 | cfi_temp = region_class[i][4] 73 | # col_min, row_min, col_max, row_max 74 | uv_mid_c = (uv_temp[0] + uv_temp[2]) / 2.0 75 | uv_mid_r = (uv_temp[1] + uv_temp[3]) / 2.0 76 | if uv_mid_c < crop_bounding[2] - 20 or uv_mid_c > crop_bounding[3] + 10 or uv_mid_r < crop_bounding[ 77 | 0] - 20 or uv_mid_r > crop_bounding[1] + 10: 78 | continue 79 | else: 80 | uv_roi.append(uv_temp) 81 | cla_roi.append(cla_temp) 82 | cfi_roi.append(cfi_temp) 83 | 84 | if len(uv_roi) == 0: 85 | return False, None, None, None 86 | 87 | # pick one object once 88 | uv = uv_roi[0] 89 | cla = cla_roi[0] 90 | cfi = cfi_roi[0] 91 | return True, uv, cla, cfi 92 | 93 | 94 | if __name__ == '__main__': 95 | """ Initialization """ 96 | # camera and robot driver 97 | print('work_dir: ', _root_path) 98 | robot = FrankaController('./configs/basic_config/franka.yaml') 99 | camera = Realsense('./configs/basic_config/camera_rs_d435.yaml') 100 | object_detector = Yolo5('./configs/basic_config/yolov5_cfg.yaml') 101 | 102 | home_joints = [-0.03, -1.3, 0.05, -2.2, 0.08, 1.15, 0.7] 103 | 104 | robot.move_j(home_joints, 0.8, 0.8) 105 | 106 | """ start picking loop""" 107 | place_xyzrt = [0.3, -0.5, 0.4, 3.14, 0.0, -1.57] 108 | crop_bounding = [300, 720, 300, 1000] 109 | hand_eye_matrix = np.load('./configs/E_T_B_Grasping_Franka.npy') 110 | while 1: 111 | frame = camera.get_frame() 112 | color = frame.color_image[0] 113 | depth_img = frame.depth_image[0] 114 | # 识别物体 115 | # region_class = object_detector.detect(color) 116 | ret, uv, cla, cfi = detectObject(object_detector, color=color, crop_bounding=crop_bounding) # [100, 347, 171, 460] 117 | if not ret: 118 | continue 119 | if cla not in [0, 1, 2, 3]: 120 | print('\033[1;35m Error Category \033[0m!') 121 | continue 122 | """ generate grasping pose""" 123 | # transfer to point cloud 124 | # depth intrinsics 125 | width = 1280 126 | hight = 720 127 | fx = 640.983 128 | fy = 640.983 129 | cx = 641.114 130 | cy = 368.461 131 | pc = [] 132 | for i in range(uv[1], uv[3]): 133 | temp_pc = [] 134 | for j in range(uv[0], uv[2]): 135 | z = depth_img[i][j] 136 | x = (j - cx) * z / fx 137 | y = (i - cy) * z / fy 138 | if z == 0: 139 | temp_pc.append([np.nan, np.nan, np.nan]) 140 | else: 141 | temp_pc.append([x, y, z]) 142 | pc.append(temp_pc) 143 | pc = np.array(pc).reshape((-1, 3)) 144 | # Todo: filter plane 145 | plane_model = [-0.03110741, 0.06798567, 0.63743121, -0.76687139] 146 | new_pc = [] 147 | for i in range(len(pc)): 148 | if pc[i][0] * plane_model[0] + pc[i][1] * plane_model[1] + pc[i][2] * plane_model[2] + plane_model[3] < 0: 149 | new_pc.append(pc[i]) 150 | 151 | new_pc = np.array(new_pc) 152 | show_flag = False 153 | if show_flag: 154 | fig = plt.figure("pcs") 155 | ax = fig.add_subplot(111, projection="3d") 156 | ax.scatter(new_pc[:, 0], new_pc[:, 1], new_pc[:, 2], s=1, ) 157 | ax.set_xlabel("x") 158 | ax.set_ylabel("y") 159 | ax.set_zlabel("z") 160 | ax.set_xlim(-1, 1) 161 | ax.set_ylim(-1, 1) 162 | ax.set_zlim(0.5, 2) 163 | ax.view_init(elev=-90, azim=-90) 164 | plt.show() 165 | # GeoGrasp 166 | if len(new_pc) == 0: 167 | continue 168 | m = GeoGrasp.run(new_pc) 169 | m = np.array(m) 170 | # row 171 | grasp_matrix = np.reshape(m, (4, 4), order='C') 172 | print('==============original grasp matrix=====================') 173 | print(grasp_matrix) 174 | if np.all(grasp_matrix == 0): 175 | continue 176 | 177 | temp_matrix = grasp_matrix.copy() 178 | grasp_matrix[0:3, 0] = temp_matrix[0:3, 1] / np.linalg.norm(temp_matrix[0:3, 1]) # 1 179 | grasp_matrix[0:3, 1] = temp_matrix[0:3, 2] / np.linalg.norm(temp_matrix[0:3, 2]) # 2 180 | grasp_matrix[0:3, 2] = temp_matrix[0:3, 0] / np.linalg.norm(temp_matrix[0:3, 0]) # 0 181 | print('==============modified axis grasp matrix=====================') 182 | print(grasp_matrix) 183 | 184 | # load eye to base matrix 185 | hand_eye_matrix = np.array(hand_eye_matrix) 186 | print('=========== hand_eye_calib ==============') 187 | print(hand_eye_matrix) 188 | grasping_in_base = np.dot(hand_eye_matrix, grasp_matrix) 189 | print('=========== grasping_in_base ==============') 190 | print(grasping_in_base) 191 | 192 | rot_matrix = grasping_in_base[0:3, 0:3] 193 | if rot_matrix[2, 2] > 0: 194 | rot_matrix[0:3, 2] = -rot_matrix[0:3, 2] 195 | rot_matrix[0:3, 1] = -rot_matrix[0:3, 1] 196 | grasping_in_base[0:3, 0:3] = rot_matrix 197 | print('=========== rot_matrix ==============') 198 | print(rot_matrix) 199 | print('=========== modified -z grasping_in_base ==============') 200 | print(grasping_in_base) 201 | # gripper to flange matrix 202 | E_T_F = np.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, 0.133], [0, 0, 0, 1]]) 203 | # grasping_in_base = np.dot(grasping_in_base, E_T_F) 204 | grasping_in_base = np.dot(grasping_in_base, np.linalg.inv(E_T_F)) 205 | r = R.from_matrix(grasping_in_base[0: 3, 0: 3]) 206 | rot = r.as_euler('xyz', degrees=False) 207 | transfer = grasping_in_base[0:3, 3] 208 | measure_z = 0.12 # meter 209 | temp_pose = [transfer[0], transfer[1], transfer[2] + measure_z, rot[0], rot[1], rot[2]] 210 | 211 | # z offset , pick up 212 | E_T_F = np.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 1, -0.03], [0, 0, 0, 1]]) 213 | grasping_in_base = np.dot(grasping_in_base, E_T_F) 214 | r = R.from_matrix(grasping_in_base[0: 3, 0: 3]) 215 | rot = r.as_euler('xyz', degrees=False) 216 | transfer = grasping_in_base[0:3, 3] 217 | temp_pose_up = [transfer[0], transfer[1], transfer[2], rot[0], rot[1], rot[2]] 218 | 219 | print('grasp pose: ', temp_pose) 220 | print('grasp pose: ', np.array(temp_pose[3:6]) * 180 / 3.14159) 221 | 222 | # # transfer to rotation vector 223 | r = R.from_euler('xyz', temp_pose[3:6], degrees=False) 224 | rvc = r.as_rotvec() 225 | pick_pose = [temp_pose[0], temp_pose[1], temp_pose[2], rvc[0], rvc[1], rvc[2]] 226 | pick_pose_up = [temp_pose_up[0], temp_pose_up[1], temp_pose_up[2], rvc[0], rvc[1], rvc[2]] 227 | print(temp_pose) 228 | print(temp_pose_up) 229 | # 抓取 230 | pick_place(robot, robot, home_joints, temp_pose, temp_pose_up, place_xyzrt) 231 | -------------------------------------------------------------------------------- /Utils/calibration.py: -------------------------------------------------------------------------------- 1 | # Perform Eye-on-base calibration 2 | import sys 3 | import os 4 | 5 | _root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) 6 | sys.path.append(_root_path) 7 | os.chdir(_root_path) 8 | print('work_dir: ', _root_path) 9 | 10 | import yaml 11 | import cv2 12 | import numpy as np 13 | from numpy.linalg import inv 14 | 15 | from Grasping_Franka.Utils import ar_marker 16 | 17 | from datetime import datetime 18 | from Grasping_Franka.Driver.realsense_wapper import Realsense 19 | from deepclaw.driver.arms.franka.FrankaController import FrankaController 20 | 21 | 22 | def read_cali_cfg(path): 23 | with open(path, 'r') as stream: 24 | out = yaml.safe_load(stream) 25 | return out 26 | 27 | 28 | def load_cali_matrix(file_path): 29 | data = np.load(file_path) 30 | 31 | cam_T_marker_mats_R = data['arr_0'] 32 | cam_T_marker_mats_t = data['arr_1'] 33 | 34 | EE_T_base_mats_R = data['arr_2'] 35 | EE_T_base_mats_t = data['arr_3'] 36 | 37 | cam_T_base_R, cam_T_base_t = cv2.calibrateHandEye(EE_T_base_mats_R, EE_T_base_mats_t, cam_T_marker_mats_R, 38 | cam_T_marker_mats_t) 39 | return cam_T_base_R, cam_T_base_t 40 | 41 | 42 | def random_sample(lower_limit, upper_limit, shape): 43 | size = upper_limit - lower_limit 44 | return size * np.random.random_sample(shape) + lower_limit 45 | 46 | 47 | def get_H_from_R_t(R, t): 48 | padding = np.array([0, 0, 0, 1]) 49 | 50 | # Stack arrays to get transformation matrix H 51 | H = np.vstack((np.hstack((R, t)), padding)) 52 | 53 | return H 54 | 55 | 56 | def check_trans_matrix_from_file(file_path): 57 | import matplotlib.pyplot as plt 58 | import pytransform3d.transformations as ptrans 59 | from pytransform3d.transform_manager import TransformManager 60 | from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import 61 | 62 | data = np.load(file_path) 63 | 64 | cam_T_marker_mats_R = data['arr_0'] 65 | cam_T_marker_mats_t = data['arr_1'] 66 | 67 | EE_T_base_mats_R = data['arr_2'] 68 | EE_T_base_mats_t = data['arr_3'] 69 | 70 | cam_T_base_R, cam_T_base_t = cv2.calibrateHandEye(EE_T_base_mats_R, EE_T_base_mats_t, cam_T_marker_mats_R, 71 | cam_T_marker_mats_t) 72 | 73 | # chane (3,1) shape to (3, ) 74 | cam_T_base_t = cam_T_base_t.squeeze(1) 75 | 76 | print("cam_T_base_R:\n", cam_T_base_R.shape, "\n", cam_T_base_R) 77 | print("cam_T_base_t:\n", cam_T_base_t.shape, "\n", cam_T_base_t) 78 | 79 | base_T_cam_R = cam_T_base_R.transpose() 80 | base_T_cam_t = -cam_T_base_R.transpose().dot(cam_T_base_t) 81 | 82 | x_errs = [] 83 | y_errs = [] 84 | z_errs = [] 85 | abs_errs = [] 86 | 87 | trans_pts = [] 88 | base_T_EE_mats_t = [] 89 | 90 | for i, EE_T_base_t in enumerate(EE_T_base_mats_t): 91 | base_T_EE_t = -EE_T_base_mats_R[i].transpose().dot(EE_T_base_t) 92 | base_T_EE_mats_t.append(base_T_EE_t) # For visualization 93 | 94 | print("Point in base: ", i, " ", base_T_EE_t.transpose().shape, " ", base_T_EE_t) 95 | print("Point in camera: ", i, " ", cam_T_marker_mats_t[i].shape, " ", cam_T_marker_mats_t[i]) 96 | trans_pt = np.add(cam_T_base_R.dot(cam_T_marker_mats_t[i]), cam_T_base_t) 97 | trans_pts.append(trans_pt) 98 | print("Transed point: ", trans_pt.shape, trans_pt) 99 | 100 | x_errs.append(abs(trans_pt[0] - base_T_EE_t[0])) 101 | y_errs.append(abs(trans_pt[1] - base_T_EE_t[1])) 102 | z_errs.append(abs(trans_pt[2] - base_T_EE_t[2])) 103 | abs_errs.append(np.sqrt(np.square(trans_pt[0] - base_T_EE_t[0]) + np.square(trans_pt[1] - base_T_EE_t[1]) 104 | + np.square(trans_pt[2] - base_T_EE_t[2]))) 105 | 106 | print("X-axis error: ", "max: ", max(x_errs), "min: ", min(x_errs), "mean: ", sum(x_errs) / len(x_errs)) 107 | print("Y-axis error: ", "max: ", max(y_errs), "min: ", min(y_errs), "mean: ", sum(y_errs) / len(y_errs)) 108 | print("Z-axis error: ", "max: ", max(z_errs), "min: ", min(z_errs), "mean: ", sum(z_errs) / len(z_errs)) 109 | print("Abs error: ", "max: ", max(abs_errs), "min: ", min(abs_errs), "mean: ", sum(abs_errs) / len(abs_errs)) 110 | 111 | abs_errs = np.sort(abs_errs) 112 | plt.figure(1) 113 | plt.plot(range(len(abs_errs)), abs_errs) 114 | 115 | fig_3d = plt.figure(2) 116 | ax = fig_3d.add_subplot(111, projection='3d') 117 | 118 | for pt in cam_T_marker_mats_t: 119 | ax.scatter(pt[0], pt[1], pt[2], marker='^') 120 | 121 | for pt in trans_pts: 122 | ax.scatter(pt[0], pt[1], pt[2], marker='.') 123 | 124 | plt.figure(3) 125 | base_T_cam = ptrans.transform_from(base_T_cam_R, base_T_cam_t, True) 126 | tm = TransformManager() 127 | tm.add_transform("base", "cam", base_T_cam) 128 | axis = tm.plot_frames_in("base", s=0.3) 129 | 130 | plt.show() 131 | 132 | 133 | if __name__ == '__main__': 134 | 135 | print('work_dir: ', _root_path) 136 | 137 | arm = FrankaController('./Grasping_Franka/config/franka.yaml') 138 | cam = Realsense(frame_width=1280, frame_height=720, fps=30) 139 | cfg = read_cali_cfg("./Grasping_Franka/config/calibration.yaml") 140 | 141 | initial_pose = cfg['initial_position'] 142 | 143 | cube_size = cfg['sample_cube_size'] 144 | 145 | maker_size = cfg['marker_size'] 146 | sample_repeat_num = cfg['marker_repeat_sample'] 147 | 148 | x_step = cfg['x_stride'] 149 | y_step = cfg['y_stride'] 150 | z_step = cfg['z_stride'] 151 | 152 | rotation_upper_limit = cfg['rotation_upper_limit'] 153 | rotation_lower_limit = cfg['rotation_lower_limit'] 154 | 155 | x_offset = cfg['board_offset_x'] 156 | y_offset = cfg['board_offset_y'] 157 | z_offset = cfg['board_offset_z'] 158 | 159 | arm.move_p(initial_pose) 160 | x = initial_pose[0] 161 | y = initial_pose[1] 162 | z = initial_pose[2] 163 | roll = initial_pose[3] # Rotation around x-axis 164 | pitch = initial_pose[4] # Rotation around y-axis 165 | yaw = initial_pose[5] # Rotation around z-axis 166 | 167 | # cam_pts = [] 168 | # arm_base_pts = [] 169 | 170 | cam_T_marker_mats_R = [] 171 | cam_T_marker_mats_t = [] 172 | 173 | EE_T_base_mats_R = [] 174 | EE_T_base_mats_t = [] 175 | 176 | print("Waiting for camera steady auto exposure...") 177 | for i in range(20): 178 | cam.get_frame_cv() 179 | print("Waiting for camera steady auto exposure... Done") 180 | 181 | cv2.namedWindow('visualize_img', cv2.WINDOW_AUTOSIZE) 182 | 183 | counter = 0 184 | 185 | for i in range(cube_size): 186 | for j in range(cube_size): 187 | for k in range(cube_size): 188 | counter = counter + 1 189 | print("#" + str(counter) + " out of " + str(cube_size * cube_size * cube_size) + " sample points") 190 | 191 | arm_target_x = round(x + x_step * i, 5) 192 | arm_target_y = round(y + y_step * j, 5) 193 | arm_target_z = round(z + z_step * k, 5) 194 | 195 | rotation_sample = random_sample(rotation_lower_limit, rotation_upper_limit, 3) 196 | print("random sample: ", rotation_sample) 197 | 198 | arm_target_roll = round(roll + rotation_sample[0], 5) 199 | arm_target_pitch = round(pitch + rotation_sample[1], 5) 200 | arm_target_yaw = round(yaw + rotation_sample[2], 5) 201 | print("move target: ", 202 | [arm_target_x, arm_target_y, arm_target_z, arm_target_roll, arm_target_pitch, arm_target_yaw]) 203 | 204 | arm.move_p( 205 | [arm_target_x, arm_target_y, arm_target_z, arm_target_roll, arm_target_pitch, arm_target_yaw]) 206 | 207 | _, color_frame = cam.get_frame_cv() 208 | 209 | cam_T_marker_R, cam_T_marker_t, visualize_img = ar_marker.get_mat_cam_T_marker(color_frame, maker_size, 210 | cam.get_intrinsics_matrix(), 211 | cam.get_distortion_coeffs(), 212 | sample_repeat_num) 213 | base_T_EE_R, base_T_EE_t = arm.getMatrixO_T_EE() 214 | 215 | # print("End Effector in base frame:\n", "R:\n", base_T_EE_R, "t:\n", base_T_EE_t) 216 | # print("End Effector in base frame:\n", arm_base_pt) 217 | 218 | cv2.imshow("visualize_img", visualize_img) 219 | cv2.waitKey(5) 220 | 221 | if len(cam_T_marker_R) != 0: 222 | 223 | EE_T_base_R = inv(base_T_EE_R) 224 | EE_T_base_t = -inv(base_T_EE_R).dot(base_T_EE_t) 225 | 226 | cam_T_marker_mats_R.append(cam_T_marker_R) 227 | cam_T_marker_mats_t.append(cam_T_marker_t) 228 | 229 | EE_T_base_mats_R.append(EE_T_base_R) 230 | EE_T_base_mats_t.append(EE_T_base_t) 231 | 232 | print("Marker in camera frame\n", "R:\n", cam_T_marker_R.shape, cam_T_marker_R, "t:\n", 233 | cam_T_marker_t.shape, cam_T_marker_t) 234 | 235 | # print("EE in base frame\n", "R:\n", base_T_EE_R.shape, base_T_EE_R, "t:\n", base_T_EE_t.shape, base_T_EE_t) 236 | print("Base in EE frame\n", "R:\n", EE_T_base_R.shape, EE_T_base_R, "t:\n", EE_T_base_t.shape, 237 | EE_T_base_t) 238 | 239 | # cam_pts.append(cam_pt) 240 | # arm_base_pts.append(arm_base_pt) 241 | else: 242 | print("No marker detected in this frame!") 243 | 244 | cv2.destroyAllWindows() 245 | 246 | print("Performing calibration...") 247 | cam_T_base_R, cam_T_base_t = cv2.calibrateHandEye(EE_T_base_mats_R, EE_T_base_mats_t, cam_T_marker_mats_R, 248 | cam_T_marker_mats_t) 249 | print("Performing calibration... Done") 250 | 251 | print("From camera to base:\n", "R:\n", cam_T_base_R, "\nt:\n", cam_T_base_t) 252 | 253 | # Stack arrays to get transformation matrix H 254 | base_T_cam_H = get_H_from_R_t(cam_T_base_R, cam_T_base_t) 255 | print("H:\n", base_T_cam_H) 256 | # cam_T_marker_mats_filename = ROOT + cfg['save_dir'] + "cam_T_marker" + str(datetime.now()).replace(' ', '-') + ".csv" 257 | 258 | file_path = _root_path + '/Grasping_Franka/output' 259 | filename_csv = file_path + cfg['save_dir'] + str(datetime.now()).replace(' ', '-') + ".csv" 260 | filename_npz = file_path + cfg['save_dir'] + str(datetime.now()).replace(' ', '-') + ".npz" 261 | 262 | np.savez(filename_npz, cam_T_marker_mats_R, cam_T_marker_mats_t, EE_T_base_mats_R, EE_T_base_mats_t) 263 | np.savetxt(filename_csv, base_T_cam_H, delimiter=',') 264 | 265 | print("------ Test load ------") 266 | load_R, load_t = load_cali_matrix(filename_npz) 267 | print("Loaded R:\n", load_R) 268 | print("Loaded t:\n", load_t) 269 | print("-------- End ----------") 270 | 271 | check_trans_matrix_from_file(filename_npz) 272 | --------------------------------------------------------------------------------