Rebuild the layout of an SO-101 bench cell after work on the arm mount, pad and jig plate, from an overhead RGB-D frame and wrist-camera stills
harbor run -t reactive-labs/bench-layout-bc2-2319harbor download reactive-labs/bench-layout-bc2-2319Bench cell BC2-2319 is back from the maintenance bay. The arm was unbolted to replace its cracked base plate and bolted down again; the target pad was pushed when the table top was cleaned; and jig plate JP-1 was taken off for regrinding and put back without its locating pins. The work order lists no other work on the bench. Until the unit file holds the layout as it is now, jobs planned in simulation for this cell miss the fixtures.
The overhead camera hangs from the cell frame and was checked after the work: it sits at its drawing pose. The world frame is the table frame of the cell sheet, with the table top at z = 0. The servos were not touched: zero offsets and everything else about this unit not named below are at their drawing values.
The cell, the simulator and the unit file format are described in /app/CELL_SHEET.md; the exact shapes of the tray, the pad, the jig plate and the arm are in /app/scene.xml and /app/so101.xml. This cell carries jig plate JP-1, whose drawing pose is centre (0.20, 0.00) m, yaw 0, on its locating pins. Its frame has the origin at the plate centre and the x axis along the 220 mm side, so divot (i, j) is at (-80 + 40 i, -60 + 40 j) mm and the small magenta mark is in the +x, +y corner. Before the cell went back into service, the technician took these records, all in /app/data/:
overhead_rgb.png and overhead_depth.png: one frame from the overhead camera (320 x 240) with the arm parked at readings [0, -1.57, 1.57, 0.75, 1.57, 0]. The camera is an RGB-D unit: the depth frame is registered pixel for pixel with the colour frame and holds 16-bit depth in millimetres along the camera's viewing axis (not along the pixel's ray). A value of 0 means no return.wrist/: 6 stills from the wrist camera (320 x 240), looking at the fixtures from close up, with the encoder readings logged when each still was taken (wrist/readings.csv).Loose parts were on the bench while the records were taken; they are not part of the layout.
Work out the pose of the tray, the position of the pad, the pose of the jig plate and the pose of the arm mount in the world frame, and write them to /app/out/unit.json:
{"tray": [x, y, yaw], "pad": [x, y], "jig": [x, y, yaw], "base": [x, y, 0.0, yaw]}
Units are metres and radians, with the meaning of the unit file keys in the cell sheet. The unit file has no pad yaw (the simulator draws the pad square to the world axes); give the pad centre. The simulator does not read jig from a unit file: it places the plate from a reset layout, Cell.reset({"fixtures": {"jig": [x, y, yaw]}}).
The file is checked against the unit as built, with these measures (full marks at or below the first value, no marks at or above the second, linear between; the weights are in brackets):
| Measure | Full | None | Weight |
|---|---|---|---|
| Tray centre position error | 1 mm | 6 mm | 0.10 |
| Tray yaw error (the tray looks the same turned by 180 deg) | 0.3 deg | 2 deg | 0.05 |
| Pad centre position error | 1 mm | 6 mm | 0.10 |
| Jig plate centre position error | 1 mm | 6 mm | 0.10 |
| Jig plate yaw error | 0.3 deg | 2 deg | 0.05 |
| Arm mount position error | 1 mm | 4 mm | 0.10 |
| Arm mount yaw error | 0.2 deg | 0.8 deg | 0.10 |
| Placement: mean miss over 40 hidden tip targets | 1 mm | 4 mm | 0.40 |
For the placement check, each target is a point in tray, pad or jig coordinates (14 in the tray, 60 mm above the table; 10 over the pad, 30 mm above the table; 16 over jig divots, 20 mm above the plate top). It is put into the world with your pose for that fixture, turned into joint readings with benchcell.kin.Kin built from your unit file (ik(target, q0=[0, -0.5, 0.8, 1.2, 1.57, 0])), and the arm of the real unit is moved to those readings. The miss is the horizontal distance between where the tip ends up in the real fixture's coordinates and where it was meant to be.