Browse Source

Fix rerun-viewer example. (#989)

### Summary

This example had two issues:
- the path to the dora rerun executable in the dataflow file was wrongly
set
- it wasn't able to be run via cargo run command (only using uv
installation + dora build + dora run)

### Test it
via cargo run:

`cargo run --example rerun-viewer`

via uv setup:
```
uv venv -p 3.11 --seed
uv pip install -e ../../apis/python/node --reinstall
dora build dataflow.yml --uv
dora run dataflow.yml --uv
```
tags/v0.3.12-rc0
Haixuan Xavier Tao GitHub 8 months ago
parent
commit
fd05e0b530
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
3 changed files with 15 additions and 5 deletions
  1. +4
    -0
      Cargo.toml
  2. +1
    -1
      examples/rerun-viewer/dataflow.yml
  3. +10
    -4
      examples/rerun-viewer/run.rs

+ 4
- 0
Cargo.toml View File

@@ -182,6 +182,10 @@ name = "cxx-ros2-dataflow"
path = "examples/c++-ros2-dataflow/run.rs"
required-features = ["ros2-examples"]

[[example]]
name = "rerun-viewer"
path = "examples/rerun-viewer/run.rs"

# The profile that 'dist' will build with
[profile.dist]
inherits = "release"


+ 1
- 1
examples/rerun-viewer/dataflow.yml View File

@@ -14,7 +14,7 @@ nodes:

- id: rerun
build: cargo build -p dora-rerun --release
path: dora-rerun
path: ../../target/release/dora-rerun
inputs:
image: camera/image
env:


+ 10
- 4
examples/rerun-viewer/run.rs View File

@@ -5,7 +5,7 @@ use std::path::Path;

#[tokio::main]
async fn main() -> eyre::Result<()> {
set_up_tracing("python-dataflow-runner")?;
set_up_tracing("rerun-viewer-runner")?;

let root = Path::new(env!("CARGO_MANIFEST_DIR"));
std::env::set_current_dir(root.join(file!()).parent().unwrap())
@@ -13,18 +13,24 @@ async fn main() -> eyre::Result<()> {

let uv = get_uv_path().context("Could not get uv binary")?;

run(&uv, &["venv", "-p", "3.10", "--seed"], None)
run(&uv, &["venv", "-p", "3.11", "--seed"], None)
.await
.context("failed to create venv")?;
run(
&uv,
&["pip", "install", "-e", "../../apis/python/node", "--reinstall"],
&[
"pip",
"install",
"-e",
"../../apis/python/node",
"--reinstall",
],
None,
)
.await
.context("Unable to install develop dora-rs API")?;

let dataflow = Path::new("qwen2-5-vl-vision-only-dev.yml");
let dataflow = Path::new("dataflow.yml");
run_dataflow(dataflow).await?;

Ok(())


Loading…
Cancel
Save