Add files using upload-large-folder tool
Browse files- DragMesh/dragmesh/data/__pycache__/data_loader_v2.cpython-310.pyc +0 -0
- DragMesh/dragmesh/geometry/__pycache__/__init__.cpython-310.pyc +0 -0
- DragMesh/dragmesh/geometry/__pycache__/dual_quaternion.cpython-310.pyc +0 -0
- DragMesh/dragmesh/geometry/dual_quaternion.py +392 -0
- DragMesh/dragmesh/inference/__pycache__/__init__.cpython-310.pyc +0 -0
- DragMesh/dragmesh/inference/__pycache__/inference_animation.cpython-310.pyc +0 -0
- DragMesh/dragmesh/inference/__pycache__/inference_pipeline.cpython-310.pyc +0 -0
- DragMesh/dragmesh/models/__pycache__/model_v2.cpython-310.pyc +0 -0
- integration/__pycache__/articulation_bridge.cpython-310.pyc +0 -0
- integration/dragmesh_drawer_traj/cabinet_drawer_trajectory.json +38 -0
- integration/dragmesh_fridge_traj/fridge_door_trajectory.json +43 -0
- integration/dragmesh_input/cabinet_joints.json +70 -0
- integration/dragmesh_input/cabinet_mesh.obj +0 -0
- integration/dragmesh_input/fridge_joints.json +87 -0
- integration/dragmesh_input/fridge_mesh.obj +0 -0
- integration/room_scene_output/scene_meta.json +127 -0
- integration/scenesmith_hybrid_output/scene_plan.json +171 -0
- integration/test_data/cabinet.obj +140 -0
- integration/test_data/drawer.obj +116 -0
- mujoco_menagerie/unitree_g1/scene_mjx.xml +121 -0
DragMesh/dragmesh/data/__pycache__/data_loader_v2.cpython-310.pyc
ADDED
|
Binary file (20.5 kB). View file
|
|
|
DragMesh/dragmesh/geometry/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (152 Bytes). View file
|
|
|
DragMesh/dragmesh/geometry/__pycache__/dual_quaternion.cpython-310.pyc
ADDED
|
Binary file (10.8 kB). View file
|
|
|
DragMesh/dragmesh/geometry/dual_quaternion.py
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Copyright (c) 2023 Chaoyang Wang, Carnegie Mellon University.
|
| 2 |
+
|
| 3 |
+
import os
|
| 4 |
+
import sys
|
| 5 |
+
|
| 6 |
+
# from lietorch import SE3, SO3, Sim3
|
| 7 |
+
from typing import Tuple
|
| 8 |
+
|
| 9 |
+
import torch
|
| 10 |
+
import torch.nn.functional as F
|
| 11 |
+
|
| 12 |
+
sys.path.insert(
|
| 13 |
+
0,
|
| 14 |
+
"%s/../third_party" % os.path.join(os.path.dirname(__file__)),
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
# from quaternion import quaternion_conjugate as _quaternion_conjugate_cuda
|
| 18 |
+
# from quaternion import quaternion_mul as _quaternion_mul_cuda
|
| 19 |
+
|
| 20 |
+
DualQuaternions = Tuple[torch.Tensor, torch.Tensor]
|
| 21 |
+
QuaternionTranslation = Tuple[torch.Tensor, torch.Tensor]
|
| 22 |
+
|
| 23 |
+
"""
|
| 24 |
+
quaternion library from pytorch3d
|
| 25 |
+
https://pytorch3d.readthedocs.io/en/latest/_modules/pytorch3d/transforms/rotation_conversions.html
|
| 26 |
+
"""
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def _sqrt_positive_part(x: torch.Tensor) -> torch.Tensor:
|
| 30 |
+
"""
|
| 31 |
+
Returns torch.sqrt(torch.max(0, x))
|
| 32 |
+
but with a zero subgradient where x is 0.
|
| 33 |
+
"""
|
| 34 |
+
ret = torch.zeros_like(x)
|
| 35 |
+
positive_mask = x > 0
|
| 36 |
+
ret[positive_mask] = torch.sqrt(x[positive_mask])
|
| 37 |
+
return ret
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
@torch.jit.script
|
| 41 |
+
def matrix_to_quaternion(matrix: torch.Tensor) -> torch.Tensor:
|
| 42 |
+
"""
|
| 43 |
+
Convert rotations given as rotation matrices to quaternions.
|
| 44 |
+
|
| 45 |
+
Args:
|
| 46 |
+
matrix: Rotation matrices as tensor of shape (..., 3, 3).
|
| 47 |
+
|
| 48 |
+
Returns:
|
| 49 |
+
quaternions: quaternions with real part first, as tensor of shape (..., 4).
|
| 50 |
+
"""
|
| 51 |
+
if matrix.shape[-1] != 3 or matrix.shape[-2] != 3:
|
| 52 |
+
raise ValueError(f"Invalid rotation matrix shape {matrix.shape}.")
|
| 53 |
+
|
| 54 |
+
batch_dim = matrix.shape[:-2]
|
| 55 |
+
m00, m01, m02, m10, m11, m12, m20, m21, m22 = torch.unbind(
|
| 56 |
+
matrix.reshape(batch_dim + (9,)), dim=-1
|
| 57 |
+
)
|
| 58 |
+
|
| 59 |
+
q_abs = _sqrt_positive_part(
|
| 60 |
+
torch.stack(
|
| 61 |
+
[
|
| 62 |
+
1.0 + m00 + m11 + m22,
|
| 63 |
+
1.0 + m00 - m11 - m22,
|
| 64 |
+
1.0 - m00 + m11 - m22,
|
| 65 |
+
1.0 - m00 - m11 + m22,
|
| 66 |
+
],
|
| 67 |
+
dim=-1,
|
| 68 |
+
)
|
| 69 |
+
)
|
| 70 |
+
|
| 71 |
+
# we produce the desired quaternion multiplied by each of r, i, j, k
|
| 72 |
+
quat_by_rijk = torch.stack(
|
| 73 |
+
[
|
| 74 |
+
torch.stack([q_abs[..., 0] ** 2, m21 - m12, m02 - m20, m10 - m01], dim=-1),
|
| 75 |
+
torch.stack([m21 - m12, q_abs[..., 1] ** 2, m10 + m01, m02 + m20], dim=-1),
|
| 76 |
+
torch.stack([m02 - m20, m10 + m01, q_abs[..., 2] ** 2, m12 + m21], dim=-1),
|
| 77 |
+
torch.stack([m10 - m01, m20 + m02, m21 + m12, q_abs[..., 3] ** 2], dim=-1),
|
| 78 |
+
],
|
| 79 |
+
dim=-2,
|
| 80 |
+
)
|
| 81 |
+
|
| 82 |
+
# We floor here at 0.1 but the exact level is not important; if q_abs is small,
|
| 83 |
+
# the candidate won't be picked.
|
| 84 |
+
flr = torch.tensor(0.1).to(dtype=q_abs.dtype, device=q_abs.device)
|
| 85 |
+
quat_candidates = quat_by_rijk / (2.0 * q_abs[..., None].max(flr))
|
| 86 |
+
|
| 87 |
+
# if not for numerical problems, quat_candidates[i] should be same (up to a sign),
|
| 88 |
+
# forall i; we pick the best-conditioned one (with the largest denominator)
|
| 89 |
+
|
| 90 |
+
return quat_candidates[
|
| 91 |
+
torch.nn.functional.one_hot(q_abs.argmax(dim=-1), num_classes=4) > 0.5,
|
| 92 |
+
:, # pyre-ignore[16]
|
| 93 |
+
].reshape(batch_dim + (4,))
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
@torch.jit.script
|
| 97 |
+
def _quaternion_conjugate(q: torch.Tensor) -> torch.Tensor:
|
| 98 |
+
"""
|
| 99 |
+
https://mathworld.wolfram.com/QuaternionConjugate.html
|
| 100 |
+
when q is unit quaternion, inv(q) = conjugate(q)
|
| 101 |
+
"""
|
| 102 |
+
return torch.cat((q[..., 0:1], -q[..., 1:]), -1)
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def quaternion_conjugate(q: torch.Tensor) -> torch.Tensor:
|
| 106 |
+
return _quaternion_conjugate(q)
|
| 107 |
+
# if q.is_cuda:
|
| 108 |
+
# out_shape = q.shape
|
| 109 |
+
# return _quaternion_conjugate_cuda(q.contiguous().view(-1, 4)).view(out_shape)
|
| 110 |
+
# else:
|
| 111 |
+
# return _quaternion_conjugate(q)
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
@torch.jit.script
|
| 115 |
+
def standardize_quaternion(quaternions: torch.Tensor) -> torch.Tensor:
|
| 116 |
+
"""
|
| 117 |
+
Convert a unit quaternion to a standard form: one in which the real
|
| 118 |
+
part is non negative.
|
| 119 |
+
|
| 120 |
+
Args:
|
| 121 |
+
quaternions: Quaternions with real part first,
|
| 122 |
+
as tensor of shape (..., 4).
|
| 123 |
+
|
| 124 |
+
Returns:
|
| 125 |
+
out: Standardized quaternions as tensor of shape (..., 4).
|
| 126 |
+
"""
|
| 127 |
+
return torch.where(quaternions[..., 0:1] < 0, -quaternions, quaternions)
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
def standardize_dualquaternion(qr: torch.Tensor, qd: torch.Tensor) -> torch.Tensor:
|
| 131 |
+
sign = torch.where(qr[..., 0:1] < 0, -1, 1)
|
| 132 |
+
return qr * sign, qd * sign
|
| 133 |
+
|
| 134 |
+
def normalize_dualquaternion(qr: torch.Tensor, qd: torch.Tensor) -> torch.Tensor:
|
| 135 |
+
qr_mag_inv = qr.norm(p=2, dim=-1, keepdim=True).reciprocal()
|
| 136 |
+
qr, qd = qr * qr_mag_inv, qd * qr_mag_inv
|
| 137 |
+
return (qr, qd)
|
| 138 |
+
# return standardize_dualquaternion(qr, qd)
|
| 139 |
+
|
| 140 |
+
@torch.jit.script
|
| 141 |
+
def _quaternion_mul(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor:
|
| 142 |
+
"""
|
| 143 |
+
Multiply two quaternions.
|
| 144 |
+
Usual torch rules for broadcasting apply.
|
| 145 |
+
|
| 146 |
+
Args:
|
| 147 |
+
a: Quaternions as tensor of shape (..., 4), real part first.
|
| 148 |
+
b: Quaternions as tensor of shape (..., 4), real part first.
|
| 149 |
+
|
| 150 |
+
Returns:
|
| 151 |
+
out: The product of a and b, a tensor of quaternions shape (..., 4).
|
| 152 |
+
"""
|
| 153 |
+
aw, ax, ay, az = torch.unbind(a, -1)
|
| 154 |
+
bw, bx, by, bz = torch.unbind(b, -1)
|
| 155 |
+
ow = aw * bw - ax * bx - ay * by - az * bz
|
| 156 |
+
ox = aw * bx + ax * bw + ay * bz - az * by
|
| 157 |
+
oy = aw * by - ax * bz + ay * bw + az * bx
|
| 158 |
+
oz = aw * bz + ax * by - ay * bx + az * bw
|
| 159 |
+
return torch.stack((ow, ox, oy, oz), -1)
|
| 160 |
+
|
| 161 |
+
|
| 162 |
+
def quaternion_mul(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor:
|
| 163 |
+
return _quaternion_mul(a, b)
|
| 164 |
+
# return standardize_quaternion(_quaternion_mul(a, b))
|
| 165 |
+
# if a.is_cuda:
|
| 166 |
+
# ouput_shape = list(a.shape[:-1]) + [4]
|
| 167 |
+
# return _quaternion_mul_cuda(
|
| 168 |
+
# a.view(-1, a.shape[-1]), b.view(-1, b.shape[-1])
|
| 169 |
+
# ).view(ouput_shape)
|
| 170 |
+
# else:
|
| 171 |
+
# return _quaternion_mul(a, b)
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
@torch.jit.script
|
| 175 |
+
def quaternion_to_matrix(quaternions: torch.Tensor) -> torch.Tensor:
|
| 176 |
+
"""
|
| 177 |
+
Convert rotations given as quaternions to rotation matrices.
|
| 178 |
+
|
| 179 |
+
Args:
|
| 180 |
+
quaternions: quaternions with real part first,
|
| 181 |
+
as tensor of shape (..., 4).
|
| 182 |
+
|
| 183 |
+
Returns:
|
| 184 |
+
o: Rotation matrices as tensor of shape (..., 3, 3).
|
| 185 |
+
"""
|
| 186 |
+
r, i, j, k = torch.unbind(quaternions, -1)
|
| 187 |
+
q2 = quaternions**2
|
| 188 |
+
rr, ii, jj, kk = torch.unbind(q2, -1)
|
| 189 |
+
two_s = 2.0 / q2.sum(-1)
|
| 190 |
+
ij = i * j
|
| 191 |
+
ik = i * k
|
| 192 |
+
ir = i * r
|
| 193 |
+
jk = j * k
|
| 194 |
+
jr = j * r
|
| 195 |
+
kr = k * r
|
| 196 |
+
|
| 197 |
+
o1 = 1 - two_s * (jj + kk)
|
| 198 |
+
o2 = two_s * (ij - kr)
|
| 199 |
+
o3 = two_s * (ik + jr)
|
| 200 |
+
o4 = two_s * (ij + kr)
|
| 201 |
+
|
| 202 |
+
o5 = 1 - two_s * (ii + kk)
|
| 203 |
+
o6 = two_s * (jk - ir)
|
| 204 |
+
o7 = two_s * (ik - jr)
|
| 205 |
+
o8 = two_s * (jk + ir)
|
| 206 |
+
o9 = 1 - two_s * (ii + jj)
|
| 207 |
+
|
| 208 |
+
o = torch.stack((o1, o2, o3, o4, o5, o6, o7, o8, o9), -1)
|
| 209 |
+
|
| 210 |
+
return o.view(quaternions.shape[:-1] + (3, 3))
|
| 211 |
+
|
| 212 |
+
|
| 213 |
+
def quaternion_apply(quaternion: torch.Tensor, point: torch.Tensor) -> torch.Tensor:
|
| 214 |
+
"""
|
| 215 |
+
Apply the rotation given by a quaternion to a 3D point.
|
| 216 |
+
Usual torch rules for broadcasting apply.
|
| 217 |
+
|
| 218 |
+
Args:
|
| 219 |
+
quaternion: Tensor of quaternions, real part first, of shape (..., 4).
|
| 220 |
+
point: Tensor of 3D points of shape (..., 3).
|
| 221 |
+
|
| 222 |
+
Returns:
|
| 223 |
+
out: Tensor of rotated points of shape (..., 3).
|
| 224 |
+
"""
|
| 225 |
+
point = torch.cat((torch.zeros_like(point[..., :1]), point), -1)
|
| 226 |
+
out = quaternion_mul(
|
| 227 |
+
quaternion_mul(quaternion, point),
|
| 228 |
+
quaternion_conjugate(quaternion)
|
| 229 |
+
# quaternion
|
| 230 |
+
)
|
| 231 |
+
return out[..., 1:]
|
| 232 |
+
|
| 233 |
+
|
| 234 |
+
def quaternion_translation_apply(
|
| 235 |
+
q: torch.Tensor, t: torch.Tensor, point: torch.Tensor
|
| 236 |
+
) -> torch.Tensor:
|
| 237 |
+
p = quaternion_apply(q, point)
|
| 238 |
+
return p + t
|
| 239 |
+
|
| 240 |
+
|
| 241 |
+
def quaternion_translation_inverse(
|
| 242 |
+
q: torch.Tensor, t: torch.Tensor
|
| 243 |
+
) -> Tuple[torch.Tensor, torch.Tensor]:
|
| 244 |
+
q_inv = quaternion_conjugate(q)
|
| 245 |
+
t_inv = quaternion_apply(q_inv, -t)
|
| 246 |
+
return q_inv, t_inv
|
| 247 |
+
|
| 248 |
+
|
| 249 |
+
def quaternion_translation_to_dual_quaternion(
|
| 250 |
+
q: torch.Tensor, t: torch.Tensor
|
| 251 |
+
) -> DualQuaternions:
|
| 252 |
+
"""
|
| 253 |
+
https://cs.gmu.edu/~jmlien/teaching/cs451/uploads/Main/dual-quaternion.pdf
|
| 254 |
+
"""
|
| 255 |
+
q_d = 0.5 * quaternion_mul(t, q)
|
| 256 |
+
return (q, q_d)
|
| 257 |
+
|
| 258 |
+
|
| 259 |
+
def dual_quaternion_to_se3(dq):
|
| 260 |
+
q_r, t = dual_quaternion_to_quaternion_translation(dq)
|
| 261 |
+
return quaternion_translation_to_se3(q_r, t)
|
| 262 |
+
|
| 263 |
+
|
| 264 |
+
def quaternion_translation_to_se3(q: torch.Tensor, t: torch.Tensor):
|
| 265 |
+
rmat = quaternion_to_matrix(q)
|
| 266 |
+
rt4x4 = torch.cat((rmat, t[..., None]), -1) # (..., 3, 4)
|
| 267 |
+
rt4x4 = torch.cat((rt4x4, torch.zeros_like(rt4x4[..., :1, :])), -2) # (..., 4, 4)
|
| 268 |
+
rt4x4[..., 3, 3] = 1
|
| 269 |
+
return rt4x4
|
| 270 |
+
|
| 271 |
+
|
| 272 |
+
def se3_to_quaternion_translation(se3, tuple=True):
|
| 273 |
+
q = matrix_to_quaternion(se3[..., :3, :3])
|
| 274 |
+
t = se3[..., :3, 3]
|
| 275 |
+
if tuple:
|
| 276 |
+
return q, t
|
| 277 |
+
else:
|
| 278 |
+
return torch.cat((q, t), -1)
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
def dual_quaternion_to_quaternion_translation(
|
| 282 |
+
dq: DualQuaternions,
|
| 283 |
+
) -> Tuple[torch.Tensor, torch.Tensor]:
|
| 284 |
+
q_r = dq[0]
|
| 285 |
+
q_d = dq[1]
|
| 286 |
+
t = 2 * quaternion_mul(q_d, quaternion_conjugate(q_r))[..., 1:]
|
| 287 |
+
|
| 288 |
+
return q_r, t
|
| 289 |
+
|
| 290 |
+
|
| 291 |
+
def dual_quaternion_apply(dq: DualQuaternions, point: torch.Tensor) -> torch.Tensor:
|
| 292 |
+
q, t = dual_quaternion_to_quaternion_translation(dq)
|
| 293 |
+
return quaternion_translation_apply(q, t, point)
|
| 294 |
+
|
| 295 |
+
def dual_quaternion_inverse_apply(dq: DualQuaternions, point: torch.Tensor) -> torch.Tensor:
|
| 296 |
+
q, t = dual_quaternion_to_quaternion_translation(dq)
|
| 297 |
+
q, t = quaternion_translation_inverse(q, t)
|
| 298 |
+
return quaternion_translation_apply(q, t, point)
|
| 299 |
+
|
| 300 |
+
def quaternion_translation_mul(
|
| 301 |
+
qt1: Tuple[torch.Tensor, torch.Tensor], qt2: Tuple[torch.Tensor, torch.Tensor]
|
| 302 |
+
) -> Tuple[torch.Tensor, torch.Tensor]:
|
| 303 |
+
q1, t1 = qt1
|
| 304 |
+
q2, t2 = qt2
|
| 305 |
+
|
| 306 |
+
# Multiply the rotations
|
| 307 |
+
q = quaternion_mul(q1, q2)
|
| 308 |
+
|
| 309 |
+
# Compute the new translation
|
| 310 |
+
t = quaternion_apply(q1, t2) + t1
|
| 311 |
+
|
| 312 |
+
return (q, t)
|
| 313 |
+
|
| 314 |
+
|
| 315 |
+
def dual_quaternion_mul(dq1: DualQuaternions, dq2: DualQuaternions) -> DualQuaternions:
|
| 316 |
+
q_r1 = dq1[0]
|
| 317 |
+
q_d1 = dq1[1]
|
| 318 |
+
q_r2 = dq2[0]
|
| 319 |
+
q_d2 = dq2[1]
|
| 320 |
+
r_r = quaternion_mul(q_r1, q_r2)
|
| 321 |
+
r_d = quaternion_mul(q_r1, q_d2) + quaternion_mul(q_d1, q_r2)
|
| 322 |
+
return (r_r, r_d)
|
| 323 |
+
|
| 324 |
+
|
| 325 |
+
def dual_quaternion_q_conjugate(dq: DualQuaternions) -> DualQuaternions:
|
| 326 |
+
r = quaternion_conjugate(dq[0])
|
| 327 |
+
d = quaternion_conjugate(dq[1])
|
| 328 |
+
return (r, d)
|
| 329 |
+
|
| 330 |
+
|
| 331 |
+
@torch.jit.script
|
| 332 |
+
def dual_quaternion_d_conjugate(dq: DualQuaternions) -> DualQuaternions:
|
| 333 |
+
return (dq[0], -dq[1])
|
| 334 |
+
|
| 335 |
+
|
| 336 |
+
def dual_quaternion_3rd_conjugate(dq: DualQuaternions) -> DualQuaternions:
|
| 337 |
+
return dual_quaternion_d_conjugate(dual_quaternion_q_conjugate(dq))
|
| 338 |
+
|
| 339 |
+
|
| 340 |
+
def dual_quaternion_norm(dq: DualQuaternions) -> DualQuaternions:
|
| 341 |
+
dq_qd = dual_quaternion_q_conjugate(dq)
|
| 342 |
+
return dual_quaternion_mul(dq, dq_qd)
|
| 343 |
+
|
| 344 |
+
|
| 345 |
+
def dual_quaternion_inverse(dq: DualQuaternions) -> DualQuaternions:
|
| 346 |
+
return dual_quaternion_q_conjugate(dq)
|
| 347 |
+
|
| 348 |
+
|
| 349 |
+
|
| 350 |
+
def quaternion_to_axis_angle(quaternions: torch.Tensor) -> torch.Tensor:
|
| 351 |
+
"""
|
| 352 |
+
Convert rotations given as quaternions to axis/angle.
|
| 353 |
+
|
| 354 |
+
Args:
|
| 355 |
+
quaternions: quaternions with real part first,
|
| 356 |
+
as tensor of shape (..., 4).
|
| 357 |
+
|
| 358 |
+
Returns:
|
| 359 |
+
Rotations given as a vector in axis angle form, as a tensor
|
| 360 |
+
of shape (..., 3), where the magnitude is the angle
|
| 361 |
+
turned anticlockwise in radians around the vector's
|
| 362 |
+
direction.
|
| 363 |
+
"""
|
| 364 |
+
norms = torch.norm(quaternions[..., 1:], p=2, dim=-1, keepdim=True)
|
| 365 |
+
half_angles = torch.atan2(norms, quaternions[..., :1])
|
| 366 |
+
angles = 2 * half_angles
|
| 367 |
+
eps = 1e-6
|
| 368 |
+
small_angles = angles.abs() < eps
|
| 369 |
+
sin_half_angles_over_angles = torch.empty_like(angles)
|
| 370 |
+
sin_half_angles_over_angles[~small_angles] = (
|
| 371 |
+
torch.sin(half_angles[~small_angles]) / angles[~small_angles]
|
| 372 |
+
)
|
| 373 |
+
# for x small, sin(x/2) is about x/2 - (x/2)^3/6
|
| 374 |
+
# so sin(x/2)/x is about 1/2 - (x*x)/48
|
| 375 |
+
sin_half_angles_over_angles[small_angles] = (
|
| 376 |
+
0.5 - (angles[small_angles] * angles[small_angles]) / 48
|
| 377 |
+
)
|
| 378 |
+
axis = quaternions[..., 1:] / sin_half_angles_over_angles
|
| 379 |
+
axis = F.normalize(axis, p=2., dim=0)
|
| 380 |
+
return axis, angles
|
| 381 |
+
|
| 382 |
+
def quaternion_multiply(q1: torch.Tensor, q2: torch.Tensor) -> torch.Tensor:
|
| 383 |
+
"""Multiply two quaternions (tensor version)."""
|
| 384 |
+
w1, x1, y1, z1 = q1[..., 0], q1[..., 1], q1[..., 2], q1[..., 3]
|
| 385 |
+
w2, x2, y2, z2 = q2[..., 0], q2[..., 1], q2[..., 2], q2[..., 3]
|
| 386 |
+
|
| 387 |
+
w = w1*w2 - x1*x2 - y1*y2 - z1*z2
|
| 388 |
+
x = w1*x2 + x1*w2 + y1*z2 - z1*y2
|
| 389 |
+
y = w1*y2 - x1*z2 + y1*w2 + z1*x2
|
| 390 |
+
z = w1*z2 + x1*y2 - y1*x2 + z1*w2
|
| 391 |
+
|
| 392 |
+
return torch.stack([w, x, y, z], dim=-1)
|
DragMesh/dragmesh/inference/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (153 Bytes). View file
|
|
|
DragMesh/dragmesh/inference/__pycache__/inference_animation.cpython-310.pyc
ADDED
|
Binary file (23.5 kB). View file
|
|
|
DragMesh/dragmesh/inference/__pycache__/inference_pipeline.cpython-310.pyc
ADDED
|
Binary file (26.7 kB). View file
|
|
|
DragMesh/dragmesh/models/__pycache__/model_v2.cpython-310.pyc
ADDED
|
Binary file (12.7 kB). View file
|
|
|
integration/__pycache__/articulation_bridge.cpython-310.pyc
ADDED
|
Binary file (21.7 kB). View file
|
|
|
integration/dragmesh_drawer_traj/cabinet_drawer_trajectory.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"joint": "left_drawer",
|
| 3 |
+
"joint_type": "prismatic",
|
| 4 |
+
"axis": [
|
| 5 |
+
0.0,
|
| 6 |
+
-1.0,
|
| 7 |
+
0.0
|
| 8 |
+
],
|
| 9 |
+
"origin": [
|
| 10 |
+
0.15626400709152222,
|
| 11 |
+
0.13749122619628906,
|
| 12 |
+
0.7557077407836914
|
| 13 |
+
],
|
| 14 |
+
"kpp_axis": [
|
| 15 |
+
-0.5555909276008606,
|
| 16 |
+
0.08047742396593094,
|
| 17 |
+
0.8275519013404846
|
| 18 |
+
],
|
| 19 |
+
"translations": [
|
| 20 |
+
0.0,
|
| 21 |
+
0.012119039949784024,
|
| 22 |
+
0.026347117949734468,
|
| 23 |
+
0.046334051884338076,
|
| 24 |
+
0.04919756848947365,
|
| 25 |
+
0.06532822914343765,
|
| 26 |
+
0.07539279962338018,
|
| 27 |
+
0.10340644383326314,
|
| 28 |
+
0.14058448755750474,
|
| 29 |
+
0.16000000000000003,
|
| 30 |
+
0.15696579862401616,
|
| 31 |
+
0.14373547411977505,
|
| 32 |
+
0.12074260181537372,
|
| 33 |
+
0.0971595265822576,
|
| 34 |
+
0.08317292301593202,
|
| 35 |
+
0.09252792850830466
|
| 36 |
+
],
|
| 37 |
+
"num_frames": 16
|
| 38 |
+
}
|
integration/dragmesh_fridge_traj/fridge_door_trajectory.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"joint": "up_door",
|
| 3 |
+
"joint_type": "revolute",
|
| 4 |
+
"axis": [
|
| 5 |
+
0.0,
|
| 6 |
+
0.0,
|
| 7 |
+
1.0
|
| 8 |
+
],
|
| 9 |
+
"origin": [
|
| 10 |
+
-0.30260854959487915,
|
| 11 |
+
0.24004773795604706,
|
| 12 |
+
1.2866991758346558
|
| 13 |
+
],
|
| 14 |
+
"kpp_axis": [
|
| 15 |
+
0.09809041023254395,
|
| 16 |
+
0.9939870834350586,
|
| 17 |
+
0.048661842942237854
|
| 18 |
+
],
|
| 19 |
+
"kpp_origin": [
|
| 20 |
+
-0.04172678872856497,
|
| 21 |
+
0.7573655213188156,
|
| 22 |
+
-0.05471847748949379
|
| 23 |
+
],
|
| 24 |
+
"angles": [
|
| 25 |
+
0.0,
|
| 26 |
+
-0.08112795739966748,
|
| 27 |
+
0.069155935816808,
|
| 28 |
+
0.4309612712946887,
|
| 29 |
+
0.8032844595472189,
|
| 30 |
+
1.0875353813969715,
|
| 31 |
+
1.280574686270902,
|
| 32 |
+
1.3842653162899838,
|
| 33 |
+
1.443116027295508,
|
| 34 |
+
1.498803893338231,
|
| 35 |
+
1.5505478946391522,
|
| 36 |
+
1.5811485472045,
|
| 37 |
+
1.6109437311220884,
|
| 38 |
+
1.6429712449057488,
|
| 39 |
+
1.6684454550264136,
|
| 40 |
+
1.6752
|
| 41 |
+
],
|
| 42 |
+
"num_frames": 16
|
| 43 |
+
}
|
integration/dragmesh_input/cabinet_joints.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"left_door": {
|
| 3 |
+
"type": "revolute",
|
| 4 |
+
"axis": [
|
| 5 |
+
0,
|
| 6 |
+
0,
|
| 7 |
+
1
|
| 8 |
+
],
|
| 9 |
+
"origin": [
|
| 10 |
+
0.304599,
|
| 11 |
+
0.12931523,
|
| 12 |
+
0.63667975
|
| 13 |
+
],
|
| 14 |
+
"limits": [
|
| 15 |
+
0,
|
| 16 |
+
1.5708
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"right_door": {
|
| 20 |
+
"type": "revolute",
|
| 21 |
+
"axis": [
|
| 22 |
+
0,
|
| 23 |
+
0,
|
| 24 |
+
1
|
| 25 |
+
],
|
| 26 |
+
"origin": [
|
| 27 |
+
-0.30446,
|
| 28 |
+
0.12904523,
|
| 29 |
+
0.63537375
|
| 30 |
+
],
|
| 31 |
+
"limits": [
|
| 32 |
+
0,
|
| 33 |
+
1.5708
|
| 34 |
+
]
|
| 35 |
+
},
|
| 36 |
+
"left_drawer": {
|
| 37 |
+
"type": "prismatic",
|
| 38 |
+
"axis": [
|
| 39 |
+
0,
|
| 40 |
+
-1,
|
| 41 |
+
0
|
| 42 |
+
],
|
| 43 |
+
"origin": [
|
| 44 |
+
0.156264,
|
| 45 |
+
0.13749123,
|
| 46 |
+
0.75570775
|
| 47 |
+
],
|
| 48 |
+
"limits": [
|
| 49 |
+
0,
|
| 50 |
+
0.2
|
| 51 |
+
]
|
| 52 |
+
},
|
| 53 |
+
"right_drawer": {
|
| 54 |
+
"type": "prismatic",
|
| 55 |
+
"axis": [
|
| 56 |
+
0,
|
| 57 |
+
-1,
|
| 58 |
+
0
|
| 59 |
+
],
|
| 60 |
+
"origin": [
|
| 61 |
+
-0.156684,
|
| 62 |
+
0.13593623,
|
| 63 |
+
0.75595575
|
| 64 |
+
],
|
| 65 |
+
"limits": [
|
| 66 |
+
0,
|
| 67 |
+
0.2
|
| 68 |
+
]
|
| 69 |
+
}
|
| 70 |
+
}
|
integration/dragmesh_input/cabinet_mesh.obj
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
integration/dragmesh_input/fridge_joints.json
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"up_door": {
|
| 3 |
+
"type": "revolute",
|
| 4 |
+
"axis": [
|
| 5 |
+
0,
|
| 6 |
+
0,
|
| 7 |
+
1
|
| 8 |
+
],
|
| 9 |
+
"origin": [
|
| 10 |
+
-0.30260856,
|
| 11 |
+
0.24004774,
|
| 12 |
+
1.2866992
|
| 13 |
+
],
|
| 14 |
+
"limits": [
|
| 15 |
+
0,
|
| 16 |
+
2.094
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"down_door": {
|
| 20 |
+
"type": "revolute",
|
| 21 |
+
"axis": [
|
| 22 |
+
0,
|
| 23 |
+
0,
|
| 24 |
+
1
|
| 25 |
+
],
|
| 26 |
+
"origin": [
|
| 27 |
+
-0.30260156,
|
| 28 |
+
0.24149374,
|
| 29 |
+
0.37446323
|
| 30 |
+
],
|
| 31 |
+
"limits": [
|
| 32 |
+
0,
|
| 33 |
+
2.094
|
| 34 |
+
]
|
| 35 |
+
},
|
| 36 |
+
"drawer_1": {
|
| 37 |
+
"type": "prismatic",
|
| 38 |
+
"axis": [
|
| 39 |
+
0,
|
| 40 |
+
-1,
|
| 41 |
+
0
|
| 42 |
+
],
|
| 43 |
+
"origin": [
|
| 44 |
+
0.0075564402,
|
| 45 |
+
0.11104474,
|
| 46 |
+
0.77475523
|
| 47 |
+
],
|
| 48 |
+
"limits": [
|
| 49 |
+
0,
|
| 50 |
+
0.3
|
| 51 |
+
]
|
| 52 |
+
},
|
| 53 |
+
"drawer_2": {
|
| 54 |
+
"type": "prismatic",
|
| 55 |
+
"axis": [
|
| 56 |
+
0,
|
| 57 |
+
-1,
|
| 58 |
+
0
|
| 59 |
+
],
|
| 60 |
+
"origin": [
|
| 61 |
+
-0.02553156,
|
| 62 |
+
0.21032174,
|
| 63 |
+
0.51109223
|
| 64 |
+
],
|
| 65 |
+
"limits": [
|
| 66 |
+
0,
|
| 67 |
+
0.3
|
| 68 |
+
]
|
| 69 |
+
},
|
| 70 |
+
"drawer_3": {
|
| 71 |
+
"type": "prismatic",
|
| 72 |
+
"axis": [
|
| 73 |
+
0,
|
| 74 |
+
-1,
|
| 75 |
+
0
|
| 76 |
+
],
|
| 77 |
+
"origin": [
|
| 78 |
+
-0.06386956,
|
| 79 |
+
0.21289974,
|
| 80 |
+
0.23510423
|
| 81 |
+
],
|
| 82 |
+
"limits": [
|
| 83 |
+
0,
|
| 84 |
+
0.3
|
| 85 |
+
]
|
| 86 |
+
}
|
| 87 |
+
}
|
integration/dragmesh_input/fridge_mesh.obj
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
integration/room_scene_output/scene_meta.json
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"objects": [
|
| 3 |
+
"Cabinet",
|
| 4 |
+
"Drawer",
|
| 5 |
+
"Laptop",
|
| 6 |
+
"Microwave",
|
| 7 |
+
"Fridge",
|
| 8 |
+
"Oven",
|
| 9 |
+
"Washer",
|
| 10 |
+
"Window"
|
| 11 |
+
],
|
| 12 |
+
"total_frames": 79,
|
| 13 |
+
"joints": [
|
| 14 |
+
{
|
| 15 |
+
"name": "Cabinet",
|
| 16 |
+
"type": "revolute",
|
| 17 |
+
"axis": [
|
| 18 |
+
0,
|
| 19 |
+
0,
|
| 20 |
+
1
|
| 21 |
+
],
|
| 22 |
+
"origin": [
|
| 23 |
+
-0.39,
|
| 24 |
+
0,
|
| 25 |
+
0.23
|
| 26 |
+
]
|
| 27 |
+
},
|
| 28 |
+
{
|
| 29 |
+
"name": "Drawer",
|
| 30 |
+
"type": "prismatic",
|
| 31 |
+
"axis": [
|
| 32 |
+
0,
|
| 33 |
+
0,
|
| 34 |
+
1
|
| 35 |
+
],
|
| 36 |
+
"origin": [
|
| 37 |
+
0,
|
| 38 |
+
0,
|
| 39 |
+
0.05
|
| 40 |
+
]
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"name": "Laptop",
|
| 44 |
+
"type": "revolute",
|
| 45 |
+
"axis": [
|
| 46 |
+
1,
|
| 47 |
+
0,
|
| 48 |
+
0
|
| 49 |
+
],
|
| 50 |
+
"origin": [
|
| 51 |
+
0,
|
| 52 |
+
0.09,
|
| 53 |
+
0.012
|
| 54 |
+
]
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"name": "Microwave",
|
| 58 |
+
"type": "revolute",
|
| 59 |
+
"axis": [
|
| 60 |
+
1,
|
| 61 |
+
0,
|
| 62 |
+
0
|
| 63 |
+
],
|
| 64 |
+
"origin": [
|
| 65 |
+
0,
|
| 66 |
+
0.15,
|
| 67 |
+
-0.14
|
| 68 |
+
]
|
| 69 |
+
},
|
| 70 |
+
{
|
| 71 |
+
"name": "Fridge",
|
| 72 |
+
"type": "revolute",
|
| 73 |
+
"axis": [
|
| 74 |
+
0,
|
| 75 |
+
0,
|
| 76 |
+
1
|
| 77 |
+
],
|
| 78 |
+
"origin": [
|
| 79 |
+
0.37,
|
| 80 |
+
0.37,
|
| 81 |
+
0
|
| 82 |
+
]
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"name": "Oven",
|
| 86 |
+
"type": "revolute",
|
| 87 |
+
"axis": [
|
| 88 |
+
1,
|
| 89 |
+
0,
|
| 90 |
+
0
|
| 91 |
+
],
|
| 92 |
+
"origin": [
|
| 93 |
+
0,
|
| 94 |
+
0.25,
|
| 95 |
+
-0.225
|
| 96 |
+
]
|
| 97 |
+
},
|
| 98 |
+
{
|
| 99 |
+
"name": "Washer",
|
| 100 |
+
"type": "revolute",
|
| 101 |
+
"axis": [
|
| 102 |
+
0,
|
| 103 |
+
0,
|
| 104 |
+
1
|
| 105 |
+
],
|
| 106 |
+
"origin": [
|
| 107 |
+
0.28,
|
| 108 |
+
0.27,
|
| 109 |
+
0
|
| 110 |
+
]
|
| 111 |
+
},
|
| 112 |
+
{
|
| 113 |
+
"name": "Window",
|
| 114 |
+
"type": "revolute",
|
| 115 |
+
"axis": [
|
| 116 |
+
0,
|
| 117 |
+
0,
|
| 118 |
+
1
|
| 119 |
+
],
|
| 120 |
+
"origin": [
|
| 121 |
+
0.57,
|
| 122 |
+
0,
|
| 123 |
+
0
|
| 124 |
+
]
|
| 125 |
+
}
|
| 126 |
+
]
|
| 127 |
+
}
|
integration/scenesmith_hybrid_output/scene_plan.json
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"room_description": "A modern kitchen with cabinets along the back wall, a refrigerator in the corner, a microwave and oven on the counter, a laptop on a small desk, and a window on the back wall. Include a washing machine near the left wall.",
|
| 3 |
+
"furniture_surfaces": [
|
| 4 |
+
{
|
| 5 |
+
"type": "counter",
|
| 6 |
+
"position": [
|
| 7 |
+
0.0,
|
| 8 |
+
-1.5,
|
| 9 |
+
0.8
|
| 10 |
+
],
|
| 11 |
+
"size": [
|
| 12 |
+
2.4,
|
| 13 |
+
0.6,
|
| 14 |
+
0.05
|
| 15 |
+
],
|
| 16 |
+
"purpose": "Main kitchen counter for food prep and appliance placement"
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"type": "desk",
|
| 20 |
+
"position": [
|
| 21 |
+
1.8,
|
| 22 |
+
1.5,
|
| 23 |
+
0.7
|
| 24 |
+
],
|
| 25 |
+
"size": [
|
| 26 |
+
1.0,
|
| 27 |
+
0.5,
|
| 28 |
+
0.05
|
| 29 |
+
],
|
| 30 |
+
"purpose": "Small desk for laptop"
|
| 31 |
+
}
|
| 32 |
+
],
|
| 33 |
+
"articulated_objects": [
|
| 34 |
+
{
|
| 35 |
+
"name": "cabinet",
|
| 36 |
+
"position": [
|
| 37 |
+
-1.5,
|
| 38 |
+
-1.75,
|
| 39 |
+
0.45
|
| 40 |
+
],
|
| 41 |
+
"rotation_z_deg": 0,
|
| 42 |
+
"joint_type": "revolute",
|
| 43 |
+
"joint_axis": [
|
| 44 |
+
0,
|
| 45 |
+
0,
|
| 46 |
+
1
|
| 47 |
+
],
|
| 48 |
+
"on_surface": null,
|
| 49 |
+
"reasoning": "Placed against back wall to the left of the counter for storage."
|
| 50 |
+
},
|
| 51 |
+
{
|
| 52 |
+
"name": "drawer_chest",
|
| 53 |
+
"position": [
|
| 54 |
+
1.5,
|
| 55 |
+
-1.75,
|
| 56 |
+
0.35
|
| 57 |
+
],
|
| 58 |
+
"rotation_z_deg": 0,
|
| 59 |
+
"joint_type": "prismatic",
|
| 60 |
+
"joint_axis": [
|
| 61 |
+
0,
|
| 62 |
+
0,
|
| 63 |
+
1
|
| 64 |
+
],
|
| 65 |
+
"on_surface": null,
|
| 66 |
+
"reasoning": "Placed against back wall to the right of the counter for additional storage, drawers face forward."
|
| 67 |
+
},
|
| 68 |
+
{
|
| 69 |
+
"name": "fridge",
|
| 70 |
+
"position": [
|
| 71 |
+
-2.1,
|
| 72 |
+
-1.5,
|
| 73 |
+
0.8
|
| 74 |
+
],
|
| 75 |
+
"rotation_z_deg": 0,
|
| 76 |
+
"joint_type": "revolute",
|
| 77 |
+
"joint_axis": [
|
| 78 |
+
0,
|
| 79 |
+
0,
|
| 80 |
+
1
|
| 81 |
+
],
|
| 82 |
+
"on_surface": null,
|
| 83 |
+
"reasoning": "Placed in the left back corner, door opens right to avoid blocking walkway."
|
| 84 |
+
},
|
| 85 |
+
{
|
| 86 |
+
"name": "microwave",
|
| 87 |
+
"position": [
|
| 88 |
+
-0.6,
|
| 89 |
+
-1.5,
|
| 90 |
+
0.8
|
| 91 |
+
],
|
| 92 |
+
"rotation_z_deg": 0,
|
| 93 |
+
"joint_type": "revolute",
|
| 94 |
+
"joint_axis": [
|
| 95 |
+
1,
|
| 96 |
+
0,
|
| 97 |
+
0
|
| 98 |
+
],
|
| 99 |
+
"on_surface": "counter",
|
| 100 |
+
"reasoning": "Sits on the counter, door opens downward for easy access."
|
| 101 |
+
},
|
| 102 |
+
{
|
| 103 |
+
"name": "oven",
|
| 104 |
+
"position": [
|
| 105 |
+
0.6,
|
| 106 |
+
-1.5,
|
| 107 |
+
0.8
|
| 108 |
+
],
|
| 109 |
+
"rotation_z_deg": 0,
|
| 110 |
+
"joint_type": "revolute",
|
| 111 |
+
"joint_axis": [
|
| 112 |
+
1,
|
| 113 |
+
0,
|
| 114 |
+
0
|
| 115 |
+
],
|
| 116 |
+
"on_surface": "counter",
|
| 117 |
+
"reasoning": "Sits on the counter, door opens downward, placed away from microwave."
|
| 118 |
+
},
|
| 119 |
+
{
|
| 120 |
+
"name": "laptop",
|
| 121 |
+
"position": [
|
| 122 |
+
1.8,
|
| 123 |
+
1.5,
|
| 124 |
+
0.7
|
| 125 |
+
],
|
| 126 |
+
"rotation_z_deg": 0,
|
| 127 |
+
"joint_type": "revolute",
|
| 128 |
+
"joint_axis": [
|
| 129 |
+
1,
|
| 130 |
+
0,
|
| 131 |
+
0
|
| 132 |
+
],
|
| 133 |
+
"on_surface": "desk",
|
| 134 |
+
"reasoning": "Placed on the desk, screen tilts open for use."
|
| 135 |
+
},
|
| 136 |
+
{
|
| 137 |
+
"name": "washer",
|
| 138 |
+
"position": [
|
| 139 |
+
-2.1,
|
| 140 |
+
1.5,
|
| 141 |
+
0.35
|
| 142 |
+
],
|
| 143 |
+
"rotation_z_deg": 90,
|
| 144 |
+
"joint_type": "revolute",
|
| 145 |
+
"joint_axis": [
|
| 146 |
+
0,
|
| 147 |
+
0,
|
| 148 |
+
1
|
| 149 |
+
],
|
| 150 |
+
"on_surface": null,
|
| 151 |
+
"reasoning": "Placed against left wall near front, door opens forward (rotated 90 degrees) to not block path."
|
| 152 |
+
},
|
| 153 |
+
{
|
| 154 |
+
"name": "window",
|
| 155 |
+
"position": [
|
| 156 |
+
0.0,
|
| 157 |
+
-1.97,
|
| 158 |
+
1.5
|
| 159 |
+
],
|
| 160 |
+
"rotation_z_deg": 0,
|
| 161 |
+
"joint_type": "revolute",
|
| 162 |
+
"joint_axis": [
|
| 163 |
+
0,
|
| 164 |
+
0,
|
| 165 |
+
1
|
| 166 |
+
],
|
| 167 |
+
"on_surface": null,
|
| 168 |
+
"reasoning": "Mounted on back wall above counter, opens sideways."
|
| 169 |
+
}
|
| 170 |
+
]
|
| 171 |
+
}
|
integration/test_data/cabinet.obj
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# https://github.com/mikedh/trimesh
|
| 2 |
+
v -0.50000000 -0.40000000 0.00000000
|
| 3 |
+
v -0.50000000 -0.40000000 0.60000000
|
| 4 |
+
v -0.50000000 0.40000000 0.00000000
|
| 5 |
+
v -0.50000000 0.40000000 0.60000000
|
| 6 |
+
v 0.50000000 -0.40000000 0.00000000
|
| 7 |
+
v 0.50000000 -0.40000000 0.60000000
|
| 8 |
+
v 0.50000000 0.40000000 0.00000000
|
| 9 |
+
v 0.50000000 0.40000000 0.60000000
|
| 10 |
+
v -0.42500000 -0.37500000 0.60000000
|
| 11 |
+
v -0.42500000 -0.37500000 0.64000000
|
| 12 |
+
v -0.42500000 0.37500000 0.60000000
|
| 13 |
+
v -0.42500000 0.37500000 0.64000000
|
| 14 |
+
v 0.42500000 -0.37500000 0.60000000
|
| 15 |
+
v 0.42500000 -0.37500000 0.64000000
|
| 16 |
+
v 0.42500000 0.37500000 0.60000000
|
| 17 |
+
v 0.42500000 0.37500000 0.64000000
|
| 18 |
+
v 0.30000000 0.06000000 0.68000000
|
| 19 |
+
v 0.32000000 0.06000000 0.68000000
|
| 20 |
+
v 0.32000000 -0.06000000 0.68000000
|
| 21 |
+
v 0.30000000 -0.06000000 0.68000000
|
| 22 |
+
v 0.31847759 0.06000000 0.68765367
|
| 23 |
+
v 0.31847759 -0.06000000 0.68765367
|
| 24 |
+
v 0.31414214 0.06000000 0.69414214
|
| 25 |
+
v 0.31414214 -0.06000000 0.69414214
|
| 26 |
+
v 0.30765367 0.06000000 0.69847759
|
| 27 |
+
v 0.30765367 -0.06000000 0.69847759
|
| 28 |
+
v 0.30000000 0.06000000 0.70000000
|
| 29 |
+
v 0.30000000 -0.06000000 0.70000000
|
| 30 |
+
v 0.29234633 0.06000000 0.69847759
|
| 31 |
+
v 0.29234633 -0.06000000 0.69847759
|
| 32 |
+
v 0.28585786 0.06000000 0.69414214
|
| 33 |
+
v 0.28585786 -0.06000000 0.69414214
|
| 34 |
+
v 0.28152241 0.06000000 0.68765367
|
| 35 |
+
v 0.28152241 -0.06000000 0.68765367
|
| 36 |
+
v 0.28000000 0.06000000 0.68000000
|
| 37 |
+
v 0.28000000 -0.06000000 0.68000000
|
| 38 |
+
v 0.28152241 0.06000000 0.67234633
|
| 39 |
+
v 0.28152241 -0.06000000 0.67234633
|
| 40 |
+
v 0.28585786 0.06000000 0.66585786
|
| 41 |
+
v 0.28585786 -0.06000000 0.66585786
|
| 42 |
+
v 0.29234633 0.06000000 0.66152241
|
| 43 |
+
v 0.29234633 -0.06000000 0.66152241
|
| 44 |
+
v 0.30000000 0.06000000 0.66000000
|
| 45 |
+
v 0.30000000 -0.06000000 0.66000000
|
| 46 |
+
v 0.30765367 0.06000000 0.66152241
|
| 47 |
+
v 0.30765367 -0.06000000 0.66152241
|
| 48 |
+
v 0.31414214 0.06000000 0.66585786
|
| 49 |
+
v 0.31414214 -0.06000000 0.66585786
|
| 50 |
+
v 0.31847759 0.06000000 0.67234633
|
| 51 |
+
v 0.31847759 -0.06000000 0.67234633
|
| 52 |
+
f 2 4 1
|
| 53 |
+
f 5 2 1
|
| 54 |
+
f 1 4 3
|
| 55 |
+
f 3 5 1
|
| 56 |
+
f 2 8 4
|
| 57 |
+
f 6 2 5
|
| 58 |
+
f 6 8 2
|
| 59 |
+
f 4 8 3
|
| 60 |
+
f 7 5 3
|
| 61 |
+
f 3 8 7
|
| 62 |
+
f 7 6 5
|
| 63 |
+
f 8 6 7
|
| 64 |
+
f 10 12 9
|
| 65 |
+
f 13 10 9
|
| 66 |
+
f 9 12 11
|
| 67 |
+
f 11 13 9
|
| 68 |
+
f 10 16 12
|
| 69 |
+
f 14 10 13
|
| 70 |
+
f 14 16 10
|
| 71 |
+
f 12 16 11
|
| 72 |
+
f 15 13 11
|
| 73 |
+
f 11 16 15
|
| 74 |
+
f 15 14 13
|
| 75 |
+
f 16 14 15
|
| 76 |
+
f 18 17 21
|
| 77 |
+
f 18 21 19
|
| 78 |
+
f 19 21 22
|
| 79 |
+
f 19 22 20
|
| 80 |
+
f 21 17 23
|
| 81 |
+
f 21 23 22
|
| 82 |
+
f 22 23 24
|
| 83 |
+
f 22 24 20
|
| 84 |
+
f 23 17 25
|
| 85 |
+
f 23 25 24
|
| 86 |
+
f 24 25 26
|
| 87 |
+
f 24 26 20
|
| 88 |
+
f 25 17 27
|
| 89 |
+
f 25 27 26
|
| 90 |
+
f 26 27 28
|
| 91 |
+
f 26 28 20
|
| 92 |
+
f 27 17 29
|
| 93 |
+
f 27 29 28
|
| 94 |
+
f 28 29 30
|
| 95 |
+
f 28 30 20
|
| 96 |
+
f 29 17 31
|
| 97 |
+
f 29 31 30
|
| 98 |
+
f 30 31 32
|
| 99 |
+
f 30 32 20
|
| 100 |
+
f 31 17 33
|
| 101 |
+
f 31 33 32
|
| 102 |
+
f 32 33 34
|
| 103 |
+
f 32 34 20
|
| 104 |
+
f 33 17 35
|
| 105 |
+
f 33 35 34
|
| 106 |
+
f 34 35 36
|
| 107 |
+
f 34 36 20
|
| 108 |
+
f 35 17 37
|
| 109 |
+
f 35 37 36
|
| 110 |
+
f 36 37 38
|
| 111 |
+
f 36 38 20
|
| 112 |
+
f 37 17 39
|
| 113 |
+
f 37 39 38
|
| 114 |
+
f 38 39 40
|
| 115 |
+
f 38 40 20
|
| 116 |
+
f 39 17 41
|
| 117 |
+
f 39 41 40
|
| 118 |
+
f 40 41 42
|
| 119 |
+
f 40 42 20
|
| 120 |
+
f 41 17 43
|
| 121 |
+
f 41 43 42
|
| 122 |
+
f 42 43 44
|
| 123 |
+
f 42 44 20
|
| 124 |
+
f 43 17 45
|
| 125 |
+
f 43 45 44
|
| 126 |
+
f 44 45 46
|
| 127 |
+
f 44 46 20
|
| 128 |
+
f 45 17 47
|
| 129 |
+
f 45 47 46
|
| 130 |
+
f 46 47 48
|
| 131 |
+
f 46 48 20
|
| 132 |
+
f 47 17 49
|
| 133 |
+
f 47 49 48
|
| 134 |
+
f 48 49 50
|
| 135 |
+
f 48 50 20
|
| 136 |
+
f 49 17 18
|
| 137 |
+
f 49 18 50
|
| 138 |
+
f 50 18 19
|
| 139 |
+
f 50 19 20
|
| 140 |
+
|
integration/test_data/drawer.obj
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# https://github.com/mikedh/trimesh
|
| 2 |
+
v -0.50000000 -0.30000000 0.00000000
|
| 3 |
+
v -0.50000000 -0.30000000 0.60000000
|
| 4 |
+
v -0.50000000 0.30000000 0.00000000
|
| 5 |
+
v -0.50000000 0.30000000 0.60000000
|
| 6 |
+
v 0.50000000 -0.30000000 0.00000000
|
| 7 |
+
v 0.50000000 -0.30000000 0.60000000
|
| 8 |
+
v 0.50000000 0.30000000 0.00000000
|
| 9 |
+
v 0.50000000 0.30000000 0.60000000
|
| 10 |
+
v -0.45000000 -0.27500000 0.59500000
|
| 11 |
+
v -0.45000000 -0.27500000 0.84500000
|
| 12 |
+
v -0.45000000 0.27500000 0.59500000
|
| 13 |
+
v -0.45000000 0.27500000 0.84500000
|
| 14 |
+
v 0.45000000 -0.27500000 0.59500000
|
| 15 |
+
v 0.45000000 -0.27500000 0.84500000
|
| 16 |
+
v 0.45000000 0.27500000 0.59500000
|
| 17 |
+
v 0.45000000 0.27500000 0.84500000
|
| 18 |
+
v -0.07500000 0.25000000 0.85000000
|
| 19 |
+
v -0.07500000 0.25000000 0.83500000
|
| 20 |
+
v 0.07500000 0.25000000 0.83500000
|
| 21 |
+
v 0.07500000 0.25000000 0.85000000
|
| 22 |
+
v -0.07500000 0.25750000 0.83700962
|
| 23 |
+
v 0.07500000 0.25750000 0.83700962
|
| 24 |
+
v -0.07500000 0.26299038 0.84250000
|
| 25 |
+
v 0.07500000 0.26299038 0.84250000
|
| 26 |
+
v -0.07500000 0.26500000 0.85000000
|
| 27 |
+
v 0.07500000 0.26500000 0.85000000
|
| 28 |
+
v -0.07500000 0.26299038 0.85750000
|
| 29 |
+
v 0.07500000 0.26299038 0.85750000
|
| 30 |
+
v -0.07500000 0.25750000 0.86299038
|
| 31 |
+
v 0.07500000 0.25750000 0.86299038
|
| 32 |
+
v -0.07500000 0.25000000 0.86500000
|
| 33 |
+
v 0.07500000 0.25000000 0.86500000
|
| 34 |
+
v -0.07500000 0.24250000 0.86299038
|
| 35 |
+
v 0.07500000 0.24250000 0.86299038
|
| 36 |
+
v -0.07500000 0.23700962 0.85750000
|
| 37 |
+
v 0.07500000 0.23700962 0.85750000
|
| 38 |
+
v -0.07500000 0.23500000 0.85000000
|
| 39 |
+
v 0.07500000 0.23500000 0.85000000
|
| 40 |
+
v -0.07500000 0.23700962 0.84250000
|
| 41 |
+
v 0.07500000 0.23700962 0.84250000
|
| 42 |
+
v -0.07500000 0.24250000 0.83700962
|
| 43 |
+
v 0.07500000 0.24250000 0.83700962
|
| 44 |
+
f 2 4 1
|
| 45 |
+
f 5 2 1
|
| 46 |
+
f 1 4 3
|
| 47 |
+
f 3 5 1
|
| 48 |
+
f 2 8 4
|
| 49 |
+
f 6 2 5
|
| 50 |
+
f 6 8 2
|
| 51 |
+
f 4 8 3
|
| 52 |
+
f 7 5 3
|
| 53 |
+
f 3 8 7
|
| 54 |
+
f 7 6 5
|
| 55 |
+
f 8 6 7
|
| 56 |
+
f 10 12 9
|
| 57 |
+
f 13 10 9
|
| 58 |
+
f 9 12 11
|
| 59 |
+
f 11 13 9
|
| 60 |
+
f 10 16 12
|
| 61 |
+
f 14 10 13
|
| 62 |
+
f 14 16 10
|
| 63 |
+
f 12 16 11
|
| 64 |
+
f 15 13 11
|
| 65 |
+
f 11 16 15
|
| 66 |
+
f 15 14 13
|
| 67 |
+
f 16 14 15
|
| 68 |
+
f 18 17 21
|
| 69 |
+
f 18 21 19
|
| 70 |
+
f 19 21 22
|
| 71 |
+
f 19 22 20
|
| 72 |
+
f 21 17 23
|
| 73 |
+
f 21 23 22
|
| 74 |
+
f 22 23 24
|
| 75 |
+
f 22 24 20
|
| 76 |
+
f 23 17 25
|
| 77 |
+
f 23 25 24
|
| 78 |
+
f 24 25 26
|
| 79 |
+
f 24 26 20
|
| 80 |
+
f 25 17 27
|
| 81 |
+
f 25 27 26
|
| 82 |
+
f 26 27 28
|
| 83 |
+
f 26 28 20
|
| 84 |
+
f 27 17 29
|
| 85 |
+
f 27 29 28
|
| 86 |
+
f 28 29 30
|
| 87 |
+
f 28 30 20
|
| 88 |
+
f 29 17 31
|
| 89 |
+
f 29 31 30
|
| 90 |
+
f 30 31 32
|
| 91 |
+
f 30 32 20
|
| 92 |
+
f 31 17 33
|
| 93 |
+
f 31 33 32
|
| 94 |
+
f 32 33 34
|
| 95 |
+
f 32 34 20
|
| 96 |
+
f 33 17 35
|
| 97 |
+
f 33 35 34
|
| 98 |
+
f 34 35 36
|
| 99 |
+
f 34 36 20
|
| 100 |
+
f 35 17 37
|
| 101 |
+
f 35 37 36
|
| 102 |
+
f 36 37 38
|
| 103 |
+
f 36 38 20
|
| 104 |
+
f 37 17 39
|
| 105 |
+
f 37 39 38
|
| 106 |
+
f 38 39 40
|
| 107 |
+
f 38 40 20
|
| 108 |
+
f 39 17 41
|
| 109 |
+
f 39 41 40
|
| 110 |
+
f 40 41 42
|
| 111 |
+
f 40 42 20
|
| 112 |
+
f 41 17 18
|
| 113 |
+
f 41 18 42
|
| 114 |
+
f 42 18 19
|
| 115 |
+
f 42 19 20
|
| 116 |
+
|
mujoco_menagerie/unitree_g1/scene_mjx.xml
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<mujoco model="g1 mjx flat terrain scene">
|
| 2 |
+
<include file="g1_mjx.xml"/>
|
| 3 |
+
|
| 4 |
+
<statistic meansize="0.02"/>
|
| 5 |
+
|
| 6 |
+
<visual>
|
| 7 |
+
<headlight diffuse="0.6 0.6 0.6" ambient="0.1 0.1 0.1" specular="0.9 0.9 0.9"/>
|
| 8 |
+
<rgba force="1 0 0 1" haze="0.15 0.25 0.35 1"/>
|
| 9 |
+
<global azimuth="140" elevation="-20"/>
|
| 10 |
+
<map force="0.01"/>
|
| 11 |
+
<scale forcewidth="0.3" contactwidth="0.5" contactheight="0.2"/>
|
| 12 |
+
<quality shadowsize="8192"/>
|
| 13 |
+
</visual>
|
| 14 |
+
|
| 15 |
+
<asset>
|
| 16 |
+
<texture type="skybox" builtin="gradient" rgb1="0.3 0.5 0.7" rgb2="0 0 0" width="512" height="3072"/>
|
| 17 |
+
<texture type="2d" name="groundplane" builtin="checker" mark="edge" rgb1="0.2 0.3 0.4" rgb2="0.1 0.2 0.3"
|
| 18 |
+
markrgb="0.8 0.8 0.8" width="300" height="300"/>
|
| 19 |
+
<material name="groundplane" texture="groundplane" texuniform="true" texrepeat="5 5" reflectance="0.2"/>
|
| 20 |
+
</asset>
|
| 21 |
+
|
| 22 |
+
<worldbody>
|
| 23 |
+
<geom name="floor" size="0 0 0.01" type="plane" material="groundplane"/>
|
| 24 |
+
</worldbody>
|
| 25 |
+
|
| 26 |
+
<contact>
|
| 27 |
+
<!-- left foot - floor -->
|
| 28 |
+
<pair name="left_foot1_floor" geom1="left_foot1_collision" geom2="floor" solref="0.008 1" friction="1 1"
|
| 29 |
+
condim="3"/>
|
| 30 |
+
<pair name="left_foot2_floor" geom1="left_foot2_collision" geom2="floor" solref="0.008 1" friction="1 1"
|
| 31 |
+
condim="3"/>
|
| 32 |
+
<pair name="left_foot3_floor" geom1="left_foot3_collision" geom2="floor" solref="0.008 1" friction="1 1"
|
| 33 |
+
condim="3"/>
|
| 34 |
+
<!-- right foot - floor -->
|
| 35 |
+
<pair name="right_foot1_floor" geom1="right_foot1_collision" geom2="floor" solref="0.008 1" friction="1 1"
|
| 36 |
+
condim="3"/>
|
| 37 |
+
<pair name="right_foot2_floor" geom1="right_foot2_collision" geom2="floor" solref="0.008 1" friction="1 1"
|
| 38 |
+
condim="3"/>
|
| 39 |
+
<pair name="right_foot3_floor" geom1="right_foot3_collision" geom2="floor" solref="0.008 1" friction="1 1"
|
| 40 |
+
condim="3"/>
|
| 41 |
+
<!-- foot - foot -->
|
| 42 |
+
<pair name="left_foot_right_foot" geom1="left_foot_box_collision" geom2="right_foot_box_collision" condim="1"/>
|
| 43 |
+
<!-- foot - shin -->
|
| 44 |
+
<pair name="left_foot_right_shin" geom1="left_foot_box_collision" geom2="right_shin_collision" condim="1"/>
|
| 45 |
+
<pair name="right_foot_left_shin" geom1="right_foot_box_collision" geom2="left_shin_collision" condim="1"/>
|
| 46 |
+
<!-- foot - linkage brace -->
|
| 47 |
+
<pair name="left_foot_right_linkage_brace" geom1="left_foot_box_collision" geom2="right_linkage_brace_collision"
|
| 48 |
+
condim="1"/>
|
| 49 |
+
<pair name="right_foot_left_linkage_brace" geom1="right_foot_box_collision" geom2="left_linkage_brace_collision"
|
| 50 |
+
condim="1"/>
|
| 51 |
+
<!-- hands - hips -->
|
| 52 |
+
<pair name="left_hand_left_hip" geom1="left_hand_collision" geom2="left_hip_collision" condim="1"/>
|
| 53 |
+
<pair name="right_hand_right_hip" geom1="right_hand_collision" geom2="right_hip_collision" condim="1"/>
|
| 54 |
+
<!-- hands - thigh -->
|
| 55 |
+
<pair name="left_hand_left_thigh" geom1="left_hand_collision" geom2="left_thigh_collision" condim="1"/>
|
| 56 |
+
<pair name="right_hand_right_thigh" geom1="right_hand_collision" geom2="right_thigh_collision" condim="1"/>
|
| 57 |
+
<!-- shins - shins -->
|
| 58 |
+
<pair name="left_shin_right_shin" geom1="left_shin_collision" geom2="right_shin_collision" condim="1"/>
|
| 59 |
+
<!-- torso - shoulders -->
|
| 60 |
+
<pair name="torso_left_shoulder" geom1="torso_collision" geom2="left_shoulder_yaw_collision" condim="1"/>
|
| 61 |
+
<pair name="torso_right_shoulder" geom1="torso_collision" geom2="right_shoulder_yaw_collision" condim="1"/>
|
| 62 |
+
<!-- torso - elbows -->
|
| 63 |
+
<pair name="torso_left_elbow" geom1="torso_collision" geom2="left_elbow_yaw_collision" condim="1"/>
|
| 64 |
+
<pair name="torso_right_elbow" geom1="torso_collision" geom2="right_elbow_yaw_collision" condim="1"/>
|
| 65 |
+
<!-- torso - wrist -->
|
| 66 |
+
<pair name="torso_left_wrist" geom1="torso_collision" geom2="left_wrist_collision" condim="1"/>
|
| 67 |
+
<pair name="torso_right_wrist" geom1="torso_collision" geom2="right_wrist_collision" condim="1"/>
|
| 68 |
+
<!-- torso - hands -->
|
| 69 |
+
<pair name="torso_left_hand" geom1="torso_collision" geom2="left_hand_collision" condim="1"/>
|
| 70 |
+
<pair name="torso_right_hand" geom1="torso_collision" geom2="right_hand_collision" condim="1"/>
|
| 71 |
+
<!-- hands - floor -->
|
| 72 |
+
<pair name="left_hand_floor" geom1="left_hand_collision" geom2="floor" condim="3"/>
|
| 73 |
+
<pair name="right_hand_floor" geom1="right_hand_collision" geom2="floor" condim="3"/>
|
| 74 |
+
<!-- shoulder - floor -->
|
| 75 |
+
<pair name="left_shoulder_floor" geom1="left_shoulder_yaw_collision" geom2="floor" condim="3"/>
|
| 76 |
+
<pair name="right_shoulder_floor" geom1="right_shoulder_yaw_collision" geom2="floor" condim="3"/>
|
| 77 |
+
<!-- elbow - floor -->
|
| 78 |
+
<pair name="left_elbow_floor" geom1="left_elbow_yaw_collision" geom2="floor" condim="3"/>
|
| 79 |
+
<pair name="right_elbow_floor" geom1="right_elbow_yaw_collision" geom2="floor" condim="3"/>
|
| 80 |
+
<!-- wrist - floor -->
|
| 81 |
+
<pair name="left_wrist_floor" geom1="left_wrist_collision" geom2="floor" condim="3"/>
|
| 82 |
+
<pair name="right_wrist_floor" geom1="right_wrist_collision" geom2="floor" condim="3"/>
|
| 83 |
+
<!-- hips - floor -->
|
| 84 |
+
<pair name="left_hip_floor" geom1="left_hip_collision" geom2="floor" condim="3"/>
|
| 85 |
+
<pair name="right_hip_floor" geom1="right_hip_collision" geom2="floor" condim="3"/>
|
| 86 |
+
<!-- thigh - floor -->
|
| 87 |
+
<pair name="left_thigh_floor" geom1="left_thigh_collision" geom2="floor" condim="3"/>
|
| 88 |
+
<pair name="right_thigh_floor" geom1="right_thigh_collision" geom2="floor" condim="3"/>
|
| 89 |
+
<!-- shins - floor -->
|
| 90 |
+
<pair name="left_shin_floor" geom1="left_shin_collision" geom2="floor" condim="3"/>
|
| 91 |
+
<pair name="right_shin_floor" geom1="right_shin_collision" geom2="floor" condim="3"/>
|
| 92 |
+
<!-- pelvis - floor -->
|
| 93 |
+
<pair name="pelvis_floor" geom1="pelvis_collision" geom2="floor" condim="3"/>
|
| 94 |
+
<!-- torso - floor -->
|
| 95 |
+
<pair name="torso_floor" geom1="torso_collision" geom2="floor" condim="3"/>
|
| 96 |
+
<!-- head - floor -->
|
| 97 |
+
<pair name="head_floor" geom1="head_collision" geom2="floor" condim="3"/>
|
| 98 |
+
<!-- thigh - thigh -->
|
| 99 |
+
<pair name="left_thigh_right_thigh" geom1="left_thigh_collision" geom2="right_thigh_collision" condim="1"/>
|
| 100 |
+
<!-- shin - thigh -->
|
| 101 |
+
<pair name="left_shin_right_thigh" geom1="left_shin_collision" geom2="right_thigh_collision" condim="1"/>
|
| 102 |
+
<pair name="right_shin_left_thigh" geom1="right_shin_collision" geom2="left_thigh_collision" condim="1"/>
|
| 103 |
+
<!-- hip - shin -->
|
| 104 |
+
<pair name="left_shin_right_hip" geom1="left_shin_collision" geom2="right_hip_collision" condim="1"/>
|
| 105 |
+
<pair name="right_shin_left_hip" geom1="right_shin_collision" geom2="left_hip_collision" condim="1"/>
|
| 106 |
+
<!-- hip - thigh -->
|
| 107 |
+
<pair name="left_hip_right_thigh" geom1="left_hip_collision" geom2="right_thigh_collision" condim="1"/>
|
| 108 |
+
<pair name="right_hip_left_thigh" geom1="right_hip_collision" geom2="left_thigh_collision" condim="1"/>
|
| 109 |
+
<!-- hand - hand -->
|
| 110 |
+
<pair name="left_hand_right_hand" geom1="left_hand_collision" geom2="right_hand_collision" condim="1"/>
|
| 111 |
+
</contact>
|
| 112 |
+
|
| 113 |
+
<keyframe>
|
| 114 |
+
<key name="home"
|
| 115 |
+
qpos="0 0 0.783675 1 0 0 0 -0.1 0 0 0.3 -0.2 0 -0.1 0 0 0.3 -0.2 0 0 0 0 0.2 0.2 0 1.28 0 0 0 0.2 -0.2 0 1.28 0 0 0"
|
| 116 |
+
ctrl="-0.1 0 0 0.3 -0.2 0 -0.1 0 0 0.3 -0.2 0 0 0 0 0.2 0.2 0 1.28 0 0 0 0.2 -0.2 0 1.28 0 0 0"/>
|
| 117 |
+
<key name="knees_bent"
|
| 118 |
+
qpos="0 0 0.755 1 0 0 0 -0.312 0 0 0.669 -0.363 0 -0.312 0 0 0.669 -0.363 0 0 0 0.073 0.2 0.22 0 1 0 0 0 0.2 -0.22 0 1 0 0 0"
|
| 119 |
+
ctrl="-0.312 0 0 0.669 -0.363 0 -0.312 0 0 0.669 -0.363 0 0 0 0.073 0.2 0.22 0 1 0 0 0 0.2 -0.22 0 1 0 0 0"/>
|
| 120 |
+
</keyframe>
|
| 121 |
+
</mujoco>
|