diff --git a/Cargo.lock b/Cargo.lock index 62a123c2c16b..a6e95f923a30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -906,6 +906,13 @@ dependencies = [ "objc", ] +[[package]] +name = "code_examples" +version = "0.7.0-alpha.0" +dependencies = [ + "rerun", +] + [[package]] name = "codespan-reporting" version = "0.11.1" diff --git a/Cargo.toml b/Cargo.toml index e7eed603ba1d..4682ef04f454 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ resolver = "2" members = [ "crates/*", "examples/rust/*", + "docs/code-examples", "rerun_py", "run_wasm", "tests/rust/*", diff --git a/docs/code-examples/Cargo.toml b/docs/code-examples/Cargo.toml new file mode 100644 index 000000000000..c55006e4bd65 --- /dev/null +++ b/docs/code-examples/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "code_examples" +version = "0.7.0-alpha.0" +edition = "2021" +rust-version = "1.69" +license = "MIT OR Apache-2.0" +publish = false + +[[bin]] +name = 'point2d_simple' +path = 'point2d_simple.rs' + +[dependencies] +rerun = { path = "../../crates/rerun", features = ["native_viewer"] } diff --git a/docs/code-examples/point2d_random.py b/docs/code-examples/point2d_random.py new file mode 100644 index 000000000000..217bab7d3f1e --- /dev/null +++ b/docs/code-examples/point2d_random.py @@ -0,0 +1,15 @@ +"""Log some random points with color and radii.""" +import rerun as rr +from numpy.random import default_rng + +rr.init("points", spawn=True) +rng = default_rng(12345) + +positions = rng.uniform(-3, 3, size=[10, 2]) +colors = rng.uniform(0, 255, size=[10, 3]) +radii = rng.uniform(0, 1, size=[10]) + +rr.log_points("random", positions=positions, colors=colors, radii=radii) + +# Log an extra rect to set the view bounds +rr.log_rect("bounds", [0, 0, 8, 6], rect_format=rr.RectFormat.XCYCWH) diff --git a/docs/code-examples/point2d_simple.py b/docs/code-examples/point2d_simple.py new file mode 100644 index 000000000000..b92580d6f51e --- /dev/null +++ b/docs/code-examples/point2d_simple.py @@ -0,0 +1,9 @@ +"""Log some very simple points.""" +import rerun as rr + +rr.init("points", spawn=True) + +rr.log_points("simple", positions=[[0, 0], [1, 1]]) + +# Log an extra rect to set the view bounds +rr.log_rect("bounds", [0, 0, 4, 3], rect_format=rr.RectFormat.XCYCWH) diff --git a/docs/code-examples/point2d_simple.rs b/docs/code-examples/point2d_simple.rs new file mode 100644 index 000000000000..ed3787d621a6 --- /dev/null +++ b/docs/code-examples/point2d_simple.rs @@ -0,0 +1,29 @@ +//! Log some very simple points. +use rerun::{ + components::{Point2D, Rect2D, Vec4D}, + MsgSender, RecordingStreamBuilder, +}; + +fn main() -> Result<(), Box> { + let (rec_stream, storage) = RecordingStreamBuilder::new("points").memory()?; + + let points = [[0.0, 0.0], [1.0, 1.0]] + .into_iter() + .map(Point2D::from) + .collect::>(); + + MsgSender::new("points") + .with_component(&points)? + .send(&rec_stream)?; + + // Log an extra rect to set the view bounds + MsgSender::new("bounds") + .with_component(&[Rect2D::XCYCWH(Vec4D([0.0, 0.0, 4.0, 3.0]))])? + .send(&rec_stream)?; + + rec_stream.flush_blocking(); + + rerun::native_viewer::show(storage.take())?; + + Ok(()) +} diff --git a/docs/code-examples/point3d_random.py b/docs/code-examples/point3d_random.py new file mode 100644 index 000000000000..9e9af5b7da05 --- /dev/null +++ b/docs/code-examples/point3d_random.py @@ -0,0 +1,12 @@ +"""Log some random points with color and radii.""" +import rerun as rr +from numpy.random import default_rng + +rr.init("points", spawn=True) +rng = default_rng(12345) + +positions = rng.uniform(-5, 5, size=[10, 3]) +colors = rng.uniform(0, 255, size=[10, 3]) +radii = rng.uniform(0, 1, size=[10]) + +rr.log_points("random", positions=positions, colors=colors, radii=radii) diff --git a/docs/code-examples/point3d_simple.py b/docs/code-examples/point3d_simple.py new file mode 100644 index 000000000000..377c2c3b471b --- /dev/null +++ b/docs/code-examples/point3d_simple.py @@ -0,0 +1,6 @@ +"""Log some very simple points.""" +import rerun as rr + +rr.init("points", spawn=True) + +rr.log_points("simple", positions=[[0, 0, 0], [1, 1, 1]]) diff --git a/docs/content/concepts/entity-component.md b/docs/content/concepts/entity-component.md index 050a7c46bbed..7b981e4b2597 100644 --- a/docs/content/concepts/entity-component.md +++ b/docs/content/concepts/entity-component.md @@ -32,9 +32,9 @@ Primitives do not have any significance to the data model itself, but are import how data should be displayed. The assorted logging APIs all simply set different combinations of components on some specified entity, and the -corresponding space views look for entities with these components in the data store. +corresponding space views look for entities with these components in the data store. For more information on the different primitives and how they relate to components see the -[Primitives reference](../reference/primitives.md). +[Data Types](../reference/data_types.md) reference. ### Extension Components Your entity could have any number of other components as well. This isn't a problem. Any components that @@ -51,7 +51,7 @@ code-example: extension-components ### Empty Entities An Entity, without Components, is nothing more than an identity (represented by its Entity Path). It contains no data, and has no type. When you log a piece of data, all that you are doing is setting the values -of one or more *Components* associated with that *Entity*. +of one or more *Components* associated with that *Entity*. ## ECS Systems In most ECS architectures, there is a third concept we haven't touched on: Systems are processes which operate on the diff --git a/docs/content/getting-started/viewer-walkthrough.md b/docs/content/getting-started/viewer-walkthrough.md index 301ca04a2fca..3a25e04f7d01 100644 --- a/docs/content/getting-started/viewer-walkthrough.md +++ b/docs/content/getting-started/viewer-walkthrough.md @@ -112,12 +112,12 @@ Feel free to move the views around until you are happy with the layout. ## Exploring data The space views are where you can see the data that was actually logged. This scene has streams of data for 6 different primitives, also known as [entities](../concepts/entity-component.md): -* [images](../reference/primitives.md#tensors--images) that were captured from a camera. -* [2d keypoints](../reference/primitives.md#point-2d) that were detected and tracked in those images. -* a [camera](../reference/primitives.md#pinhole) model that describes the relationship between 2D and 3D space. -* [3d points](../reference/primitives.md#point-3d) that were computed by the COLMAP slam pipeline. -* A sequence of [transforms](../reference/primitives.md#rigid3d) describing the 3D location of the camera in space. -* A [scalar](../reference/primitives.md#scalar) error metric that was computed by the algorithm for each frame. +* [images](../reference/data_types/image.md) that were captured from a camera. +* [2d keypoints](../reference/data_types/point2d.md) that were detected and tracked in those images. +* a [pinhole](../reference/data_types/pinhole.md) camera model that describes the relationship between 2D and 3D space. +* [3d points](../reference/data_types/point3d.md) that were computed by the COLMAP slam pipeline. +* A sequence of [transforms](../reference/data_types/transform3d.md) describing the 3D location of the camera in space. +* A [scalar](../reference/data_types/scalar.md) error metric that was computed by the algorithm for each frame. ### Hover and selection You can find out more about these entities by hovering over them in the different views. Hovering will bring up a @@ -237,7 +237,6 @@ car. Leave the visible history with a value of 50. viewer walkthrough adjusting visible history screenshot -) ### Modifying the contents of a space view Now select the `/ (Spatial)` view itself. We will start by giving this space view a different name. At the very diff --git a/docs/content/howto/ros2-nav-turtlebot.md b/docs/content/howto/ros2-nav-turtlebot.md index 8cf444b5a57e..8108d1bc0e37 100644 --- a/docs/content/howto/ros2-nav-turtlebot.md +++ b/docs/content/howto/ros2-nav-turtlebot.md @@ -2,10 +2,10 @@ title: Using Rerun with ROS 2 order: 2 ogImageUrl: /docs-media/og-howto-ros.jpg -description: Rerun does not yet have native ROS support, but many of the concepts in ROS and Rerun line up fairly well. In this guide, you will learn how to write a simple ROS 2 python node that subscribes to some common ROS topics and logs them to Rerun. +description: Rerun does not yet have native ROS support, but many of the concepts in ROS and Rerun line up fairly well. In this guide, you will learn how to write a simple ROS 2 python node that subscribes to some common ROS topics and logs them to Rerun. --- -Rerun does not yet have native ROS support, but many of the concepts in ROS and Rerun +Rerun does not yet have native ROS support, but many of the concepts in ROS and Rerun line up fairly well. In this guide, you will learn how to write a simple ROS 2 python node that subscribes to some common ROS topics and logs them to Rerun. @@ -103,17 +103,17 @@ the environment. If you are familiar with the turtlebot nav example and rviz, this view will likely be familiar: * `map/box` is a placeholder for the map. (This will eventually be a map: [#1531](https://github.com/rerun-io/rerun/issues/1531).) - * `map/robot` is a transform representing the robot pose logged as a [rigid3 transform](../reference/primitives.md#transform). - * `map/robot/urdf` contains the `URDF` logged as a [mesh3d](../reference/primitives.md#mesh). - * `map/robot/scan` contains a `LaserScan` msg logged as a [linestrip3d](../reference/primitives.md#line-3d). (This will eventually be a + * `map/robot` is a transform representing the robot pose logged as a rigid [transform3d](../reference/data_types/transform3d.md). + * `map/robot/urdf` contains the `URDF` logged as a [mesh](../reference/data_types/mesh.md). + * `map/robot/scan` contains a `LaserScan` msg logged as a [linestrip3d](../reference/data_types/linestrip3d.md). (This will eventually be a native type: [#1534](https://github.com/rerun-io/rerun/issues/1534).) - * `map/robot/camera` contains a `CameraInfo` msg logged as a [pinhole transform](../reference/primitives.md#transform). - * `map/robot/camera/img` contains an `Image` msg logged as an [image](../reference/primitives.md#tensors--images). - * `map/robot/camera/points` contains a `PointCloud2` msg logged as a [point3d batch](../reference/primitives.md#point-3d). + * `map/robot/camera` contains a `CameraInfo` msg logged as a [pinhole](../reference/data_types/pinhole.md) transform. + * `map/robot/camera/img` contains an `Image` msg logged as an [image](../reference/data_types/image.md). + * `map/robot/camera/points` contains a `PointCloud2` msg logged as a [point3d](../reference/data_types/point3d.md). * `map/points` contains a second copy of `PointCloud2` with a different transform. (This is a workaround until Rerun has support for ROS-style fixed frames [#1522](https://github.com/rerun-io/rerun/issues/1522).) - * `odometry/vel` is a plot of the linear velocity of the robot. - * `odometry/ang_vel` is a plot of the angular velocity of the robot. + * `odometry/vel` is a plot of the linear velocity of the robot logged as a [scalar](../reference/data_types/scalar.md). + * `odometry/ang_vel` is a plot of the angular velocity of the robot logged as a [scalar](../reference/data_types/scalar.md). ## Code Explanation @@ -121,7 +121,7 @@ It may be helpful to open [rerun/examples/python/ros_node/main.py](https://githu to follow along. Outside of TF, the node is mostly stateless. At a very high level, for each ROS message we are interested in, we create a -subscriber with a callback that does some form of data transformation and then logs the data to Rerun. +subscriber with a callback that does some form of data transformation and then logs the data to Rerun. For simplicity, this example uses the rosclpy `MultiThreadedExecutor` and `ReentrantCallbackGroup` for each topic. This allows each callback thread to do TF lookups without blocking the other incoming messages. More advanced ROS execution @@ -383,7 +383,7 @@ not respecting the scale hint. To accommodate this, we manually re-scale the camera link. Once we have correctly re-scaled the camera component, we can send the whole scene to rerun with -`rerun_urdf.log_scene`. +`rerun_urdf.log_scene`. ```python def urdf_callback(self, urdf_msg: String) -> None: """Log a URDF using `log_scene` from `rerun_urdf`.""" diff --git a/docs/content/reference/data_types.md b/docs/content/reference/data_types.md new file mode 100644 index 000000000000..a0fcfee53783 --- /dev/null +++ b/docs/content/reference/data_types.md @@ -0,0 +1,43 @@ +--- +title: Loggable Data Types +order: 2 +--- + +Rerun comes with built-in support for a number of different types that can be logged via the Python and Rust Logging +APIs and then visualized in the [Viewer](viewer.md). + +The top-level types are called **archetypes** to differentiate them from the lower-level **data types** that make up the +individual components. For more information on the relationship between **archetypes** and **components**, check out +the concept page on [Entities and Components](../concepts/entity-component.md). + +In [Python](https://ref.rerun.io) every **archetype** is typically backed by one or more function calls. In +contrast, the [Rust API](https://docs.rs/rerun/) works by building up entities of a given archetype explicitly by +assembling the required components. + +## Spatial **Archetypes** +The spatial archetypes represent 2d and 3d spatial data. These types have some notion of a coordinate system and +generally support spatial transformations. All of these types can be visualized by the `Spatial` space view. +* [Arrow3D](data_types/arrow3d.md) +* [Rect2D](data_types/rect2d.md) +* [Box3D](data_types/box3d.md) +* [Linestrip2D](data_types/linestrip2d.md) +* [Linestrip3D](data_types/linestrip3d.md) +* [Mesh](data_types/mesh.md) +* [Point2D](data_types/point2d.md) +* [Point3D](data_types/point3d.md) +* [Transform3D](data_types/transform3d.md) +* [Pinhole](data_types/pinhole.md) + +## Image & Tensor **Archetypes** +Image and tensor archetypes all build on top of a common tensor component. The tensor component is a multi-dimensional +generic container for arrays of data. Images are restricted to tensors of rank 2 or rank 3; these can be viewed in the +`Spatial` space view. Generic tensors of greater rank can only be viewed in the specialized `Tensor` space view. +* [Image](data_types/image.md) +* [DepthImage](data_types/depth_image.md) +* [SegmentationImage](data_types/segmentation_image.md) +* [Tensor](data_types/tensor.md) + +## Other **Archetypes** +* [Scalar](data_types/scalar.md): a single scalar / metric value. Can be viewed in the `TimeSeries` space view. +* [TextEntry](data_types/text_entry.md): captures text data. Can be viewed in the `Text` space view. +* [AnnotationContext](data_types/annotation_context.md): not viewed directly, but provides classes, labels, and connectivity information for other entities. diff --git a/docs/content/reference/data_types/annotation_context.md b/docs/content/reference/data_types/annotation_context.md new file mode 100644 index 000000000000..922eed3a550f --- /dev/null +++ b/docs/content/reference/data_types/annotation_context.md @@ -0,0 +1,10 @@ +--- +title: AnnotationContext +order: 50 +--- +## Components and APIs +Primary component: `annotation_context` + +Python APIs: [log_annotation_context](https://ref.rerun.io/docs/python/latest/common/annotations/#rerun.log_annotation_context) + +Rust API: [AnnotationContext](https://docs.rs/rerun/latest/rerun/components/struct.AnnotationContext.html) diff --git a/docs/content/reference/data_types/arrow3d.md b/docs/content/reference/data_types/arrow3d.md new file mode 100644 index 000000000000..8f08bee16141 --- /dev/null +++ b/docs/content/reference/data_types/arrow3d.md @@ -0,0 +1,12 @@ +--- +title: Arrow3D +order: 1 +--- +## Components and APIs +Primary component: `arrow3d` + +Secondary components: `colorrgba`, `radius`, `label` + +Python APIs: [log_arrow](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_arrow) + +Rust API: [Arrow3D](https://docs.rs/rerun/latest/rerun/components/struct.Arrow3D.html) diff --git a/docs/content/reference/data_types/box3d.md b/docs/content/reference/data_types/box3d.md new file mode 100644 index 000000000000..bd1f8319cd8a --- /dev/null +++ b/docs/content/reference/data_types/box3d.md @@ -0,0 +1,12 @@ +--- +title: Box3D +order: 3 +--- +## Components and APIs +Primary component: `box3d`, + +Secondary components: `vec3d`, `quaternion`, `colorrgba`, `radius`, `label`, `classid` + +Python APIs: [log_obb](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_obb) + +Rust API: [Box3D](https://docs.rs/rerun/latest/rerun/components/struct.Box3D.html) diff --git a/docs/content/reference/data_types/depth_image.md b/docs/content/reference/data_types/depth_image.md new file mode 100644 index 000000000000..a1c81eafdbe5 --- /dev/null +++ b/docs/content/reference/data_types/depth_image.md @@ -0,0 +1,12 @@ +--- +title: DepthImage +order: 21 +--- +## Components and APIs +Primary component: `tensor` + +Secondary components: `draw_order` + +Python APIs: [log_depth_image](https://ref.rerun.io/docs/python/latest/common/images/#rerun.log_depth_image**), + +Rust API: [Tensor](https://docs.rs/rerun/latest/rerun/components/struct.Tensor.html) diff --git a/docs/content/reference/data_types/image.md b/docs/content/reference/data_types/image.md new file mode 100644 index 000000000000..4fc5aba6b4b7 --- /dev/null +++ b/docs/content/reference/data_types/image.md @@ -0,0 +1,18 @@ +--- +title: Image +order: 20 +--- + +## Components and APIs +## Components and APIs +Primary component: `tensor` + +Secondary components: `colorrgba`, `draw_order` + +Python APIs: [log_image](https://ref.rerun.io/docs/python/latest/common/images/#rerun.log_image**), [log_image_file](https://ref.rerun.io/docs/python/latest/common/images/#rerun.log_image_file**), + +Rust API: [Tensor](https://docs.rs/rerun/latest/rerun/components/struct.Tensor.html) + +`colorrgba` is currently only supported for images, +i.e. tensors with 2 dimensions and an optional 3rd that can be interpreted as color channels. +Furthermore, only the spatial Space View is able to use the color component. diff --git a/docs/content/reference/data_types/linestrip2d.md b/docs/content/reference/data_types/linestrip2d.md new file mode 100644 index 000000000000..db1f769f8f28 --- /dev/null +++ b/docs/content/reference/data_types/linestrip2d.md @@ -0,0 +1,13 @@ +--- +title: Linestrip2D +order: 4 +--- + +## Components and APIs +Primary component: `linestrip2d` + +Secondary components: `colorrgba`, `radius`, `draw_order` + +Python APIs: [log_line_strip](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_strip), [log_line_segments](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_segments) + +Rust API: [LineStrip2D](https://docs.rs/rerun/latest/rerun/components/struct.LineStrip2D.html) diff --git a/docs/content/reference/data_types/linestrip3d.md b/docs/content/reference/data_types/linestrip3d.md new file mode 100644 index 000000000000..84c0382d6052 --- /dev/null +++ b/docs/content/reference/data_types/linestrip3d.md @@ -0,0 +1,12 @@ +--- +title: Linestrip3D +order: 5 +--- +## Components and APIs +Primary component: `linestrip3d` + +Secondary components: `colorrgba`, `radius` + +Python APIs: [log_line_strip](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_strip), [log_line_segments](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_segments) + +Rust API: [LineStrip3D](https://docs.rs/rerun/latest/rerun/components/struct.LineStrip3D.html) diff --git a/docs/content/reference/data_types/mesh.md b/docs/content/reference/data_types/mesh.md new file mode 100644 index 000000000000..e54881a56551 --- /dev/null +++ b/docs/content/reference/data_types/mesh.md @@ -0,0 +1,12 @@ +--- +title: Mesh +order: 6 +--- +## Components and APIs +Primary component: `mesh3d` + +Secondary components: `colorrgba` + +Python APIs: [log_mesh](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_mesh), [log_meshes](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_meshes), [log_mesh_file](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_mesh_file) + +Rust API: [Mesh3D](https://docs.rs/rerun/latest/rerun/components/enum.Mesh3D.html) diff --git a/docs/content/reference/data_types/pinhole.md b/docs/content/reference/data_types/pinhole.md new file mode 100644 index 000000000000..60e8391e4785 --- /dev/null +++ b/docs/content/reference/data_types/pinhole.md @@ -0,0 +1,10 @@ +--- +title: Pinhole +order: 10 +--- +## Components and APIs +Primary component: `pinhole` + +Python APIs: [log_pinhole](https://ref.rerun.io/docs/python/latest/common/transforms/#rerun.log_pinhole) + +Rust API: [Pinhole](https://docs.rs/rerun/latest/rerun/components/struct.Pinhole.html) diff --git a/docs/content/reference/data_types/point2d.md b/docs/content/reference/data_types/point2d.md new file mode 100644 index 000000000000..ef5e4b6f5a5a --- /dev/null +++ b/docs/content/reference/data_types/point2d.md @@ -0,0 +1,45 @@ +--- +title: Point2D +order: 7 +--- +`Point2d` represents a singular point in two-dimensional space with optional color, radii, and label. `Point2d` entities will be drawn as part of the 2D Spatial SpaceView. + +It is compatible with [`AnnotationContext`](../../concepts/annotation-context.md). `class_id` can be used to provide +colors and labels from the annotation context, and `keypoint_id` can be used to make connected edges between points. See +examples in the `AnnotationContext` documentation. + +`draw_order` can be used to control how the `Point2d` entities are drawn relative to other objects within the scene. Higher values are drawn on top of lower values. + +## Components and APIs + +Primary component: `point2d` + +Secondary components: `colorrgba`, `radius`, `label`, `class_id`, `keypoint_id`, `draw_order` + +Python APIs: [log_point](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_point), [log_points](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_points) + +Rust API: [Point2D](https://docs.rs/rerun/latest/rerun/components/struct.Point2D.html) + +## Simple Example + +code-example: point2d_simple + + + + + + + + + +## Full Example + +code-example: point2d_random + + + + + + + + diff --git a/docs/content/reference/data_types/point3d.md b/docs/content/reference/data_types/point3d.md new file mode 100644 index 000000000000..6f9dde95005f --- /dev/null +++ b/docs/content/reference/data_types/point3d.md @@ -0,0 +1,18 @@ +--- +title: Point3D +order: 8 +--- +## Components and APIs +Primary component: `point3d` + +Secondary components: `colorrgba`, `radius`, `label`, `classid`, `keypointid` + +Python APIs: [log_point](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_point), [log_points](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_points) + +Rust API: [Point3D](https://docs.rs/rerun/latest/rerun/components/struct.Point3D.html) + +### Simple Example +code-example: point3d_simple + +### Complex Example +code-example: point3d_random diff --git a/docs/content/reference/data_types/rect2d.md b/docs/content/reference/data_types/rect2d.md new file mode 100644 index 000000000000..f32a34bb12c0 --- /dev/null +++ b/docs/content/reference/data_types/rect2d.md @@ -0,0 +1,12 @@ +--- +title: Rect2D +order: 2 +--- +## Components and APIs +Primary component: `rect2d`, + +Secondary components: `colorrgba`, `radius`, `label`, `classid`, `draw_order` + +Python APIs: [log_rect](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_rect), [log_rects](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_rects) + +Rust API: [Rect2D](https://docs.rs/rerun/latest/rerun/components/enum.Rect2D.html) diff --git a/docs/content/reference/data_types/scalar.md b/docs/content/reference/data_types/scalar.md new file mode 100644 index 000000000000..2cb2c6a7bdf0 --- /dev/null +++ b/docs/content/reference/data_types/scalar.md @@ -0,0 +1,12 @@ +--- +title: Scalar +order: 30 +--- +## Components and APIs +Primary component: `scalar` + +Secondary components: `scalar_plot_props`, `colorrgba`, `radius`, `label` + +Python APIs: [log_scalar](https://ref.rerun.io/docs/python/latest/common/plotting/#rerun.log_scalar) + +Rust API: [Scalar](https://docs.rs/rerun/latest/rerun/components/struct.Scalar.html) diff --git a/docs/content/reference/data_types/segmentation_image.md b/docs/content/reference/data_types/segmentation_image.md new file mode 100644 index 000000000000..2b635ae97779 --- /dev/null +++ b/docs/content/reference/data_types/segmentation_image.md @@ -0,0 +1,12 @@ +--- +title: SegmentationImage +order: 22 +--- +## Components and APIs +Primary component: `tensor` + +Secondary components: `draw_order` + +Python APIs: [log_segmentation_image](https://ref.rerun.io/docs/python/latest/common/images/#rerun.log_segmentation_image**) + +Rust API: [Tensor](https://docs.rs/rerun/latest/rerun/components/struct.Tensor.html) diff --git a/docs/content/reference/data_types/tensor.md b/docs/content/reference/data_types/tensor.md new file mode 100644 index 000000000000..0f89733048f9 --- /dev/null +++ b/docs/content/reference/data_types/tensor.md @@ -0,0 +1,10 @@ +--- +title: Tensor +order: 23 +--- +## Components and APIs +Primary component: `tensor` + +Python APIs: [log_tensor](https://ref.rerun.io/docs/python/latest/common/tensors/#rerun.log_tensor), + +Rust API: [Tensor](https://docs.rs/rerun/latest/rerun/components/struct.Tensor.html) diff --git a/docs/content/reference/data_types/text_entry.md b/docs/content/reference/data_types/text_entry.md new file mode 100644 index 000000000000..25eda1979437 --- /dev/null +++ b/docs/content/reference/data_types/text_entry.md @@ -0,0 +1,12 @@ +--- +title: TextEntry +order: 40 +--- +## Components and APIs +Primary component: `text_entry` + +Secondary components: `colorrgba` + +Python APIs: [log_text_entry](https://ref.rerun.io/docs/python/latest/common/text/#rerun.log_text_entry) + +Rust API: [TextEntry](https://docs.rs/rerun/latest/rerun/components/struct.TextEntry.html) diff --git a/docs/content/reference/data_types/transform3d.md b/docs/content/reference/data_types/transform3d.md new file mode 100644 index 000000000000..e87b2369477d --- /dev/null +++ b/docs/content/reference/data_types/transform3d.md @@ -0,0 +1,11 @@ +--- +title: Transform3D +order: 9 +--- +## Components and APIs +Primary component: `transform3d` + +Python APIs: [log_transform3d](https://ref.rerun.io/docs/python/latest/common/transforms/#rerun.log_transform3d), [log_rigid3](https://ref.rerun.io/docs/python/latest/common/transforms/#rerun.log_rigid3) + + +Rust API: [Transform3D](https://docs.rs/rerun/latest/rerun/components/struct.Transform3D.html) diff --git a/docs/content/reference/primitives.md b/docs/content/reference/primitives.md deleted file mode 100644 index bc7964f954f5..000000000000 --- a/docs/content/reference/primitives.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: Primitives -order: 3 ---- - -To learn what Primitives are, check the concept page on [Entities and Components](../concepts/entity-component.md). - -In [Python](https://rerun-io.github.io/rerun) every Primitive is typically backed by one or more function calls. -In contrast, the [Rust API](https://docs.rs/rerun/) works by adding components explicitly. -This is more flexible & extendable but also requires a rough understanding of -which components the Viewer can interpret together as documented below. - -## Spatial **Primitives** - -### Arrow 3D -* Python: [log_arrow](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_arrow) -* Rust (primary): [Arrow3D](https://docs.rs/rerun/latest/rerun/components/struct.Arrow3D.html) -* Primary component: `arrow3d` -* Secondary components: `colorrgba`, `radius`, `label` - -### Rectangle 2D -* Python: [log_rect](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_rect), -[log_rects](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_rects) -* Rust (primary): [Rect2D](https://docs.rs/rerun/latest/rerun/components/enum.Rect2D.html) -* Primary component: `rect2d`, -* Secondary components: `colorrgba`, `radius`, `label`, `classid`, `draw_order` - -### Box 3D -* Python: [log_obb](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_obb) -* Rust (primary): [Box3D](https://docs.rs/rerun/latest/rerun/components/struct.Box3D.html) -* Primary component: `box3d`, -* Secondary components: `vec3d`, `quaternion`, `colorrgba`, `radius`, `label`, `classid` - -### Line 2D -* Python: [log_line_strip](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_strip) -, [log_line_segments](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_segments) -* Rust (primary): [LineStrip2D](https://docs.rs/rerun/latest/rerun/components/struct.LineStrip2D.html) -* Primary component: `linestrip2d` -* Secondary components: `colorrgba`, `radius`, `draw_order` - -### Line 3D -* Python: [log_line_strip](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_strip), [log_line_segments](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_line_segments) -* Rust (primary): [LineStrip3D](https://docs.rs/rerun/latest/rerun/components/struct.LineStrip3D.html) -* Primary component: `linestrip3d` -* Secondary components: `colorrgba`, `radius` - -### Mesh -* Python: [log_mesh](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_mesh), -[log_meshes](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_meshes), -[log_mesh_file](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_mesh_file) -* Rust (primary): [Mesh3D](https://docs.rs/rerun/latest/rerun/components/enum.Mesh3D.html) -* Primary component: `mesh3d` -* Secondary components: `colorrgba` - -### Point 2D -* Python: [log_point](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_point), -[log_points](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_points) -* Rust (primary): [Point2D](https://docs.rs/rerun/latest/rerun/components/struct.Point2D.html) -* Primary component: `point2d` -* Secondary components: `colorrgba`, `radius`, `label`, `classid`, `keypointid`, `draw_order` - -### Point 3D -* Python: [log_point](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_point), -[log_points](https://ref.rerun.io/docs/python/latest/common/spatial_primitives/#rerun.log_points) -* Rust (primary): [Point3D](https://docs.rs/rerun/latest/rerun/components/struct.Point3D.html) -* Primary component: `point3d` -* Secondary components: `colorrgba`, `radius`, `label`, `classid`, `keypointid` - -### Transform -* Python: [log_rigid3](https://ref.rerun.io/docs/python/latest/common/transforms/#rerun.log_rigid3), -[log_pinhole](https://ref.rerun.io/docs/python/latest/common/transforms/#rerun.log_pinhole) -* Rust (primary): [Transform3D](https://docs.rs/rerun/latest/rerun/components/struct.Transform3D.html) -* Primary component: `transform` - -## Tensors & Images - -* Python: -[log_tensor](https://ref.rerun.io/docs/python/latest/common/tensors/#rerun.log_tensor), -[log_image](https://ref.rerun.io/docs/python/latest/common/images/#rerun.log_image**), -[log_image_file](https://ref.rerun.io/docs/python/latest/common/images/#rerun.log_image_file**), -[log_depth_image](https://ref.rerun.io/docs/python/latest/common/images/#rerun.log_depth_image**), -[log_segmentation_image](https://ref.rerun.io/docs/python/latest/common/images/#rerun.log_segmentation_image**) -* Rust (primary): [Tensor](https://docs.rs/rerun/latest/rerun/components/struct.Tensor.html) -* Primary component: `tensor` -* Secondary components: `colorrgba`, `draw_order` - -`colorrgba` is currently only supported for images, -i.e. tensors with 2 dimensions and an optional 3rd that can be interpreted as color channels. -Furthermore, only the spatial Space View is able to use the color component. - -## Plots - -### Scalar -* Python: [log_scalar](https://ref.rerun.io/docs/python/latest/common/plotting/#rerun.log_scalar) -* Rust (primary): [Scalar](https://docs.rs/rerun/latest/rerun/components/struct.Scalar.html) -* Primary component: `scalar` -* Secondary components: `scalar_plot_props`, `colorrgba`, `radius`, `label` - -## Text - -### Text Entry -* Python: [log_text_entry](https://ref.rerun.io/docs/python/latest/common/text/#rerun.log_text_entry) -* Rust (primary): [TextEntry](https://docs.rs/rerun/latest/rerun/components/struct.TextEntry.html) -* Primary component: `text_entry` -* Secondary components: `colorrgba` diff --git a/docs/content/reference/python.md b/docs/content/reference/python.md index a3feb3627620..31f689bd0f23 100644 --- a/docs/content/reference/python.md +++ b/docs/content/reference/python.md @@ -1,5 +1,5 @@ --- title: Python APIs -order: 5 +order: 8 redirect: https://ref.rerun.io/docs/python --- diff --git a/docs/content/reference/rust.md b/docs/content/reference/rust.md index 520c3c0f49aa..897ab827c83d 100644 --- a/docs/content/reference/rust.md +++ b/docs/content/reference/rust.md @@ -1,5 +1,5 @@ --- title: Rust APIs -order: 6 +order: 9 redirect: https://docs.rs/rerun/ ---- \ No newline at end of file +--- diff --git a/docs/content/reference/sdk-logging-controls.md b/docs/content/reference/sdk-logging-controls.md index 09eab9a2c140..cb0fc2b7a759 100644 --- a/docs/content/reference/sdk-logging-controls.md +++ b/docs/content/reference/sdk-logging-controls.md @@ -1,6 +1,6 @@ --- title: SDK Logging Controls -order: 0 +order: 5 --- ## Controlling logging globally diff --git a/docs/content/reference/sdk-micro-batching.md b/docs/content/reference/sdk-micro-batching.md index 8ef2bdfe8015..fc97b7d7e92a 100644 --- a/docs/content/reference/sdk-micro-batching.md +++ b/docs/content/reference/sdk-micro-batching.md @@ -1,6 +1,6 @@ --- title: SDK Micro Batching -order: 1 +order: 6 --- diff --git a/docs/content/reference/sdk-operating-modes.md b/docs/content/reference/sdk-operating-modes.md index 89651e7879bd..d85718102590 100644 --- a/docs/content/reference/sdk-operating-modes.md +++ b/docs/content/reference/sdk-operating-modes.md @@ -1,6 +1,6 @@ --- title: SDK Operating Modes -order: 1 +order: 7 --- 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. diff --git a/docs/cspell.json b/docs/cspell.json index 2dded4589741..4f3e462ef745 100644 --- a/docs/cspell.json +++ b/docs/cspell.json @@ -79,6 +79,7 @@ "lerp", "linestrip", "linspace", + "loggable", "meshgrid", "numpy", "Objectron", diff --git a/rerun_py/pyproject.toml b/rerun_py/pyproject.toml index d091a4ac466e..0ccfc24a582c 100644 --- a/rerun_py/pyproject.toml +++ b/rerun_py/pyproject.toml @@ -62,6 +62,7 @@ extend-exclude = [ # Copied from https://github.com/colmap/colmap/blob/bf3e19140f491c3042bfd85b7192ef7d249808ec/scripts/python/read_write_model.py "examples/python/structure_from_motion/read_write_model.py", ] + ignore = [ # Missing docstring in public function - TODO(emilk): enable for SDK but not for examples "D1", @@ -79,6 +80,7 @@ ignore = [ "D415", "D416", ] + line-length = 120 select = [ "D", # pydocstyle codes https://www.pydocstyle.org/en/latest/error_codes.html @@ -89,6 +91,9 @@ select = [ "W", # pycodestyle warning codes: https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes ] +[tool.ruff.per-file-ignores] +"docs/code-examples/*" = ["I002"] + [tool.ruff.flake8-tidy-imports] ban-relative-imports = "all"