Skip to content

Commit

Permalink
deploy: 531855d
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Nov 21, 2024
1 parent 031a9d5 commit 994a343
Show file tree
Hide file tree
Showing 175 changed files with 123,077 additions and 0 deletions.
4 changes: 4 additions & 0 deletions versions/0.2.19/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 772e2063d46c520798bade2b1a41c322
tags: d77d1c0d9ca2f4c8421862c7c5a0d620
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/client_handles.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/conventions.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/development.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/environment.pickle
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/events.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/examples/02_gui.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/extras.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/gui_api.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/gui_handles.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/icons.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/index.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/infrastructure.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/scene_api.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/scene_handles.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/server.doctree
Binary file not shown.
Binary file added versions/0.2.19/.doctrees/transforms.doctree
Binary file not shown.
Empty file added versions/0.2.19/.nojekyll
Empty file.
446 changes: 446 additions & 0 deletions versions/0.2.19/_modules/index.html

Large diffs are not rendered by default.

2,059 changes: 2,059 additions & 0 deletions versions/0.2.19/_modules/viser/_gui_api/index.html

Large diffs are not rendered by default.

1,334 changes: 1,334 additions & 0 deletions versions/0.2.19/_modules/viser/_gui_handles/index.html

Large diffs are not rendered by default.

4,741 changes: 4,741 additions & 0 deletions versions/0.2.19/_modules/viser/_icons_enum/index.html

Large diffs are not rendered by default.

487 changes: 487 additions & 0 deletions versions/0.2.19/_modules/viser/_notification_handle/index.html

Large diffs are not rendered by default.

2,395 changes: 2,395 additions & 0 deletions versions/0.2.19/_modules/viser/_scene_api/index.html

Large diffs are not rendered by default.

1,167 changes: 1,167 additions & 0 deletions versions/0.2.19/_modules/viser/_scene_handles/index.html

Large diffs are not rendered by default.

1,388 changes: 1,388 additions & 0 deletions versions/0.2.19/_modules/viser/_viser/index.html

Large diffs are not rendered by default.

570 changes: 570 additions & 0 deletions versions/0.2.19/_modules/viser/extras/_record3d/index.html

Large diffs are not rendered by default.

613 changes: 613 additions & 0 deletions versions/0.2.19/_modules/viser/extras/_urdf/index.html

Large diffs are not rendered by default.

1,056 changes: 1,056 additions & 0 deletions versions/0.2.19/_modules/viser/infra/_infra/index.html

Large diffs are not rendered by default.

627 changes: 627 additions & 0 deletions versions/0.2.19/_modules/viser/infra/_messages/index.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

818 changes: 818 additions & 0 deletions versions/0.2.19/_modules/viser/transforms/_base/index.html

Large diffs are not rendered by default.

727 changes: 727 additions & 0 deletions versions/0.2.19/_modules/viser/transforms/_se2/index.html

Large diffs are not rendered by default.

705 changes: 705 additions & 0 deletions versions/0.2.19/_modules/viser/transforms/_se3/index.html

Large diffs are not rendered by default.

626 changes: 626 additions & 0 deletions versions/0.2.19/_modules/viser/transforms/_so2/index.html

Large diffs are not rendered by default.

954 changes: 954 additions & 0 deletions versions/0.2.19/_modules/viser/transforms/_so3/index.html

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions versions/0.2.19/_sources/camera_handles.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Camera Handles

<!-- prettier-ignore-start -->

.. autoclass:: viser.CameraHandle
:members:
:undoc-members:
:inherited-members:

<!-- prettier-ignore-end -->
15 changes: 15 additions & 0 deletions versions/0.2.19/_sources/client_handles.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Client Handles

<!-- prettier-ignore-start -->

.. autoclass:: viser.ClientHandle
:members:
:undoc-members:
:inherited-members:

.. autoclass:: viser.NotificationHandle
:members:
:undoc-members:
:inherited-members:

<!-- prettier-ignore-end -->
62 changes: 62 additions & 0 deletions versions/0.2.19/_sources/conventions.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Frame Conventions

In this note, we describe the coordinate frame conventions used in `viser`.

## Scene tree naming

Each object that we add to the scene in viser is instantiated as a node in a
scene tree. The structure of this tree is determined by the names assigned to
the nodes.

If we add a coordinate frame called `/base_link/shoulder/wrist`, it signifies
three nodes: the `wrist` is a child of the `shoulder` which is a child of the
`base_link`.

If we set the transformation of a given node like `/base_link/shoulder`, both
it and its child `/base_link/shoulder/wrist` will move. Its parent,
`/base_link`, will be unaffected.

## Poses

Poses in `viser` are defined using a pair of fields:

- `wxyz`, a unit quaternion orientation term. This should always be 4D.
- `position`, a translation term. This should always be 3D.

These correspond to a transformation from coordinates in the local frame to the
parent frame:

<!-- prettier-ignore-start -->

.. math::

p_\mathrm{parent} = \begin{bmatrix} R & t \end{bmatrix}\begin{bmatrix}p_\mathrm{local} \\ 1\end{bmatrix}

<!-- prettier-ignore-end -->

where `wxyz` is the quaternion form of the :math:`\mathrm{SO}(3)` matrix
:math:`R` and `position` is the :math:`\mathbb{R}^3` translation term
:math:`t`.

## World coordinates

In the world coordinate space, +Z points upward by default. This can be
overridden with :func:`viser.SceneApi.set_up_direction()`.

## Cameras

In `viser`, all camera parameters exposed to the Python API use the
COLMAP/OpenCV convention:

- Forward: +Z
- Up: -Y
- Right: +X

Confusingly, this is different from Nerfstudio, which adopts the OpenGL/Blender
convention:

- Forward: -Z
- Up: +Y
- Right: +X

Conversion between the two is a simple 180 degree rotation around the local X-axis.
118 changes: 118 additions & 0 deletions versions/0.2.19/_sources/development.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Development

In this note, we outline current practices, tools, and workflows for `viser`
development. We assume that the repository is cloned to `~/viser`.

## Python install

We recommend an editable install for Python development, ideally in a virtual
environment (eg via conda).

```bash
# Install package.
cd ~/viser
pip install -e .

# Install example dependencies.
pip install -e .[examples]
```

After installation, any of the example scripts (`~/viser/examples`) should be
runnable. A few of them require downloading assets, which can be done via the
scripts in `~/viser/examples/assets`.

**Linting, formatting, type-checking.**

First, install developer tools:

```bash
# Using pip.
pip install -e .[dev]
pre-commit install
```

It would be hard to write unit tests for `viser`. We rely on static typing for
robustness. To check your code, you can run the following:

```bash
# runs linting, formatting, and type-checking
viser-dev-checks
```

## Message updates

The `viser` frontend and backend communicate via a shared set of message
definitions:

- On the server, these are defined as Python dataclasses in
`~/viser/src/viser/_messages.py`.
- On the client, these are defined as TypeScript interfaces in
`~/viser/src/viser/client/src/WebsocketMessages.tsx`.

Note that there is a 1:1 correspondence between the dataclasses message types
and the TypeScript ones.

The TypeScript definitions should not be manually modified. Instead, changes
should be made in Python and synchronized via the `sync_message_defs.py` script:

```
cd ~/viser
python sync_message_defs.py
```

## Client development

For client development, we can start by launching a relevant Python script. The
examples are a good place to start:

```
cd ~/viser/examples
python 05_camera_commands.py
```

When a `viser` script is launched, two URLs will be printed:

- An HTTP URL, like `http://localhost:8080`, which can be used to open a
_pre-built_ version of the React frontend.
- A websocket URL, like `ws://localhost:8080`, which client applications can
connect to.

If changes to the client source files are detected on startup, `viser` will
re-build the client automatically. This is okay for quick changes, but for
faster iteration we can also launch a development version of the frontend, which
will reflect changes we make to the client source files
(`~/viser/src/viser/client/src`) without a full build. This requires a few more
steps.

**Installing dependencies.**

1. [Install nodejs.](https://nodejs.dev/en/download/package-manager)
2. [Install yarn.](https://yarnpkg.com/getting-started/install)
3. Install dependencies.
```
cd ~/viser/src/viser/client
yarn install
```

**Launching client.**

To launch the client, we can run:

```
cd ~/viser/src/viser/client
yarn start
```

from the `viser/src/viser/client` directory. After opening the client in a web
browser, the websocket server address typically needs to be updated in the
"Server" tab.

**Formatting.**

We use [prettier](https://prettier.io/docs/en/install.html). This can be run via
one of:

- `prettier -w .`
- `npx prettier -w .`

from `~/viser/src/viser/client`.
14 changes: 14 additions & 0 deletions versions/0.2.19/_sources/events.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Events

We define a small set of event types, which are passed to callback functions
when events like clicks or GUI updates are triggered.

<!-- prettier-ignore-start -->

.. autoclass:: viser.ScenePointerEvent()

.. autoclass:: viser.SceneNodePointerEvent()

.. autoclass:: viser.GuiEvent()

<!-- prettier-ignore-end -->
47 changes: 47 additions & 0 deletions versions/0.2.19/_sources/examples/00_coordinate_frames.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. Comment: this file is automatically generated by `update_example_docs.py`.
It should not be modified manually.
Coordinate frames
==========================================


In this basic example, we visualize a set of coordinate frames.

Naming for all scene nodes are hierarchical; /tree/branch, for example, is defined
relative to /tree.



.. code-block:: python
:linenos:
import random
import time
import viser
server = viser.ViserServer()
while True:
# Add some coordinate frames to the scene. These will be visualized in the viewer.
server.scene.add_frame(
"/tree",
wxyz=(1.0, 0.0, 0.0, 0.0),
position=(random.random() * 2.0, 2.0, 0.2),
)
server.scene.add_frame(
"/tree/branch",
wxyz=(1.0, 0.0, 0.0, 0.0),
position=(random.random() * 2.0, 2.0, 0.2),
)
leaf = server.scene.add_frame(
"/tree/branch/leaf",
wxyz=(1.0, 0.0, 0.0, 0.0),
position=(random.random() * 2.0, 2.0, 0.2),
)
time.sleep(5.0)
# Remove the leaf node from the scene.
leaf.remove()
time.sleep(0.5)
61 changes: 61 additions & 0 deletions versions/0.2.19/_sources/examples/01_image.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.. Comment: this file is automatically generated by `update_example_docs.py`.
It should not be modified manually.
Images
==========================================


Example for sending images to the viewer.

We can send backgrond images to display behind the viewer (useful for visualizing
NeRFs), or images to render as 3D textures.



.. code-block:: python
:linenos:
import time
from pathlib import Path
import imageio.v3 as iio
import numpy as np
import viser
def main() -> None:
server = viser.ViserServer()
# Add a background image.
server.scene.set_background_image(
iio.imread(Path(__file__).parent / "assets/Cal_logo.png"),
format="png",
)
# Add main image.
server.scene.add_image(
"/img",
iio.imread(Path(__file__).parent / "assets/Cal_logo.png"),
4.0,
4.0,
format="png",
wxyz=(1.0, 0.0, 0.0, 0.0),
position=(2.0, 2.0, 0.0),
)
while True:
server.scene.add_image(
"/noise",
np.random.randint(0, 256, size=(400, 400, 3), dtype=np.uint8),
4.0,
4.0,
format="jpeg",
wxyz=(1.0, 0.0, 0.0, 0.0),
position=(2.0, 2.0, -1e-2),
)
time.sleep(0.2)
if __name__ == "__main__":
main()
Loading

0 comments on commit 994a343

Please sign in to comment.