Skip to content

Conversation

@HiroIshida
Copy link
Contributor

@HiroIshida HiroIshida commented Dec 3, 2025

whats this

This contribution was made as a member of SB Intuitions Robotics team.

This PR adds viser visualizer to skrobot. https://viser.studio/main/
The original motivation of this is that I have difficulty using pyreder and trimesh visualizers on macos, so I need the one that is easy to use on Mac. Also, I think viser is ultra fast, so recommedable to linux users.

image
import numpy as np
from skrobot.models.pr2 import PR2
from skrobot.coordinates import Coordinates
from skrobot.model.primitives import Sphere, Axis, Box, PointCloudLink
from skrobot.viewers import ViserVisualizer

if __name__ == "__main__":
    v = ViserVisualizer()
    pr2 = PR2()
    v.add(pr2)
    v.draw_grid()
    s = Sphere(0.2, color=[1.0, 0.0, 0.0, 0.6])
    s.translate([0.5, 0.0, 0.3])
    box= Box([0.3, 0.3, 0.3], face_colors=[0.0, 1.0, 0.0, 0.6])
    box.translate([0.5, 0.6, 0.3])

    colors = np.random.randint(0, 255, size=(1000, 3)).astype(np.float32) / 255
    cloud = PointCloudLink(np.random.randn(1000, 3) + np.array([0.5, -0.5, 0.5]), colors=colors)

    axis = Axis.from_coords(Coordinates())
    axis.translate([0.7, 0.0, 0.5])
    v.add(s)
    v.add(axis)
    v.add(box)
    v.add(cloud)
    v.show()
    pr2.reset_manip_pose()
    v.redraw()
    import time; time.sleep(1000)
    

@HiroIshida HiroIshida force-pushed the sbintuitions/add_viser branch 3 times, most recently from 6c92f5d to 60a8af1 Compare December 3, 2025 01:21
@HiroIshida HiroIshida marked this pull request as ready for review December 3, 2025 01:23
Signed-off-by: Hirokazu Ishida (SB Intuitions) <[email protected]>
@HiroIshida HiroIshida force-pushed the sbintuitions/add_viser branch from 60a8af1 to 28fd6fe Compare December 3, 2025 01:29
@iory iory merged commit 82ec787 into iory:main Dec 3, 2025
19 checks passed
@iory
Copy link
Owner

iory commented Dec 3, 2025

LGTM!

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