Expand description
Rerun - log point clouds, images, etc and visualize them effortlessly
Add the rerun
library to your crate with cargo add rerun
.
There is also a rerun
binary.
The binary is required in order to stream log data
over the networks, and to open our .rrd
data files.
If you need it, install the rerun
binary with cargo install rerun-cli
.
Feature flags
-
analytics
(enabled by default) — Enable telemetry using our analytics SDK. -
demo
(enabled by default) — Demo helpers for examples. -
glam
(enabled by default) — Add support for some math operations usingglam
. Only relevant if featuresdk
is enabled. -
image
(enabled by default) — Integration with theimage
crate, plus JPEG support.. -
native_viewer
— Support spawning a native viewer. This adds a lot of extra dependencies, so only enable this feature if you need it! -
server
(enabled by default) — Support for running a TCP server that listens to incoming log messages from a Rerun SDK. -
sdk
(enabled by default) — Embed the Rerun SDK and re-export all of its public symbols. -
web_viewer
— Support serving a web viewer over HTTP.Enabling this inflates the binary size quite a bit, since it embeds the viewer wasm.
For faster & easier builds, the web-player build comes bundled with the crate. Enabling this feature will embed this pre-built web-player.
However, when building from source in the repository, this feature adds quite a bit to the compile time since it requires compiling and bundling the viewer as wasm. You also need to install some additional tools, which you can do by running
scripts/setup_web.sh
.
Links
There are many different ways of sending data to the Rerun Viewer depending on what you’re trying to achieve and whether the viewer is running in the same process as your code, in another process, or even as a separate web application.
Checkout SDK Operating Modes for an overview of what’s possible and how.
If you get stuck on anything, open an issue at https://github.com/rerun-io/rerun/issues. You can also ask questions on the Rerun Discord.
Using the rerun
library
Logging
let rec_stream = rerun::RecordingStreamBuilder::new("my_app").buffered()?;
let points: Vec<rerun::components::Point3D> = positions();
let colors: Vec<rerun::components::Color> = colors();
let image: image::DynamicImage = capture_image();
rerun::MsgSender::new("points")
.with_component(&points)?
.with_component(&colors)?
.send(&rec_stream)?;
rerun::MsgSender::new("image")
.with_component(&[rerun::components::Tensor::from_image(image)?])?
.send(&rec_stream)?;
See RecordingStream
and MsgSender
for details.
Streaming
To stream log data to an awaiting rerun
process, you can do this:
Start rerun
in a terminal by just running rerun
.
Then do this:
let rec_stream = rerun::RecordingStreamBuilder::new("my_app")
.connect(rerun::default_server_addr(), rerun::default_flush_timeout());
Buffering
let (rec_stream, storage) = rerun::RecordingStreamBuilder::new("my_app").memory()?;
log_using(&rec_stream);
rerun::native_viewer::show(storage.take());
Binary
The rerun
binary is required in order to stream log data
over the networks, and to open our .rrd
data files.
The binary can act either as a server, a viewer, or both, depending on which options you use when you start it.
cargo install rerun
rerun --help
Modules
- These are the different components you can log.
- Coordinate system helpers, for use with
components::ViewCoordinates
. - This module contains utilities to support Rerun examples.
- Re-exports of other crates.
- Things directly related to logging.
- Methods for spawning the native viewer and streaming the SDK log stream to it.
- Different destinations for log messages.
- Time-related types.
- Transform helpers, for use with
components::Transform3D
. - Methods for spawning the web viewer and streaming the SDK log stream to it.
Structs
- The user-chosen name of the application doing the logging.
- The name of an entity component, e.g.
pos
orcolor
. camera / "left" / points / #42
- Facilitates building and sending component payloads with the Rerun SDK.
- A
RecordingStream
handles everything related to logging data into Rerun. - Construct a
RecordingStream
. - A unique id per store.
Enums
- Where are we calling
run
from? - Errors that can occur when constructing or sending messages using
MsgSender
. - What kind of Store this is.
Traits
- A type that can used as a Component of an Entity.
- Anything that can be serialized to and deserialized from Arrow data.
Functions
- The version of the Rerun SDK.
- Check whether we are the child of a fork.
- Checks the
RERUN
environment variable. If not found, returns the argument. - The default amount of time to wait for the TCP connection to resume during a flush
- The default address of a Rerun TCP server which an SDK connects to.
- Creates a new
re_log_types::StoreInfo
which can be used withRecordingStream::new
. - Run the Rerun application and return an exit code.