-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Open the PR up as a draft until you feel it is ready for a proper review. Do not make PR:s from your own `main` branch, as that makes it difficult for reviewers to add their own fixes. Add any improvements to the branch as new commits to make it easier for reviewers to follow the progress. All commits will be squashed to a single commit once the PR is merged into `main`. Make sure you mention any issues that this PR closes in the description, as well as any other related issues. To get an auto-generated PR description you can put "copilot:summary" or "copilot:walkthrough" anywhere. --> ### What Closes #2313 ### Checklist * [ ] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [ ] I've included a screenshot or gif (if applicable) <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2392 <!-- pr-link-docs:start --> Docs preview: https://rerun.io/preview/139360d/docs Examples preview: https://rerun.io/preview/139360d/examples <!-- pr-link-docs:end --> --------- Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
- Loading branch information
Showing
9 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Template | ||
tags: [kebab-case, comma, separated] | ||
python: https://github.com/rerun-io/rerun/tree/latest/examples/python/template/main.py | ||
rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/template/src/main.rs | ||
--- | ||
|
||
<!-- | ||
Place a screenshot in place of this comment | ||
Use `just upload --help` for instructions | ||
--> | ||
|
||
This is an example example. It is not a real example. You can duplicate the directory and use it as a starting point for writing a real example. | ||
|
||
```bash | ||
pip install -r examples/python/template/requirements.txt | ||
python examples/python/template/main.py | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
Example template. | ||
Run: | ||
```sh | ||
pip install -r examples/python/template/requirements.txt | ||
python examples/python/template/main.py | ||
``` | ||
""" | ||
from __future__ import annotations | ||
|
||
import argparse | ||
|
||
import rerun as rr # pip install rerun-sdk | ||
|
||
|
||
def main() -> None: | ||
parser = argparse.ArgumentParser(description="Example of using the Rerun visualizer") | ||
rr.script_add_args(parser) | ||
args = parser.parse_args() | ||
|
||
rr.script_setup(args, "my_example_name") | ||
|
||
# ... example code | ||
|
||
rr.script_teardown(args) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rerun-sdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "template" | ||
version = "0.7.0-alpha.0" | ||
edition = "2021" | ||
rust-version = "1.69" | ||
license = "MIT OR Apache-2.0" | ||
publish = false | ||
|
||
[dependencies] | ||
rerun = { path = "../../../crates/rerun", features = ["native_viewer"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Template | ||
tags: [kebab-case, comma, separated] | ||
python: https://github.com/rerun-io/rerun/tree/latest/examples/python/template/main.py | ||
rust: https://github.com/rerun-io/rerun/tree/latest/examples/rust/template/src/main.rs | ||
--- | ||
|
||
<!-- | ||
Place a screenshot in place of this comment | ||
Use `just upload --help` for instructions | ||
--> | ||
|
||
This is an example example. It is not a real example. You can duplicate the directory and use it as a starting point for writing a real example. | ||
|
||
```bash | ||
cargo run --release -p template | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//! Example template. | ||
use rerun::RecordingStreamBuilder; | ||
|
||
fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
let (rec_stream, storage) = RecordingStreamBuilder::new("my_example_name").memory()?; | ||
|
||
let _ = rec_stream; | ||
|
||
// ... example code | ||
|
||
rerun::native_viewer::show(storage.take())?; | ||
|
||
Ok(()) | ||
} |