assets/local_juice_shot: 59 mL sim2real juice-shot bottle, fine-pitch screw cap
#23
by jxxsteven7 - opened
- assets/local_juice_shot/gen_juice_shot_meshes.py +247 -0
- assets/local_juice_shot/juice_shot.urdf +95 -0
- assets/local_juice_shot/juice_shot.xml +123 -0
- assets/local_juice_shot/meshes/shot_body.obj +0 -0
- assets/local_juice_shot/meshes/shot_cap.obj +0 -0
- assets/local_juice_shot/meshes/shot_neck.obj +0 -0
- assets/local_juice_shot/meshes/shot_thread.obj +0 -0
assets/local_juice_shot/gen_juice_shot_meshes.py
ADDED
|
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Generate the juice-shot bottle + fine-pitch screw-cap meshes (OBJ) for juice_shot.xml.
|
| 2 |
+
|
| 3 |
+
Deterministic, numpy-only lathe/sweep generator (same conventions as
|
| 4 |
+
local_bottle_cap/gen_bottle_cap_meshes.py — re-running reproduces the shipped
|
| 5 |
+
``meshes/*.obj`` byte-for-byte). Run with any python that has numpy:
|
| 6 |
+
|
| 7 |
+
python gen_juice_shot_meshes.py # writes ./meshes/*.obj
|
| 8 |
+
|
| 9 |
+
REAL-WORLD REFERENCE (sim2real target): Trader Joe's Organic Mighty Turmeric
|
| 10 |
+
juice shot, NET 2 fl oz / 59 mL, measured/derived from the maintainer's
|
| 11 |
+
reference photos (bottle vs. an adult hand) + standard PET shot-bottle specs:
|
| 12 |
+
|
| 13 |
+
total height (closed) ........ ~85 mm
|
| 14 |
+
body outer diameter .......... ~38 mm (2 oz PET shot standard)
|
| 15 |
+
cap outer diameter ........... ~29 mm, height ~15.5 mm, white, fine ribs
|
| 16 |
+
neck support flange OD ....... ~33 mm (the wide ring under the cap)
|
| 17 |
+
tamper-evident band .......... stays on the NECK below the cap skirt
|
| 18 |
+
thread ....................... single-start FINE pitch 3.0 mm/turn
|
| 19 |
+
(reference: 28 mm PCO-1881 beverage finish
|
| 20 |
+
= 2.7 mm/turn); cap disengages after
|
| 21 |
+
~1.7 turns ≈ 5 mm of rise
|
| 22 |
+
contents ..................... coconut water + turmeric + lemon → pale
|
| 23 |
+
translucent yellow liquid
|
| 24 |
+
filled mass .................. ~75 g (59 g juice + ~11 g PET + ~5 g cap)
|
| 25 |
+
|
| 26 |
+
Meshes (bottle frame: origin at the base centre, +z up, metres):
|
| 27 |
+
- shot_body.obj translucent PET: base chamfer, straight wall, shoulder,
|
| 28 |
+
smooth lower neck
|
| 29 |
+
- shot_neck.obj frosted threaded neck section + opening lip + the wide
|
| 30 |
+
support flange + the tamper-evident band ring
|
| 31 |
+
- shot_thread.obj helical thread ridge — pitch is THREAD_PITCH_M_PER_TURN,
|
| 32 |
+
the SAME constant the MJCF screw equality (polycoef) and
|
| 33 |
+
the task's SCREW_PITCH_M_PER_RAD derive from
|
| 34 |
+
- shot_cap.obj white ribbed cap (cap frame: origin at the closed mount,
|
| 35 |
+
the MJCF ``<body name="cap" pos="0 0 0.069">``)
|
| 36 |
+
"""
|
| 37 |
+
|
| 38 |
+
from __future__ import annotations
|
| 39 |
+
|
| 40 |
+
import os
|
| 41 |
+
|
| 42 |
+
import numpy as np
|
| 43 |
+
|
| 44 |
+
# ── The one mechanism constant (mirrored by juice_shot.xml + the task file) ──
|
| 45 |
+
THREAD_PITCH_M_PER_TURN = 0.003 # cap rises 3 mm per full turn (fine, real-world)
|
| 46 |
+
|
| 47 |
+
# ── Bottle dimensions (metres, bottle-local z), photo-referenced ─────────────
|
| 48 |
+
BODY_R = 0.019 # 38 mm OD
|
| 49 |
+
BODY_TOP_Z = 0.052 # shoulder starts
|
| 50 |
+
NECK_R = 0.0125 # smooth visible neck
|
| 51 |
+
FLANGE_R = 0.0165 # 33 mm support flange
|
| 52 |
+
FLANGE_Z = 0.0665
|
| 53 |
+
THREAD_NECK_R = 0.0122
|
| 54 |
+
THREAD_NECK_Z0 = 0.0685
|
| 55 |
+
NECK_TOP_Z = 0.082 # opening lip
|
| 56 |
+
CAP_MOUNT_Z = 0.069 # cap body origin (== checker closed_rel_pos_m z)
|
| 57 |
+
CAP_R = 0.0145 # 29 mm OD
|
| 58 |
+
CAP_H = 0.0155
|
| 59 |
+
THREAD_Z0 = 0.0715 # first thread-turn centreline
|
| 60 |
+
THREAD_TURNS = 2.4
|
| 61 |
+
THREAD_TUBE_R = 0.0009
|
| 62 |
+
THREAD_RIDE_R = THREAD_NECK_R + 0.0004
|
| 63 |
+
|
| 64 |
+
SEG = 96
|
| 65 |
+
RIB_LOBES = 44 # fine vertical ribs on the white cap
|
| 66 |
+
RIB_AMP = 0.00045
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
def _accumulate_normals(verts: np.ndarray, faces: np.ndarray) -> np.ndarray:
|
| 70 |
+
normals = np.zeros_like(verts)
|
| 71 |
+
tri = verts[faces]
|
| 72 |
+
fn = np.cross(tri[:, 1] - tri[:, 0], tri[:, 2] - tri[:, 0])
|
| 73 |
+
for k in range(3):
|
| 74 |
+
np.add.at(normals, faces[:, k], fn)
|
| 75 |
+
lens = np.linalg.norm(normals, axis=1, keepdims=True)
|
| 76 |
+
lens[lens < 1e-12] = 1.0
|
| 77 |
+
return normals / lens
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
def _write_obj(path: str, verts: np.ndarray, faces: np.ndarray) -> None:
|
| 81 |
+
normals = _accumulate_normals(verts, faces)
|
| 82 |
+
lines = [f"v {v[0]:.6f} {v[1]:.6f} {v[2]:.6f}" for v in verts]
|
| 83 |
+
lines += [f"vn {n[0]:.6f} {n[1]:.6f} {n[2]:.6f}" for n in normals]
|
| 84 |
+
lines += [f"f {a}//{a} {b}//{b} {c}//{c}" for a, b, c in (faces + 1)]
|
| 85 |
+
with open(path, "w") as f:
|
| 86 |
+
f.write("\n".join(lines) + "\n")
|
| 87 |
+
print(f"wrote {path}: {len(verts)} verts, {len(faces)} tris")
|
| 88 |
+
|
| 89 |
+
|
| 90 |
+
def lathe(profile, *, seg: int = SEG, close_bottom=False, close_top=False, rib_rows=None):
|
| 91 |
+
theta = np.linspace(0.0, 2.0 * np.pi, seg, endpoint=False)
|
| 92 |
+
rows = []
|
| 93 |
+
for i, (r, z) in enumerate(profile):
|
| 94 |
+
rr = np.full(seg, r)
|
| 95 |
+
if rib_rows is not None and rib_rows[0] <= i <= rib_rows[1]:
|
| 96 |
+
rr = rr + RIB_AMP * np.cos(RIB_LOBES * theta)
|
| 97 |
+
rows.append(np.stack([rr * np.cos(theta), rr * np.sin(theta), np.full(seg, z)], axis=1))
|
| 98 |
+
verts = np.concatenate(rows, axis=0)
|
| 99 |
+
faces = []
|
| 100 |
+
for i in range(len(profile) - 1):
|
| 101 |
+
a0, b0 = i * seg, (i + 1) * seg
|
| 102 |
+
for j in range(seg):
|
| 103 |
+
jn = (j + 1) % seg
|
| 104 |
+
faces.append([a0 + j, a0 + jn, b0 + jn])
|
| 105 |
+
faces.append([a0 + j, b0 + jn, b0 + j])
|
| 106 |
+
if close_bottom:
|
| 107 |
+
c = len(verts)
|
| 108 |
+
verts = np.vstack([verts, [0.0, 0.0, profile[0][1]]])
|
| 109 |
+
for j in range(seg):
|
| 110 |
+
faces.append([c, (j + 1) % seg, j])
|
| 111 |
+
if close_top:
|
| 112 |
+
c = len(verts)
|
| 113 |
+
base = (len(profile) - 1) * seg
|
| 114 |
+
verts = np.vstack([verts, [0.0, 0.0, profile[-1][1]]])
|
| 115 |
+
for j in range(seg):
|
| 116 |
+
faces.append([c, base + j, base + (j + 1) % seg])
|
| 117 |
+
return verts, np.asarray(faces, dtype=np.int64)
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def _arc(p0, p1, n):
|
| 121 |
+
(r0, z0), (r1, z1) = p0, p1
|
| 122 |
+
ts = np.linspace(0.0, 1.0, n + 2)[1:-1]
|
| 123 |
+
out = []
|
| 124 |
+
for t in ts:
|
| 125 |
+
s = t * t * (3.0 - 2.0 * t)
|
| 126 |
+
out.append((float(r0 + (r1 - r0) * s), float(z0 + (z1 - z0) * t)))
|
| 127 |
+
return out
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
def shot_body():
|
| 131 |
+
profile = [
|
| 132 |
+
(0.0165, 0.0000),
|
| 133 |
+
(0.0188, 0.0025),
|
| 134 |
+
(BODY_R, 0.0060),
|
| 135 |
+
(BODY_R, BODY_TOP_Z - 0.004),
|
| 136 |
+
*_arc((BODY_R, BODY_TOP_Z - 0.004), (NECK_R, 0.0615), 6),
|
| 137 |
+
(NECK_R, 0.0615),
|
| 138 |
+
(NECK_R, FLANGE_Z), # smooth neck up to the flange
|
| 139 |
+
]
|
| 140 |
+
return lathe(profile, close_bottom=True)
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
def shot_neck():
|
| 144 |
+
"""Flange + tamper band + threaded neck + opening lip, one frosted mesh."""
|
| 145 |
+
profile = [
|
| 146 |
+
(NECK_R, 0.0655), # overlap the body-neck seam
|
| 147 |
+
(FLANGE_R, 0.0658), # support flange underside
|
| 148 |
+
(FLANGE_R, FLANGE_Z + 0.0014),
|
| 149 |
+
(0.0148, FLANGE_Z + 0.0016), # step in above the flange…
|
| 150 |
+
(0.0148, THREAD_NECK_Z0 + 0.0012), # …the tamper-evident band ring
|
| 151 |
+
(THREAD_NECK_R, THREAD_NECK_Z0 + 0.0016),
|
| 152 |
+
(THREAD_NECK_R, NECK_TOP_Z - 0.001),
|
| 153 |
+
(0.0128, NECK_TOP_Z), # opening lip, slightly out
|
| 154 |
+
(0.0102, NECK_TOP_Z), # rim
|
| 155 |
+
(0.0098, NECK_TOP_Z - 0.005), # short inner descent → dark mouth
|
| 156 |
+
]
|
| 157 |
+
return lathe(profile, close_top=True)
|
| 158 |
+
|
| 159 |
+
|
| 160 |
+
def shot_thread():
|
| 161 |
+
n_along, n_around = 300, 10
|
| 162 |
+
phi = np.linspace(0.0, 2.0 * np.pi * THREAD_TURNS, n_along)
|
| 163 |
+
z = THREAD_Z0 + THREAD_PITCH_M_PER_TURN * phi / (2.0 * np.pi)
|
| 164 |
+
t = np.linspace(0.0, 1.0, n_along)
|
| 165 |
+
taper = np.clip(np.minimum(t, 1.0 - t) / 0.08, 0.0, 1.0)
|
| 166 |
+
tube_r = THREAD_TUBE_R * (0.15 + 0.85 * taper)
|
| 167 |
+
|
| 168 |
+
path = np.stack([THREAD_RIDE_R * np.cos(phi), THREAD_RIDE_R * np.sin(phi), z], axis=1)
|
| 169 |
+
tangent = np.gradient(path, axis=0)
|
| 170 |
+
tangent /= np.linalg.norm(tangent, axis=1, keepdims=True)
|
| 171 |
+
outward = np.stack([np.cos(phi), np.sin(phi), np.zeros_like(phi)], axis=1)
|
| 172 |
+
side = np.cross(tangent, outward)
|
| 173 |
+
side /= np.linalg.norm(side, axis=1, keepdims=True)
|
| 174 |
+
|
| 175 |
+
psi = np.linspace(0.0, 2.0 * np.pi, n_around, endpoint=False)
|
| 176 |
+
verts = (
|
| 177 |
+
path[:, None, :]
|
| 178 |
+
+ tube_r[:, None, None] * (np.cos(psi)[None, :, None] * outward[:, None, :])
|
| 179 |
+
+ tube_r[:, None, None] * (np.sin(psi)[None, :, None] * side[:, None, :])
|
| 180 |
+
).reshape(-1, 3)
|
| 181 |
+
faces = []
|
| 182 |
+
for i in range(n_along - 1):
|
| 183 |
+
a0, b0 = i * n_around, (i + 1) * n_around
|
| 184 |
+
for j in range(n_around):
|
| 185 |
+
jn = (j + 1) % n_around
|
| 186 |
+
faces.append([a0 + j, b0 + j, b0 + jn])
|
| 187 |
+
faces.append([a0 + j, b0 + jn, a0 + jn])
|
| 188 |
+
for base in (0, (n_along - 1) * n_around):
|
| 189 |
+
c = len(verts)
|
| 190 |
+
i = 0 if base == 0 else n_along - 1
|
| 191 |
+
verts = np.vstack([verts, path[i]])
|
| 192 |
+
for j in range(n_around):
|
| 193 |
+
jn = (j + 1) % n_around
|
| 194 |
+
faces.append([c, base + jn, base + j] if base == 0 else [c, base + j, base + jn])
|
| 195 |
+
faces = np.asarray(faces, dtype=np.int64)
|
| 196 |
+
# Same left-handed frame as the bottle_cap generator — flip once for
|
| 197 |
+
# outward normals (verified there: -0.998 before, +0.998 after).
|
| 198 |
+
return verts, faces[:, [0, 2, 1]]
|
| 199 |
+
|
| 200 |
+
|
| 201 |
+
def shot_cap():
|
| 202 |
+
"""White ribbed cap in the cap body frame (origin = closed mount plane)."""
|
| 203 |
+
wall = [
|
| 204 |
+
(0.0138, 0.0000),
|
| 205 |
+
(CAP_R, 0.0018),
|
| 206 |
+
(CAP_R, 0.0040),
|
| 207 |
+
(CAP_R, 0.0065),
|
| 208 |
+
(CAP_R, 0.0090),
|
| 209 |
+
(CAP_R, 0.0115),
|
| 210 |
+
(CAP_R, 0.0128),
|
| 211 |
+
*_arc((CAP_R, 0.0128), (0.0110, CAP_H - 0.0004), 4),
|
| 212 |
+
(0.0110, CAP_H - 0.0004),
|
| 213 |
+
(0.0045, CAP_H),
|
| 214 |
+
]
|
| 215 |
+
inner = [
|
| 216 |
+
(0.0045, CAP_H),
|
| 217 |
+
(0.0126, 0.0122),
|
| 218 |
+
(0.0126, 0.0006),
|
| 219 |
+
(0.0138, 0.0000),
|
| 220 |
+
]
|
| 221 |
+
profile = wall + inner
|
| 222 |
+
v, f = lathe(profile, rib_rows=(1, 6))
|
| 223 |
+
c = len(v)
|
| 224 |
+
v = np.vstack([v, [0.0, 0.0, CAP_H]])
|
| 225 |
+
seg = SEG
|
| 226 |
+
top_row = (len(wall) - 1) * seg
|
| 227 |
+
faces = f.tolist()
|
| 228 |
+
for j in range(seg):
|
| 229 |
+
faces.append([c, top_row + j, top_row + (j + 1) % seg])
|
| 230 |
+
return v, np.asarray(faces, dtype=np.int64)
|
| 231 |
+
|
| 232 |
+
|
| 233 |
+
def main() -> None:
|
| 234 |
+
out = os.path.join(os.path.dirname(os.path.abspath(__file__)), "meshes")
|
| 235 |
+
os.makedirs(out, exist_ok=True)
|
| 236 |
+
for name, build in (
|
| 237 |
+
("shot_body", shot_body),
|
| 238 |
+
("shot_neck", shot_neck),
|
| 239 |
+
("shot_thread", shot_thread),
|
| 240 |
+
("shot_cap", shot_cap),
|
| 241 |
+
):
|
| 242 |
+
verts, faces = build()
|
| 243 |
+
_write_obj(os.path.join(out, f"{name}.obj"), verts, faces)
|
| 244 |
+
|
| 245 |
+
|
| 246 |
+
if __name__ == "__main__":
|
| 247 |
+
main()
|
assets/local_juice_shot/juice_shot.urdf
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<!-- URDF twin of juice_shot.xml (fine-pitch screw cap), for the IsaacSim USD
|
| 3 |
+
conversion only (MuJoCo loads the MJCF directly). Generate the USD in the
|
| 4 |
+
Isaac env with:
|
| 5 |
+
|
| 6 |
+
python scripts/convert_board_nail_urdf_to_usd.py \
|
| 7 |
+
- -urdf roboverse_data/assets/local_juice_shot/juice_shot.urdf \
|
| 8 |
+
- -root-link bottle - -out roboverse_data/assets/local_juice_shot/usd/juice_shot.usd
|
| 9 |
+
|
| 10 |
+
(drop the space in the flags; '-' '-' inside an XML comment is illegal).
|
| 11 |
+
The root is FLOATING on the Isaac side — the cfg loads it with
|
| 12 |
+
fix_base_link=False, matching the MuJoCo freejoint.
|
| 13 |
+
|
| 14 |
+
SCREW COUPLING CAVEAT (same as bottle_cap.urdf): URDF cannot express the
|
| 15 |
+
MJCF joint equality (cap_slide = 0.000477465 * cap_twist, 3 mm/turn), so
|
| 16 |
+
this twin chains the two joints WITHOUT the coupling; wiring it on the
|
| 17 |
+
Isaac side is part of the documented one-time USD conversion follow-up.
|
| 18 |
+
MuJoCo — the physics backend of record — is unaffected.
|
| 19 |
+
|
| 20 |
+
Real-world reference (sim2real): Trader Joe's Organic Mighty Turmeric
|
| 21 |
+
juice shot, 2 fl oz / 59 mL — ~85 mm tall, 38 mm body, 29 mm white ribbed
|
| 22 |
+
cap, 33 mm support flange, thread 3.0 mm/turn (28 mm PCO-1881 reference
|
| 23 |
+
2.7 mm), ~1.7 turns to open, ~75 g filled. -->
|
| 24 |
+
<robot name="juice_shot">
|
| 25 |
+
<link name="bottle">
|
| 26 |
+
<inertial>
|
| 27 |
+
<origin xyz="0 0 0.032"/>
|
| 28 |
+
<mass value="0.068"/>
|
| 29 |
+
<inertia ixx="0.00004" iyy="0.00004" izz="0.000015" ixy="0" ixz="0" iyz="0"/>
|
| 30 |
+
</inertial>
|
| 31 |
+
<visual>
|
| 32 |
+
<geometry><mesh filename="meshes/shot_body.obj"/></geometry>
|
| 33 |
+
</visual>
|
| 34 |
+
<visual>
|
| 35 |
+
<geometry><mesh filename="meshes/shot_neck.obj"/></geometry>
|
| 36 |
+
</visual>
|
| 37 |
+
<visual>
|
| 38 |
+
<geometry><mesh filename="meshes/shot_thread.obj"/></geometry>
|
| 39 |
+
</visual>
|
| 40 |
+
<collision>
|
| 41 |
+
<origin xyz="0 0 0.026"/>
|
| 42 |
+
<geometry><cylinder radius="0.019" length="0.052"/></geometry>
|
| 43 |
+
</collision>
|
| 44 |
+
<collision>
|
| 45 |
+
<origin xyz="0 0 0.0595"/>
|
| 46 |
+
<geometry><cylinder radius="0.0125" length="0.015"/></geometry>
|
| 47 |
+
</collision>
|
| 48 |
+
<collision>
|
| 49 |
+
<origin xyz="0 0 0.0665"/>
|
| 50 |
+
<geometry><cylinder radius="0.0165" length="0.002"/></geometry>
|
| 51 |
+
</collision>
|
| 52 |
+
<collision>
|
| 53 |
+
<origin xyz="0 0 0.0745"/>
|
| 54 |
+
<geometry><cylinder radius="0.0122" length="0.015"/></geometry>
|
| 55 |
+
</collision>
|
| 56 |
+
</link>
|
| 57 |
+
<link name="cap_screw">
|
| 58 |
+
<!-- Massless carrier for the twist DOF (URDF needs one link per joint). -->
|
| 59 |
+
<inertial>
|
| 60 |
+
<origin xyz="0 0 0.008"/>
|
| 61 |
+
<mass value="0.001"/>
|
| 62 |
+
<inertia ixx="0.0000002" iyy="0.0000002" izz="0.0000002" ixy="0" ixz="0" iyz="0"/>
|
| 63 |
+
</inertial>
|
| 64 |
+
</link>
|
| 65 |
+
<link name="cap">
|
| 66 |
+
<inertial>
|
| 67 |
+
<origin xyz="0 0 0.008"/>
|
| 68 |
+
<mass value="0.0095"/>
|
| 69 |
+
<inertia ixx="0.0000008" iyy="0.0000008" izz="0.000001" ixy="0" ixz="0" iyz="0"/>
|
| 70 |
+
</inertial>
|
| 71 |
+
<visual>
|
| 72 |
+
<geometry><mesh filename="meshes/shot_cap.obj"/></geometry>
|
| 73 |
+
</visual>
|
| 74 |
+
<collision>
|
| 75 |
+
<origin xyz="0 0 0.00775"/>
|
| 76 |
+
<geometry><cylinder radius="0.0145" length="0.0155"/></geometry>
|
| 77 |
+
</collision>
|
| 78 |
+
</link>
|
| 79 |
+
<joint name="cap_twist" type="revolute">
|
| 80 |
+
<parent link="bottle"/>
|
| 81 |
+
<child link="cap_screw"/>
|
| 82 |
+
<origin xyz="0 0 0.069"/>
|
| 83 |
+
<axis xyz="0 0 1"/>
|
| 84 |
+
<limit lower="0.0" upper="16.7552" effort="2" velocity="20.0"/>
|
| 85 |
+
<dynamics damping="0.005" friction="0.02"/>
|
| 86 |
+
</joint>
|
| 87 |
+
<joint name="cap_slide" type="prismatic">
|
| 88 |
+
<parent link="cap_screw"/>
|
| 89 |
+
<child link="cap"/>
|
| 90 |
+
<origin xyz="0 0 0"/>
|
| 91 |
+
<axis xyz="0 0 1"/>
|
| 92 |
+
<limit lower="0.0" upper="0.008" effort="50" velocity="0.5"/>
|
| 93 |
+
<dynamics damping="0.2" friction="0.0"/>
|
| 94 |
+
</joint>
|
| 95 |
+
</robot>
|
assets/local_juice_shot/juice_shot.xml
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<mujoco model="juice_shot">
|
| 2 |
+
<!-- 59 mL juice-shot bottle + FINE-PITCH screw cap for the open_juice_shot
|
| 3 |
+
task — a sim2real twin of a real retail bottle (Trader Joe's Organic
|
| 4 |
+
Mighty Turmeric juice shot, NET 2 fl oz / 59 mL), dimensioned from the
|
| 5 |
+
maintainer's reference photos + standard PET shot-bottle specs:
|
| 6 |
+
|
| 7 |
+
total height (closed) ~85 mm body OD ~38 mm
|
| 8 |
+
cap OD ~29 mm cap height ~15.5 mm
|
| 9 |
+
support flange OD ~33 mm tamper band stays on the neck
|
| 10 |
+
thread pitch 3.0 mm/turn, single-start FINE
|
| 11 |
+
(reference: 28 mm PCO-1881 beverage finish =
|
| 12 |
+
2.7 mm/turn), ~1.7 turns to disengage
|
| 13 |
+
filled mass ~75 g (59 g juice + ~11 g PET + ~5 g cap)
|
| 14 |
+
|
| 15 |
+
The cap is the same screw mechanism as local_bottle_cap v2 — SLIDE
|
| 16 |
+
(cap_slide, listed FIRST for the parrot_sim overlay's first-joint
|
| 17 |
+
contract) + coaxial HINGE (cap_twist), tied by the joint equality below:
|
| 18 |
+
slide = PITCH * twist, PITCH = 0.003 / 2π = 0.000477465 m/rad. The only
|
| 19 |
+
way the cap rises is by TURNING counter-clockwise: ~1.7 turns to the
|
| 20 |
+
task's 5 mm gate, ~2.7 turns to the 8 mm stop. Dry thread friction
|
| 21 |
+
(0.02 N·m) means a straight pull must back-drive the FINE screw at
|
| 22 |
+
≈ frictionloss / PITCH ≈ 42 N — the finer pitch gives the thread MORE
|
| 23 |
+
mechanical advantage than the big bottle's 18 mm/turn, so this tiny cap
|
| 24 |
+
is even harder to yank off, exactly as with real beverage closures
|
| 25 |
+
(measured: 20 N pulls deflect ~0.45 mm elastically; ~42 N+ slips the
|
| 26 |
+
thread and the cap backs off ROTATING, like a stripped real cap).
|
| 27 |
+
The BOTTLE BASE IS FREE (cfg fix_base_link=False): at ~75 g the bottle
|
| 28 |
+
spins with the cap unless the other hand pins it — bimanual by
|
| 29 |
+
mechanics, and light enough that a table-friction-only "no-hands" cheat
|
| 30 |
+
does not exist.
|
| 31 |
+
|
| 32 |
+
Modeling notes (shared with bottle_cap.xml v2 — see its header for the
|
| 33 |
+
full rationale):
|
| 34 |
+
- explicit cap<->bottle contact exclude: MuJoCo's parent-child filter
|
| 35 |
+
is SKIPPED when the parent welds to the world, i.e. exactly in the
|
| 36 |
+
fixed-base standalone loads the asset regression tests use;
|
| 37 |
+
- solreffriction stiffens the friction constraint (no creep: cap weight
|
| 38 |
+
back-drives at ~4e-5 N·m, 500x below the 0.02 N·m thread friction);
|
| 39 |
+
- collision = primitive cylinders (group 3, hidden) with the calibrated
|
| 40 |
+
grasp friction/priority; visuals = group-1 meshes from
|
| 41 |
+
gen_juice_shot_meshes.py (deterministic; the visible thread helix is
|
| 42 |
+
generated at the SAME 3 mm/turn pitch as the equality);
|
| 43 |
+
- the juice visual cylinder carries the liquid mass (density 1000);
|
| 44 |
+
- success is the cap's base-relative displacement (articulated_open,
|
| 45 |
+
min_open_m = 0.005): qpos 0 = closed, slide range top 0.008;
|
| 46 |
+
cap origin (0 0 0.069) == the checker's closed_rel_pos_m;
|
| 47 |
+
- loaded as ArticulationObjCfg(fix_base_link=False); the root body
|
| 48 |
+
carries no pos/quat (set via the cfg default_position). -->
|
| 49 |
+
<compiler angle="radian" meshdir="meshes"/>
|
| 50 |
+
<asset>
|
| 51 |
+
<mesh name="shot_body_mesh" file="shot_body.obj"/>
|
| 52 |
+
<mesh name="shot_neck_mesh" file="shot_neck.obj"/>
|
| 53 |
+
<mesh name="shot_thread_mesh" file="shot_thread.obj"/>
|
| 54 |
+
<mesh name="shot_cap_mesh" file="shot_cap.obj"/>
|
| 55 |
+
<material name="mat_pet" rgba="0.92 0.94 0.96 0.22" specular="0.9" shininess="0.9"/>
|
| 56 |
+
<material name="mat_juice" rgba="0.93 0.85 0.55 0.55" specular="0.5" shininess="0.7"/>
|
| 57 |
+
<material name="mat_neck_frost" rgba="0.85 0.88 0.92 1.0" specular="0.4" shininess="0.5"/>
|
| 58 |
+
<material name="mat_thread" rgba="0.70 0.74 0.80 1.0" specular="0.5" shininess="0.55"/>
|
| 59 |
+
<material name="mat_cap_white" rgba="0.94 0.94 0.94 1.0" specular="0.35" shininess="0.45"/>
|
| 60 |
+
<material name="mat_label_orange" rgba="0.93 0.42 0.12 1.0" specular="0.2" shininess="0.3"/>
|
| 61 |
+
<material name="mat_label_light" rgba="0.93 0.90 0.85 0.9" specular="0.2" shininess="0.3"/>
|
| 62 |
+
</asset>
|
| 63 |
+
<worldbody>
|
| 64 |
+
<body name="bottle">
|
| 65 |
+
<!-- collision (hidden group 3) -->
|
| 66 |
+
<geom name="shot_body_col" type="cylinder" size="0.019 0.026" pos="0 0 0.026" group="3"
|
| 67 |
+
density="220" friction="2.0 0.1 0.005" priority="2" rgba="0.2 0.2 0.2 0"/>
|
| 68 |
+
<geom name="shot_neck_col" type="cylinder" size="0.0125 0.0075" pos="0 0 0.0595" group="3"
|
| 69 |
+
density="800" friction="2.0 0.1 0.005" priority="2" rgba="0.2 0.2 0.2 0"/>
|
| 70 |
+
<geom name="shot_flange_col" type="cylinder" size="0.0165 0.001" pos="0 0 0.0665" group="3"
|
| 71 |
+
density="800" friction="2.0 0.1 0.005" priority="2" rgba="0.2 0.2 0.2 0"/>
|
| 72 |
+
<geom name="shot_topneck_col" type="cylinder" size="0.0122 0.0075" pos="0 0 0.0745" group="3"
|
| 73 |
+
density="600" friction="2.0 0.1 0.005" priority="2" rgba="0.2 0.2 0.2 0"/>
|
| 74 |
+
<!-- visual -->
|
| 75 |
+
<geom name="shot_juice_vis" type="cylinder" size="0.0163 0.0225" pos="0 0 0.0275"
|
| 76 |
+
material="mat_juice" contype="0" conaffinity="0" group="1" density="1000"/>
|
| 77 |
+
<geom name="shot_label_top_vis" type="cylinder" size="0.0192 0.010" pos="0 0 0.040"
|
| 78 |
+
material="mat_label_orange" contype="0" conaffinity="0" group="1" density="50"/>
|
| 79 |
+
<geom name="shot_label_mid_vis" type="cylinder" size="0.0192 0.0065" pos="0 0 0.0235"
|
| 80 |
+
material="mat_label_light" contype="0" conaffinity="0" group="1" density="50"/>
|
| 81 |
+
<geom name="shot_label_bot_vis" type="cylinder" size="0.0192 0.0055" pos="0 0 0.0115"
|
| 82 |
+
material="mat_label_orange" contype="0" conaffinity="0" group="1" density="50"/>
|
| 83 |
+
<geom name="shot_body_vis" type="mesh" mesh="shot_body_mesh" material="mat_pet"
|
| 84 |
+
contype="0" conaffinity="0" group="1" density="40"/>
|
| 85 |
+
<geom name="shot_neck_vis" type="mesh" mesh="shot_neck_mesh" material="mat_neck_frost"
|
| 86 |
+
contype="0" conaffinity="0" group="1" density="100"/>
|
| 87 |
+
<geom name="shot_thread_vis" type="mesh" mesh="shot_thread_mesh" material="mat_thread"
|
| 88 |
+
contype="0" conaffinity="0" group="1" density="100"/>
|
| 89 |
+
<body name="cap" pos="0 0 0.069">
|
| 90 |
+
<!-- slide FIRST (overlay contract — see header) -->
|
| 91 |
+
<!-- The high slide armature models the fine screw's TRANSLATIONAL
|
| 92 |
+
REFLECTED INERTIA (I_twist / pitch² ≈ 440 kg-equivalent for this
|
| 93 |
+
thread — 1.0 is conservative): a yank meets thread mechanical
|
| 94 |
+
advantage inertially, and gravity settle tightens 0.10 → 0.003 mm.
|
| 95 |
+
It does NOT fix the equality's elastic leak under load — that
|
| 96 |
+
lever is the equality solimp (measured; see the equality comment).
|
| 97 |
+
Twist-side cost is negligible (armature · pitch² ≈ 2e-7 kg·m²). -->
|
| 98 |
+
<joint name="cap_slide" type="slide" axis="0 0 1" range="0 0.008"
|
| 99 |
+
damping="0.2" armature="1.0"/>
|
| 100 |
+
<joint name="cap_twist" type="hinge" axis="0 0 1" range="0 16.7552"
|
| 101 |
+
frictionloss="0.02" damping="0.005" armature="0.0001" solreffriction="0.004 1"/>
|
| 102 |
+
<geom name="shot_cap_col" type="cylinder" size="0.0145 0.00775" pos="0 0 0.00775" group="3"
|
| 103 |
+
density="800" friction="2.0 0.1 0.005" priority="2" rgba="0.2 0.2 0.2 0"/>
|
| 104 |
+
<geom name="shot_cap_vis" type="mesh" mesh="shot_cap_mesh" material="mat_cap_white"
|
| 105 |
+
contype="0" conaffinity="0" group="1" density="100"/>
|
| 106 |
+
</body>
|
| 107 |
+
</body>
|
| 108 |
+
</worldbody>
|
| 109 |
+
<contact>
|
| 110 |
+
<exclude body1="bottle" body2="cap"/>
|
| 111 |
+
</contact>
|
| 112 |
+
<equality>
|
| 113 |
+
<!-- The fine screw: cap_slide = 0.000477465 * cap_twist (3 mm per 2π turn). -->
|
| 114 |
+
<!-- solimp is deliberately extreme: with a 10 g cap and the solref
|
| 115 |
+
timeconst floored at 2*dt, the equality's REGULARIZATION (efc_R,
|
| 116 |
+
set by 1-impedance) is what a pull deflects against — measured, a
|
| 117 |
+
20 N pull "opened" 3.2 mm at the bottle_cap-style 0.99 impedance
|
| 118 |
+
with the thread friction NOT slipping. 0.999/0.9999 brings that
|
| 119 |
+
elastic leak to 0.45 mm while twist-opening is unaffected. -->
|
| 120 |
+
<joint joint1="cap_slide" joint2="cap_twist" polycoef="0 0.000477465 0 0 0"
|
| 121 |
+
solref="0.004 1" solimp="0.999 0.9999 0.0005"/>
|
| 122 |
+
</equality>
|
| 123 |
+
</mujoco>
|
assets/local_juice_shot/meshes/shot_body.obj
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/local_juice_shot/meshes/shot_cap.obj
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/local_juice_shot/meshes/shot_neck.obj
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/local_juice_shot/meshes/shot_thread.obj
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|