[MRG] Viser visualization backend - #362
Open
AlexanderFabisch wants to merge 12 commits into
Open
Conversation
AlexanderFabisch
commented
May 7, 2026
| return tuple(int(np.clip(v * 255.0, 0, 255)) for v in arr[:3]) | ||
|
|
||
|
|
||
| def _wxyz_from_matrix(A2B): |
Member
Author
There was a problem hiding this comment.
Should be inlined
AlexanderFabisch
commented
May 7, 2026
| return pr.quaternion_from_matrix(A2B[:3, :3], strict_check=False) | ||
|
|
||
|
|
||
| def _make_arrow_mesh(length): |
B1: Remove redundant set_data(H) call at end of Trajectory.__init__.
Child artists are already created with the correct data; calling
set_data again reprocessed the trajectory twice including an
expensive np.linspace recomputation.
B2: Plane._resolve_point now normalises the normal vector before
multiplying by d. The Hesse normal form requires a unit normal;
unnormalised inputs placed the plane centre at the wrong position
and caused plane_basis_from_normal to produce an incorrect basis.
B4: Graph.set_data now guards the visuals and collision_objects loops
with try/except KeyError, matching the existing guard on the frames
and connections loops. A disconnected URDF link after a joint
update previously raised an uncaught KeyError.
B5: Trajectory.set_data recomputes key_frames_indices when the new H
array has a different length. Using stale indices from the original
length caused an IndexError when set_data was called with a shorter
or longer trajectory.
B8: Plane._make_mesh now uses two faces instead of four. The last two
faces were reversed-winding duplicates of the first two; add_mesh_simple
with side="double" already renders both sides, so the duplicates only
doubled the triangle count without any visual benefit.
B9: Frame.set_data now updates _label_handle.text in addition to
_label_handle.position so that label text changes after construction
are reflected in the scene.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pytransform3d.viser— web-based visualization backendA new
pytransform3d.visermodule backed by viser that is a drop-in replacement forpytransform3d.visualizer. It renders in a browser via WebSocket, so it works in headless environments (remote servers, containers, notebooks) where an OpenGL window is unavailable. Switching backends is a one-line import change; both modules share the same public API.Differences from the Open3D backend:
show()is non-blocking and prints a URL instead of opening a window;save_image()raisesNotImplementedError;set_line_width()is a no-op.view_init()gainscenteranddistanceparameters for controlling the orbit target.Install with
pip install 'pytransform3d[all]'orpip install viser.trimeshis required for shapes without a native viser primitive (cylinders, cones, capsules, ellipsoids, vector arrows) and is included in theallextras group.New examples
Six new examples in
examples/viser/:vis_viser_shapes— all geometric primitives in one static scenevis_viser_robot_arm— animated 6-DOF robot arm with growing TCP trajectoryvis_viser_wrench_dynamics— rigid-body simulation driven by a body-fixed wrench with rolling position trailvis_viser_camera_orbit— pinhole camera orbiting a static scene, frustum updated every framevis_viser_uncertain_transforms— banana distribution from SE(3) uncertainty propagation: MC paths, mean trajectory, projected hyperellipsoid, and Cartesian position ellipsoidvis_viser_probabilistic_robot_kinematics— PPOE probabilistic forward kinematics with animated end-effector pose-uncertainty ellipsoidA new user-guide page covers installation, the API, differences from the Open3D backend, and the animation workflow.