File size: 3,905 Bytes
6c68d01
 
aed9d46
6c68d01
aed9d46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6c68d01
aed9d46
 
 
 
 
 
 
6c68d01
aed9d46
 
 
 
 
 
 
6c68d01
aed9d46
 
6c68d01
 
 
aed9d46
6c68d01
aed9d46
6c68d01
aed9d46
 
 
 
 
 
6c68d01
 
 
0eb92e9
 
 
 
 
 
 
 
6c68d01
0eb92e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Layout of the scan cell, in the robot base frame (mm, °).
// Sources: MecheyePackage/points.py (tray slots) and MecheyePackage/config.json (scan pose).

// Slots [x, y, rz]; pick height is 138 mm for all slots, tool faces down (rx 180, ry 0)
export const PICK_Z = 138;
export const APPROACH_Z = 224;

const LEFT = [
  [-538, -391.1, 90], [-477.8, -382.1, -90], [-416, -391.775, 90], [-361, -385, -90],
  [-295, -395.775, 90], [-242.023, -389.162, -90], [-178.397, -399.168, 90], [-120, -391.157, -90],
  [-60.026, -401.787, 90], [-2, -393.001, -90], [60.979, -403.79, 90], [117, -395.775, -90],
  [182, -406.019, 90], [238.98, -398.296, -90], [302, -410.126, 90], [358.981, -400, -90],
  [422, -412.034, 90], [479, -402.048, -90], [540.981, -412, 90], [599.984, -404, -90],
];
const LEFT_SMALL = [
  [-361, -735.775, 90], [-306.5, -735.775, -90], [-246, -740, 90], [-187, -735.775, -90],
  [-127, -744, 90], [-66, -738.62, -90], [-5, -746.833, 90], [53, -740.831, -90],
  [114.094, -747.833, 90], [173, -744.829, -90], [233.011, -750, 90], [291.003, -748.828, -90],
];
const RIGHT = [
  [-533.13, 399, 90], [-466.269, 399, -90], [-403.838, 399, 90], [-344.471, 406.83, -90],
  [-283.27, 395.494, 90], [-225.166, 407.34, -90], [-161.926, 393.811, 90], [-105.989, 404.829, -90],
  [-42.995, 391.82, 90], [16.005, 403.012, -90], [78.007, 390.986, 90], [136.009, 401, -90],
  [199.005, 389.826, 90], [256.012, 397, -90], [317.003, 384.987, 90], [375.006, 392.998, -90],
  [437.12, 382.974, 90], [496.009, 392.991, -90], [557.007, 380.997, 90], [615.006, 390.26, -90],
];
const RIGHT_SMALL = [
  [-340, 746.032, 90], [-277, 751.98, -90], [-220, 744.168, 90], [-159.372, 750.327, -90],
  [-97.395, 742.409, 90], [-41.372, 748.472, -90], [24.616, 740, 90], [78.609, 745.213, -90],
  [143.61, 737, 90], [199.626, 740, -90], [264.007, 737.808, 90], [322.615, 740, -90],
];

const row = (points, small) => points.map(([x, y, rz]) => ({ x, y, rz, small }));

// Same order as scan.py: 64 slots, cell numbers in the scan grid
export const SLOTS = [
  ...row(LEFT, false),
  ...row(LEFT_SMALL, true),
  ...row(RIGHT, false),
  ...row(RIGHT_SMALL, true),
];

// Trays [center x, center y, width, depth]
export const TRAY_PLATES = [
  [30, -392.5, 1220, 105],
  [-35, -742.5, 730, 95],
  [40, 397.5, 1230, 105],
  [-10, 745, 740, 100],
];

// config.json robot_positions.scrc: part above the laser profiler, tool axis horizontal (-Y)
export const SCAN_POSE = [-450, -130, 470, 82.8, 89.93, -7.3];

// The following were not measured on-site; they are a visual assumption
export const GRIPPER_LENGTH = 110; // from flange to vacuum tip
export const PART_SIZE = [80, 50, 24]; // along tool X, Y, Z axes

// LNX-8080 reference distance is 250 mm: the laser window is this far below the part's bottom face in the scan pose
const LASER_REFERENCE_DISTANCE = 250;
const LASER_SHIFT_Y = 150; // Y offset relative to the part center in the scan pose
export const LASER_POSITION = [
  SCAN_POSE[0],
  SCAN_POSE[1] - GRIPPER_LENGTH - PART_SIZE[2] / 2 + LASER_SHIFT_Y,
  SCAN_POSE[2] - PART_SIZE[0] / 2 - LASER_REFERENCE_DISTANCE,
];

// Intermediate poses in the real cycle
// PICK_SOFT_POINT: points.py p90 (intermediate point for the left tray slots)
// SCAN_PASSES: mecheye_trigger.py, each scan passes from the previous pose to the pre_move pose along Y
export const PICK_SOFT_POINT = [-345, -345, 450, -90, 0, 90];
export const SCAN_PASSES = [
  { name: 'small', from: SCAN_POSE, to: [-450, 130, 470, 82.8, 89.93, -7.3] },
  { name: 'horizontal', from: [-382, 200, 580, -90, -91, 180], to: [-382, -120, 580, -90, -91, 180] },
  { name: 'horizontal2', from: [-432, -120, 510, -90, -91, 180], to: [-432, 200, 510, -90, -91, 180] },
  { name: 'vertical', from: [-337, 250, 450, -90, -0.7, 90], to: [-335, -400, 450, -90, -0.7, 90] },
];

// The demo scans the first part: slot 0 (scan.py cycle 0)
export const DEMO_SLOT = 0;