Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alik-git committed Jan 6, 2025
1 parent 9c0e0e9 commit 2b0d7f3
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ cd /tmp
wget https://github.com/protocolbuffers/protobuf/releases/download/v28.3/protoc-28.3-linux-x86_64.zip
unzip protoc-28.3-linux-x86_64.zip
sudo cp bin/protoc /usr/local/bin/protoc
```
```

#### Install the Rerun Viewer

Instructions [here](https://rerun.io/docs/getting-started/installing-viewer#installing-the-viewer).

#### Build the krecviz Rust library

Expand Down Expand Up @@ -68,20 +72,49 @@ krecviz.viz(

### Rust

You can either run krecviz_rust as a standalone CLI or call its functionality directly as a library.

#### 1) CLI usage (via cargo run)
```bash
# cd to the repo root
cd krecviz_rust
cargo run -- \
--urdf ../tests/assets/urdf_examples/gpr/robot.urdf \
--krec ../tests/assets/krec_examples/actuator_22_right_arm_shoulder_roll_movement.krec


# run in debug mode
RUST_LOG=krecviz_rust=debug cargo run -- \
RUST_LOG=krecviz_rust=debug cargo run -- \
--urdf ../tests/assets/urdf_examples/gpr/robot.urdf \
--krec ../tests/assets/krec_examples/actuator_22_right_arm_shoulder_roll_movement.krec
```

#### 2) Using the library from another Rust project
We haven't published the krecviz_rust crate yet, so you need to add it as a dependency in your Cargo.toml:

```toml
[dependencies]
krecviz_rust = { path = "../krecviz_rust" }
```

Then simply call `viz`:

```rust
use anyhow::Result;
use krecviz_rust::viz;

fn main() -> Result<()> {
viz(
Some("path/to/robot.urdf"),
Some("path/to/robot.krec"),
Some("path/to/output.rrd"), // optional
)?;

Ok(())
}
```

You can leave any of the arguments as `None` if you don't have them (e.g., no .rrd output).

## Tests

### Python
Expand Down

0 comments on commit 2b0d7f3

Please sign in to comment.