Skip to content

Commit

Permalink
Update documentation and make minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrozycki committed Nov 18, 2023
1 parent 3f74d23 commit ab74511
Show file tree
Hide file tree
Showing 62 changed files with 223 additions and 137 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: clippy
- name: Clippy webapi with websocket and visualiser
- name: Clippy webapi with websocket
uses: actions-rs/cargo@v1
with:
command: clippy
args: -p rustmas-webapi --features websocket,visualiser
args: -p rustmas-webapi --features websocket
- name: Test
uses: actions-rs/cargo@v1
with:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/target
/plugins
**/captures

*.csv
Expand Down
18 changes: 7 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Utilities for putting smart Christmas lights on your Christmas tree, written in
[Matt Parker's xmastree](https://github.com/standupmaths/xmastree2020).

The interface for controlling lights is provided by [pico-w-neopixel-server](https://github.com/krzmaz/pico-w-neopixel-server/),
which is meant to be installed on a RaspberryPi Pico W. You can use local visualiser
which is meant to be installed on a RaspberryPi Pico W. You can use local visualizer
for testing purposes.

## Demo (YouTube)
Expand All @@ -21,24 +21,20 @@ Local development setup
* Rust toolkit (see [rustup](http://rustup.rs))
* dependencies installed (see [Workflow file](.github/workflows/rust.yml) for what to install on Ubuntu)
* (optionally) programmable lights set up with [pico-w-neopixel-server](http://github.com/krzmaz/pico-w-neopixel-server),
or you can use the OpenGL visualiser instead
or you can use our visualizer instead

### Setting up your lights

If you are using physical lights, you need to connect them to a Raspberry Pi Pico W running
[pico-w-neopixel-server](http://github.com/krzmaz/pico-w-neopixel-server), and configure their
[pico-w-neopixel-server](http://github.com/krzmaz/pico-w-neopixel-server) or
[pico-usb-neopixel-driver](https://github.com/krzmaz/pico-usb-neopixel-driver), and configure their
positions using [our configurator](configurator/README.md). This will produce a CSV file with light
positions. Alternatively you can use the visualiser for testing with the [example CSV file](lights.csv.example).
positions. Alternatively you can use the visualizer for testing with the [example CSV file](lights.csv.example).

### Running code locally

The easiest option to test an animation is to run it with [animator-cli](animator/README.md).
This might be the better option for quick testing, although it does not support switching animations
or changing its parameters.

The alternative is to run the whole [web application](webapi/README.md) locally. This is slightly
more involved, but will allow you to quickly switch between animations and test your animation's
parameters.
The easiest way to test your animations is to run our [web application](webapi/README.md) locally.
You can use either physical lights or our visualizer.

### Git hooks

Expand Down
5 changes: 0 additions & 5 deletions animator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name = "rustmas-animator"
version = "0.1.0"
edition = "2021"

[[bin]]
name = "animator-cli"
path = "src/cli.rs"

[dependencies]
rustmas-light-client = { path = "../light-client", default-features = false }
lightfx = { path = "../lightfx" }
Expand All @@ -27,5 +23,4 @@ thiserror = "1.0.40"

[features]
default = []
visualiser = ["rustmas-light-client/visualiser"]
websocket = ["rustmas-light-client/websocket"]
29 changes: 0 additions & 29 deletions animator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,3 @@ Rustmas Animator
================

Rustmas Animator is the library that controls animations on Rustmas lights.

Animator CLI
------------

In order to run the Animator CLI, you will need a CSV file with light positions.
The default file name is `lights.csv`, but you can provide a different one
using the `-p` option.

In order to run an animation `rainbow_waterfall` in a visualiser:

```
$ cargo run --bin animator-cli -- -a rainbow_waterfall
```

With your own light positions file:

```
$ cargo run --bin animator-cli -- -a rainbow_waterfall -p my_lights.csv
```

Or on physical lights (remember to provide correct IP address!):

```
$ cargo run --bin animator-cli -- -a rainbow_waterfall -l http://127.0.0.1/pixels
```

There is currently no way to provide parameters for the animation through
Animator CLI. If you would like to test your animation's parameters, use
the rustmas [web application](../webapi/README.md).
41 changes: 0 additions & 41 deletions animator/src/cli.rs

This file was deleted.

28 changes: 10 additions & 18 deletions bevy-visualizer/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
# Rustmas Visualizer

## Running
native:

You can run the visualizer with:

```
cargo run [--release] --bin rustmas-bevy-visualizer
```
or WASM:
```
# once:
cargo install wasm-server-runner

# then:
cargo run --profile wasm-release --target wasm32-unknown-unknown --bin rustmas-bevy-visualizer
```
## Controls
- RMB: Orbit camera
- MMB: Pan camera
- Scroll: Zoom camera
Visualizer needs to be started before WebAPI.

## Next steps

Investigate if this gives better rendering on WASM:
https://github.com/mrk-its/bevy_webgl2
## Controls

Mouse picking of entities (should be useful to set colors via visualizer):
https://github.com/aevyrie/bevy_mod_picking
You can control the view of the visualizer with your mouse. Scroll to zoom,
move your mouse while holding left mouse button to move, move your mouse while
holding right mouse button to rotate the view.
35 changes: 35 additions & 0 deletions plugins/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Animations plugins directory

Animations for Rustmas are provided in a form of plugins. They can be added, removed
and modified in place even while webapi is running. Plugins should be stored in a single
directory. This directory is an example of a plugin directory, containing configuration
for all the plugins provided by this repository. You can use it as is, once you buiild
all the plugins with:

```
cargo build --release -p animations
```

**Note:** adding a new animation will require you to refresh animation list by clicking
"Refresh" in WebUI. Modifying an existing animation will require reloading it by either
clicking "Reload" in WebUI, or switching to a different animation and back.

Each plugin has its own directory within the plugins dir, with the following structure:

```
my-animation/
manifest.json
plugin
```

`manifest.json` contains plugin metadata and looks like this:

```json
{
"display_name": "My Animation"
}
```

`plugin` is a binary file (or a symbolic link to one), which conforms to the animation
plugin contract. The easiest way to create one is to start with the [animation template](../animation-template),
which will produce the appropriate binary when compiled.
3 changes: 3 additions & 0 deletions plugins/audio-visualiser/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Audio visualiser"
}
1 change: 1 addition & 0 deletions plugins/audio-visualiser/plugin
3 changes: 3 additions & 0 deletions plugins/audio-wave/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Audio wave"
}
1 change: 1 addition & 0 deletions plugins/audio-wave/plugin
3 changes: 3 additions & 0 deletions plugins/barber-pole/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Barber Pole"
}
1 change: 1 addition & 0 deletions plugins/barber-pole/plugin
3 changes: 3 additions & 0 deletions plugins/beats/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Beats"
}
1 change: 1 addition & 0 deletions plugins/beats/plugin
3 changes: 3 additions & 0 deletions plugins/circle-boom/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Circle Boom"
}
1 change: 1 addition & 0 deletions plugins/circle-boom/plugin
3 changes: 3 additions & 0 deletions plugins/circle-grid/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Circle grid"
}
1 change: 1 addition & 0 deletions plugins/circle-grid/plugin
3 changes: 3 additions & 0 deletions plugins/circle-wave/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Circle wave"
}
1 change: 1 addition & 0 deletions plugins/circle-wave/plugin
3 changes: 3 additions & 0 deletions plugins/classic/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Classic"
}
1 change: 1 addition & 0 deletions plugins/classic/plugin
3 changes: 3 additions & 0 deletions plugins/event-test/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Event test"
}
1 change: 1 addition & 0 deletions plugins/event-test/plugin
3 changes: 3 additions & 0 deletions plugins/heartbeat/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Heartbeat"
}
1 change: 1 addition & 0 deletions plugins/heartbeat/plugin
3 changes: 3 additions & 0 deletions plugins/lightspeed/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Lightspeed"
}
1 change: 1 addition & 0 deletions plugins/lightspeed/plugin
3 changes: 3 additions & 0 deletions plugins/manual-sweep/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "TEST: Manual sweep"
}
1 change: 1 addition & 0 deletions plugins/manual-sweep/plugin
3 changes: 3 additions & 0 deletions plugins/moon/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Moon"
}
1 change: 1 addition & 0 deletions plugins/moon/plugin
3 changes: 3 additions & 0 deletions plugins/particle-fire/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Particle Fire"
}
1 change: 1 addition & 0 deletions plugins/particle-fire/plugin
3 changes: 3 additions & 0 deletions plugins/pillars/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Pillars"
}
1 change: 1 addition & 0 deletions plugins/pillars/plugin
3 changes: 3 additions & 0 deletions plugins/rainbow-cable/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Rainbow Cable"
}
1 change: 1 addition & 0 deletions plugins/rainbow-cable/plugin
3 changes: 3 additions & 0 deletions plugins/rainbow-cylinder/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Rainbow Cylinder"
}
1 change: 1 addition & 0 deletions plugins/rainbow-cylinder/plugin
3 changes: 3 additions & 0 deletions plugins/rainbow-halves/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Rainbow Halves"
}
1 change: 1 addition & 0 deletions plugins/rainbow-halves/plugin
3 changes: 3 additions & 0 deletions plugins/rainbow-sphere/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Rainbow Sphere"
}
1 change: 1 addition & 0 deletions plugins/rainbow-sphere/plugin
3 changes: 3 additions & 0 deletions plugins/rainbow-spiral/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Rainbow Spiral"
}
1 change: 1 addition & 0 deletions plugins/rainbow-spiral/plugin
3 changes: 3 additions & 0 deletions plugins/rainbow-waterfall/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Rainbow Waterfall"
}
1 change: 1 addition & 0 deletions plugins/rainbow-waterfall/plugin
3 changes: 3 additions & 0 deletions plugins/random-sweep/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Random Sweep"
}
1 change: 1 addition & 0 deletions plugins/random-sweep/plugin
3 changes: 3 additions & 0 deletions plugins/single-color/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Single Color"
}
1 change: 1 addition & 0 deletions plugins/single-color/plugin
3 changes: 3 additions & 0 deletions plugins/spinning-halves/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"display_name": "Spinning Halves"
}
1 change: 1 addition & 0 deletions plugins/spinning-halves/plugin
1 change: 0 additions & 1 deletion webapi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,4 @@ env_logger = "0.10.0"

[features]
default = []
visualiser = ["rustmas-animator/visualiser"]
websocket = ["rustmas-animator/websocket"]
Loading

0 comments on commit ab74511

Please sign in to comment.