Skip to main content

RoboMeshCat

PyPI version License

Set of utilities for visualizing robots in web-based visualizer MeshCat. The whole library is object and robot centric allowing you to modify properties of instances rather than manipulating the visualization tree of the MeshCat itself. The library allows you to easily generate videos like this (source code is here):

or like this (by installing a few more dependencies; source code):

Installation

From

conda install -c conda-forge robomeshcat

From PyPI

pip install robomeshcat

About

This library allows you to visualize and animate objects and robots in web browser. Compared to MeshCat library, on which we build, our library is object-oriented allowing you to modify the properties of individual objects, for example:

o = Object.create_sphere(radius=0.2)
o.pos[2] = 2.  # modify position
o.opacity = 0.3  # modify transparency
o.color[0] = 1.  # modify red channel of the color
o.hide()  # hide the object, i.e. set o.visible = False

In addition to objects, it allows you to easily create and manipulate robots (loaded from URDF file):

r = Robot(urdf_path='robot.urdf')
r[0] = np.pi  # set the value of the first joint
r['joint5'] = 0  # set the value of the joint named 'joint5' 
r.pos = [0, 0, 0]  # set the base pose of the robot
r.color, r.opacity, r.visibility, r.rot = ...  # change the color, opacity, visibility, or rotation

All changes will be displayed immediately in the browser, that we call 'online' rendering. By default, you can rotate the camera view with your mouse. However, our library allows you to control the camera from the code as well through the Scene object, that is the main point for visualization:

scene = Scene()
scene.add_object(o)  # add object 'o' into the scene, that will display it
scene.add_robot(r)  # add robot 'r' into the scene, that will display it
scene.camera_pos = [1, 1, 1]  # set camera position
scene.camera_pos[2] = 2  # change height of the camera
scene.camera_zoom = 2  # zoom in
scene.reset_camera()  # reset camera such that you can control it with your mouse again

For complete examples of object and robot interface see our two examples: 01_object.py and 02_robots.py.

It is also possible to visualize human model after installing a few more dependencies, see installation and example 06_human.py.

Animation

This library allows you to animate all the properties of the objects and robots (e.g. position, robot configuration, color,opacity) inside the browser (from which you can replay, slow-down, etc.). Simply use:

scene = Scene()
scene.add_object(o)

with scene.animation(fps=25):
    o.pos[2] = 2.
    scene.render()  # create a first frame of the animation, with object position z-axis set to 2.
    o.pos[2] = 0.
    scene.render()  # create a second frame of the animation with object on the ground

You can also store the animation into the video, using the same principle:

with scene.video_recording(filename='video.mp4', fps=25):
    scene.render()

See our examples on Animation and Image and video.

Release files for robomeshcat 1.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for robomeshcat 1.1.4
File Size Uploaded
robomeshcat-1.1.4.tar.gz 1.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for robomeshcat 1.1.4
File Interpreter ABI Platform
robomeshcat-1.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 1.0 MB

Release files / robomeshcat-1.1.4.tar.gz

Download URL robomeshcat-1.1.4.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
d79e50e8e18c040e9ec1257df2bd78c6f2ac76d293cebbad374d6c32663fcaef
BLAKE2b-256 checksum
How to use checksums
29d0073c839f34b52bba14604bb28bbf23d92c3874c2e92ad4f53d936ac725da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release files / robomeshcat-1.1.4-py3-none-any.whl

Download URL robomeshcat-1.1.4-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed9b8cc73880afcf627a85be36f6a5ae16002784630fa9aa6468c3b38e490cad
BLAKE2b-256 checksum
How to use checksums
75963fd4ca6c5dbde1ab1650520af4aa610f42d395e68f011392be181095ac71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.8

Release history Release notifications | RSS feed

This release

1.1.4 This release

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page