Skip to content

Commit

Permalink
deploy: 8760e48
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Aug 29, 2024
1 parent 452a184 commit fce4deb
Show file tree
Hide file tree
Showing 169 changed files with 113,218 additions and 0 deletions.
4 changes: 4 additions & 0 deletions versions/0.2.4/.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: ffe18ab041802816329183a4ddfa3813
tags: d77d1c0d9ca2f4c8421862c7c5a0d620
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/client_handles.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/conventions.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/development.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/environment.pickle
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/events.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/examples/02_gui.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/examples/06_mesh.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 added versions/0.2.4/.doctrees/extras.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/gui_api.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/gui_handles.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/icons.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/index.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/infrastructure.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/scene_api.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/scene_handles.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/server.doctree
Binary file not shown.
Binary file added versions/0.2.4/.doctrees/transforms.doctree
Binary file not shown.
Empty file added versions/0.2.4/.nojekyll
Empty file.
399 changes: 399 additions & 0 deletions versions/0.2.4/_modules/index.html

Large diffs are not rendered by default.

1,948 changes: 1,948 additions & 0 deletions versions/0.2.4/_modules/viser/_gui_api/index.html

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

512 changes: 512 additions & 0 deletions versions/0.2.4/_modules/viser/_notification_handle/index.html

Large diffs are not rendered by default.

1,945 changes: 1,945 additions & 0 deletions versions/0.2.4/_modules/viser/_scene_api/index.html

Large diffs are not rendered by default.

794 changes: 794 additions & 0 deletions versions/0.2.4/_modules/viser/_scene_handles/index.html

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

524 changes: 524 additions & 0 deletions versions/0.2.4/_modules/viser/extras/_record3d/index.html

Large diffs are not rendered by default.

552 changes: 552 additions & 0 deletions versions/0.2.4/_modules/viser/extras/_urdf/index.html

Large diffs are not rendered by default.

985 changes: 985 additions & 0 deletions versions/0.2.4/_modules/viser/infra/_infra/index.html

Large diffs are not rendered by default.

576 changes: 576 additions & 0 deletions versions/0.2.4/_modules/viser/infra/_messages/index.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

747 changes: 747 additions & 0 deletions versions/0.2.4/_modules/viser/transforms/_base/index.html

Large diffs are not rendered by default.

682 changes: 682 additions & 0 deletions versions/0.2.4/_modules/viser/transforms/_se2/index.html

Large diffs are not rendered by default.

647 changes: 647 additions & 0 deletions versions/0.2.4/_modules/viser/transforms/_se3/index.html

Large diffs are not rendered by default.

569 changes: 569 additions & 0 deletions versions/0.2.4/_modules/viser/transforms/_so2/index.html

Large diffs are not rendered by default.

910 changes: 910 additions & 0 deletions versions/0.2.4/_modules/viser/transforms/_so3/index.html

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions versions/0.2.4/_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.4/_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.4/_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.4/_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.4/_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.4/_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)
65 changes: 65 additions & 0 deletions versions/0.2.4/_sources/examples/01_image.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.. 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 onp
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",
onp.random.randint(
0,
256,
size=(400, 400, 3),
dtype=onp.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 fce4deb

Please sign in to comment.