Skip to content

Web viewer example (compas_threejs) - #6

Open
gonzalocasas wants to merge 1 commit into
docs/any-robot-examplesfrom
examples/web-viewer
Open

gonzalocasas wants to merge 1 commit into
docs/any-robot-examplesfrom
examples/web-viewer

Conversation

@gonzalocasas

Copy link
Copy Markdown
Member

Stacked on #5 (uses NativePlanner.has_closed_form_ik). Retarget to main once #5 is merged.

A browser viewer in examples/web_viewer/, built on the Python compas_threejs (no npm build):

pip install compas_fab_native compas_threejs
python examples/web_viewer/viewer.py
python examples/web_viewer/viewer.py --urdf robot.urdf [--srdf robot.srdf] --meshes path/to/packages [--solver UR5Kinematics]
  • Robots: UR5, UR5 with a cone tool, UR10e carrying a beam, ABB IRB 4600 with a printing tool, Stäubli TX2-60L, Panda, or your own URDF (SRDF optional: without it the group is the joint chain).
  • Drag the target (gizmo) → IK, closest solution first, red when none; cycle IK solutions.
  • Free motion and straight line to the target, played back in real time; speed slider; optional free rotation about the tool axis (point-axis targets).
  • Click a link → +10°/−10° jog of its joint, collision-checked.
  • Add, move, rotate and scale box obstacles; boxes or distance-field obstacle model; sphere or exact-mesh collision checks.

Each link mesh is sent once in link coordinates; afterwards only pose changes are sent (from NativeCore.link_frames), so playback stays light.

Tested: every command on all six library robots (scripted), gizmo drags through on_message, and in headless Chrome (load, robot switching, add box, free motion, link picking and jogging, a URDF without SRDF). Not tested: dragging gizmo handles with a real mouse.

🤖 Generated with Claude Code

A browser viewer to try the planner on library robots or your own URDF:
drag a target (IK), cycle IK solutions, jog joints, plan free motions
and straight lines, add and move box obstacles, switch obstacle model,
and check collisions on the sphere model or the exact meshes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant