Skip to content

Commit 4431375

Browse files
committed
fix(assets): zed intrinsics
1 parent d2449a4 commit 4431375

2 files changed

Lines changed: 31 additions & 13 deletions

File tree

‎assets/cameras/zed2i/zed2i.xml‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,21 @@
2525
<body name="zed2i" childclass="zed2i">
2626
<geom mesh="zed2i" quat="0 0 1 0" material="black" class="visual"/>
2727
<geom mesh="zed2i_coll" quat="0 0 1 0" material="black" class="collision"/>
28-
<!-- from real camera after calibration
28+
<!-- from real camera after calibration (720p / 1280x720)
2929
[786.14367676 0. 723.64068604 0. ]
3030
[ 0. 786.14367676 406.79891968 0. ]
3131
[ 0. 0. 1. 0. ]]
32-
>>> np.arctan(720/(2*786.14367676 ))*360/np.pi
33-
np.float64(49.209076483949794) -->
32+
Full intrinsics (not just fovy) so the sim matches the real off-center principal
33+
point (cx=723.64, cy=406.80 vs image centre 640,360 -- a ~84px/47px offset that a
34+
fovy-only camera ignores and the extrinsic cannot absorb). MuJoCo intrinsic model:
35+
sensorsize (arbitrary 16:9 -> cancels) + resolution + focalpixel(fx,fy) +
36+
principalpixel. NOTE MuJoCo's principalpixel is +X-LEFT, +Y-UP, so:
37+
principalpixel = [-(cx - W/2), -(cy - H/2)] = [-83.64, -46.80]
38+
(verified by rendering: a point on the optical axis lands at (723,407)). -->
3439

35-
<camera name="camera" pos="0 -0.02 0.005" euler="-1.5707963267948966 0 0" fovy="49"/>
40+
<camera name="camera" pos="0 -0.02 0.005" euler="-1.5707963267948966 0 0"
41+
resolution="1280 720" sensorsize="0.005325 0.0029953"
42+
focalpixel="786.14367676 786.14367676" principalpixel="-83.6406860 -46.7989197"/>
3643
</body>
3744
</worldbody>
3845

‎assets/cameras/zed_mini/zed_mini.xml‎

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,29 @@
2323

2424
<worldbody>
2525
<body name="zed_mini" childclass="zed_mini">
26-
<geom mesh="zed_mini" quat="1 0 0 0" material="black" class="visual" mass="0"/>
26+
<!-- Housing geoms shifted by G = inv(_WRIST_CAM_OFFSET) @ O_orig, where O_orig is the
27+
ORIGINAL manual wrist placement (single_arm.py, pre-hand-eye: translation
28+
[-0.077,0.009,-0.008], rpy deg [0,-70,0]) at which the mesh sat correctly in the
29+
mount. This puts the housing back where it belongs while the <camera> below stays
30+
at the new calibrated optical pose. Purely visual/collision -- does NOT affect the
31+
camera image or _WRIST_CAM_OFFSET (those depend only on the <camera> pose). -->
32+
<geom mesh="zed_mini" pos="-0.029645 0.002464 -0.004295" quat="0.999847 0.011973 0.010415 -0.00733" material="black" class="visual" mass="0"/>
2733
<!-- Real measured mass 56.9 g; COM/inertia derived from the mesh at this mass. -->
28-
<geom mesh="zed_mini_coll" quat="1 0 0 0" material="black" class="collision" mass="0.0569"/>
29-
<!-- intrinsic matrix from real camera -->
30-
<!-- [[733.30859375 0. 645.03240967 0. ]
31-
[ 0. 733.30859375 358.78286743 0. ]
34+
<geom mesh="zed_mini_coll" pos="-0.029645 0.002464 -0.004295" quat="0.999847 0.011973 0.010415 -0.00733" material="black" class="collision" mass="0.0569"/>
35+
<!-- intrinsic matrix from real camera (serial 14943057, ZED_M, 1280x720) -->
36+
<!-- [[740.23132324 0. 602.53009033 0. ]
37+
[ 0. 740.23132324 357.18844604 0. ]
3238
[ 0. 0. 1. 0. ]] -->
33-
<!-- >>> np.arctan(720/(2*733.30859375))*360/np.pi
34-
np.float64(52.295211753153616) -->
39+
<!-- Full intrinsics (not just fovy) so the sim matches the real off-center principal
40+
point (cx=602.53, cy=357.19 vs centre 640,360 -- ~37px horizontal offset a fovy-only
41+
camera ignores). MuJoCo principalpixel is +X-LEFT, +Y-UP:
42+
principalpixel = [-(cx - W/2), -(cy - H/2)] = [37.47, 2.81]
43+
(verified by rendering: on-axis point lands at (602,357)). pos/quat unchanged so
44+
_WRIST_CAM_OFFSET / the mesh offset are unaffected. -->
3545

36-
37-
<camera name="camera" pos="0 0.0255 0" quat="0.5 0.5 -0.5 -0.5" fovy="52"/>
46+
<camera name="camera" pos="0 0.0255 0" quat="0.5 0.5 -0.5 -0.5"
47+
resolution="1280 720" sensorsize="0.005325 0.0029953"
48+
focalpixel="740.23132324 740.23132324" principalpixel="37.4699097 2.8115540"/>
3849
</body>
3950
</worldbody>
4051

0 commit comments

Comments
 (0)