diff --git a/sim/sorting/build.py b/sim/sorting/build.py
index e3531ee..cc899de 100644
--- a/sim/sorting/build.py
+++ b/sim/sorting/build.py
@@ -7,8 +7,10 @@ readings and taught points carry over without conversion.
- Arm joints: the fitted kinematics (data/arm_kinematics.json, robot/kinematics.py): each joint's frame
and zero corrected to the controller's own answers (0.2 mm). A joint's qpos is the controller's angle in radians.
-- Arm meshes: JAKA's MiniCobo STEP (sim/sorting/assets/minicobo, the same files the Lumi app draws), placed with the
- app's link chain (Lumi-app src/lib/armFrame.ts, fitted to the controller within ~1 mm).
+- Look: the Lumi app's own 3D model (app_look.py: shell, trim, visor, red bands, green ring, JAKA lettering,
+ cutshion logo, cameras, lamp), each part in its link's frame; the arm's parts placed with the app's link chain
+ (Lumi-app src/lib/armFrame.ts, fitted to the controller within ~1 mm).
+- Arm collision: JAKA's MiniCobo STEP meshes (sim/sorting/assets/minicobo, the arm in the app model).
- Torso, lift, head, base: the vendor URDF meshes, placed from the arm through the URDF chain at the sorting pose
(lift LIFT_M, waist WAIST_RAD, head straight).
- Torso camera: the hand-eye calibration (data/camera_extrinsics.json), fovy from the factory intrinsics.
@@ -26,6 +28,8 @@ from pathlib import Path
import mujoco
import numpy as np
+import app_look
+
HERE = Path(__file__).resolve().parent
SIM = HERE.parent
REPO = SIM.parent
@@ -276,12 +280,25 @@ def build():
x.append(' ')
x.append(' ')
x.append(' ')
- x.append(' ')
+ # an office: light walls all round and soft light from everywhere, so the white shell reads white
+ x.append(' '
+ '')
x.append(' ')
for i in range(1, 7):
x.append(f' ')
- for name in sorted({g[1] for g in tgeoms if g[0] == "mesh"}):
- x.append(f' ')
+ look = app_look.parts()
+ by_link = {}
+ for k, part in enumerate(look):
+ name = f"app{k}_{part['link']}_{part['material']}"
+ by_link.setdefault(part["link"], []).append(name)
+ x.append(f' ') # looks only: thin decals have no volume
+ tex = ""
+ if part["texture"]:
+ x.append(f' ')
+ tex = f' texture="tex_{name}"'
+ x.append(f' ')
+ x.append(' ')
x.append(' ')
x.append(' ')
for name, rgba in (("white", "0.92 0.93 0.94 1"), ("black", "0.08 0.08 0.09 1"), ("alu", "0.75 0.76 0.78 1"),
@@ -303,6 +320,7 @@ def build():
x.append(' ')
x.append(' ')
x.append(' ')
+ x.append(' ') # from Lumi's front
floor_z = FLOOR_Z
x.append(f' ')
x.append(f' ')
@@ -312,8 +330,9 @@ def build():
# torso, lift, head and base, fixed at the sorting pose
x.append(f' ')
for i, (kind, mesh, Tg, size, mat) in enumerate(tgeoms):
- if kind == "mesh":
- x.append(f' ')
+ if kind == "mesh": # the URDF link's frame here: the app's parts of that link go on it
+ for name in by_link.get(mesh, []):
+ x.append(f' ')
else:
x.append(f' ')
x.append(' ')
@@ -327,7 +346,11 @@ def build():
x.append(f'{ind} ')
lim = math.radians(limits[i])
x.append(f'{ind} ')
- x.append(f'{ind} ')
+ for name in by_link[f"link_a{i + 1}"]:
+ x.append(f'{ind} ')
+ if i == 5: # the flange plate (link_at): 36 mm out along link_a6's z
+ for name in by_link["link_at"]:
+ x.append(f'{ind} ')
x.append(f'{ind} ')
ind += " "
x.append(f'{ind}')
diff --git a/sim/sorting/sorting.xml b/sim/sorting/sorting.xml
index ee50d69..cdcc330 100644
--- a/sim/sorting/sorting.xml
+++ b/sim/sorting/sorting.xml
@@ -2,7 +2,7 @@
-
+
@@ -10,13 +10,68 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -41,49 +96,67 @@
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-
+
+
-
+
-
+
+
-
+
-
+
+