You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(sim/mujoco): metric depth passthrough + capture fd-2 depth warning + silence export_xml attach noise
render_depth treated MuJoCo's depth output as a normalized [0,1] OpenGL
buffer and re-linearized it with znear*zfar/(zfar - d*(zfar-znear)). But
MuJoCo >= 3.0's Renderer.enable_depth_rendering() returns METRIC depth in
meters directly, so that re-projection collapsed near-field depth onto the
near-clip plane: a scene whose nearest surface sits at 0.41 m reported a
minimum of 0.01 m (znear) regardless of content. Consume the metric array
as-is; only sanitize NaN/+inf -> far-clip, -inf/negative -> 0, clamp to
[0, zfar].
The ARB_clip_control depth warning is a C-level write to fd 2, which
contextlib.redirect_stderr cannot see (it only swaps sys.stderr), so the
warning both leaked to the console and never reached the response text it
was meant to populate. Add a reusable capture_stderr_fd() context manager
(os.dup2-based fd-2 capture, mirroring filter_mujoco_attach_noise, with the
same no-op fallback when fd 2 can't be duped) and use it in render_depth:
surface the notice in the response text, drop the duplicate console line
(log at DEBUG), and pass any other stderr lines through unchanged.
export_xml called spec.to_xml() raw while every other call site wraps it in
filter_mujoco_attach_noise(), so it spammed benign 'Attach conflict ...
keeping parent value' chatter to the console for every attached-robot scene.
Wrap it too.
Tests: rewrite test_render_depth_linearizes_normalized_buffer_to_meters
(which enshrined the bug) as test_render_depth_passes_through_metric_depth,
add test_render_depth_sanitizes_nan_and_inf. Both fail on pre-fix code.
* fix(sim/mujoco): document best-effort stderr-forward except per review feedback
* review(sim/mujoco): R3 -- add explanatory comments to bare except clauses (addresses CodeQL threads backend.py:387,400)
---------
Co-authored-by: strands-agent <217235299+strands-agent@users.noreply.github.com>
Co-authored-by: strands-robots <agent@strands.local>
Co-authored-by: cagataycali <cagatay@cali.so>
0 commit comments