Skip to content

feat(viewer): add a ground grid to the 3D robot viewer - #108

Open
cetiennec wants to merge 1 commit into
huggingface:mainfrom
cetiennec:etienne/teleop-viewer-grid
Open

cetiennec wants to merge 1 commit into
huggingface:mainfrom
cetiennec:etienne/teleop-viewer-grid

Conversation

@cetiennec

@cetiennec cetiennec commented Sep 14, 2026

Copy link
Copy Markdown

What

The teleoperation/calibration/recording 3D panel had no way to judge scale or distance — just the robot floating with lights and an invisible shadow-catching plane. This adds a visible ground grid.

How it's sized

The grid is created as a 1×1 placeholder in createUrdfViewer (before any model exists to measure), then fitGridToRobot rescales and repositions it once a model's bounding box is known — reusing the box fitRobotToView already computes for the camera auto-fit. So it works for the default SO-101 model and for any custom URDF dragged in, regardless of its unit scale, without a hardcoded guess.

Why it needs no rotation

Added directly to the viewer's scene rather than world (the group that holds the robot): scene stays in three.js's native Y-up frame regardless of the URDF's own up axis — _setUp on the viewer element compensates for that by rotating world instead. A flat GridHelper (XZ plane by default) therefore lies under the robot with no extra rotation of its own.

Notes

  • frontend/dist/ rebuilt with Node 22, as the Quality workflow requires.
  • Only touches the shared URDF viewer (UrdfViewer.tsx / urdfViewerHelpers.ts), used today from the Teleoperation page's visualizer panel.
Capture d’écran 2026-09-14 à 15 14 38

🤖 Generated with Claude Code

Copilot AI balanced review requested due to automatic review settings September 14, 2026 13:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The teleoperation/calibration/recording 3D panel had no way to judge scale
or distance — just the robot floating with lights and an invisible
shadow-catching plane. Added a visible GridHelper as a floor reference.

Sized in world units rather than a fixed guess: the grid is created as a
1x1 placeholder in createUrdfViewer (before any model exists to measure),
then fitGridToRobot rescales and repositions it once a model's bounding box
is known — reusing the box fitRobotToView already computes for the camera
auto-fit, so it works for the default SO-101 model and for any custom URDF
dragged in, regardless of its unit scale.

Added directly to the viewer's `scene` rather than `world` (which holds the
robot): `scene` stays in three.js's native Y-up frame regardless of the
URDF's own up axis — `_setUp` on the viewer element compensates for that by
rotating `world` instead — so the grid (flat in the XZ plane by default)
needs no rotation of its own to lie under the robot.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@cetiennec
cetiennec force-pushed the etienne/teleop-viewer-grid branch from 4e35c4c to e5dfe2d Compare September 14, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants