Skip to content

Commit

Permalink
more timeless hunting
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Mar 18, 2024
1 parent 30d375c commit fc36677
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions docs/content/concepts/timelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ An _event_ refer to an instance of logging one or more component batches to one
</picture>


## Timeless data
## Static data

The [`rr.log()`](https://ref.rerun.io/docs/python/stable/common/logging_functions/#rerun.log) function has a `timeless=False` default argument.
If `static=True` is used instead, the entity become *timeless*. Timeless entities belong to all timelines (existing ones, and ones not yet created) and are shown leftmost in the time panel in the viewer.
This is useful for entities that aren't part of normal data capture, but set the scene for how they are shown.
For instance, if you are logging cars on a street, perhaps you want to always show a street mesh as part of the scenery, and for that it makes sense for that data to be timeless.
The [`rr.log()`](https://ref.rerun.io/docs/python/stable/common/logging_functions/#rerun.log) function has a `static=False` default argument.
If `static=True` is used instead, the data logged becomes *static*. Static data belongs to all timelines (existing ones, and ones not yet created) and shadows any temporal data of the same type on the same entity.
This is useful for data that isn't part of normal data capture, but sets the scene for how it should be shown.
For instance, if you are logging cars on a street, perhaps you want to always show a street mesh as part of the scenery, and for that it makes sense for that data to be static.

Similarly, [coordinate systems](spaces-and-transforms.md) or [annotation context](annotation-context.md) are typically timeless.
Similarly, [coordinate systems](spaces-and-transforms.md) or [annotation context](annotation-context.md) are typically static.
2 changes: 1 addition & 1 deletion docs/snippets/all/scalar_multiple_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
lcg_state = np.int64(0)

# Set up plot styling:
# They are logged timeless as they don't change over time and apply to all timelines.
# They are logged statically as they don't change over time and apply to all timelines.
# Log two lines series under a shared root so that they show in the same plot by default.
rr.log("trig/sin", rr.SeriesLine(color=[255, 0, 0], name="sin(0.01t)"), static=True)
rr.log("trig/cos", rr.SeriesLine(color=[0, 255, 0], name="cos(0.01t)"), static=True)
Expand Down
2 changes: 1 addition & 1 deletion docs/snippets/all/series_line_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
rr.init("rerun_example_series_line_style", spawn=True)

# Set up plot styling:
# They are logged timeless as they don't change over time and apply to all timelines.
# They are logged statically as they don't change over time and apply to all timelines.
# Log two lines series under a shared root so that they show in the same plot by default.
rr.log("trig/sin", rr.SeriesLine(color=[255, 0, 0], name="sin(0.01t)", width=2), static=True)
rr.log("trig/cos", rr.SeriesLine(color=[0, 255, 0], name="cos(0.01t)", width=4), static=True)
Expand Down
2 changes: 1 addition & 1 deletion docs/snippets/all/series_point_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
rr.init("rerun_example_series_point_style", spawn=True)

# Set up plot styling:
# They are logged timeless as they don't change over time and apply to all timelines.
# They are logged statically as they don't change over time and apply to all timelines.
# Log two point series under a shared root so that they show in the same plot by default.
rr.log(
"trig/sin",
Expand Down
2 changes: 1 addition & 1 deletion examples/python/arkit_scenes/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
static=True,
)
```
Here, the mesh is logged to the [world/mesh entity](recording://world/mesh) and is marked as timeless, since it does not
Here, the mesh is logged to the [world/mesh entity](recording://world/mesh) and is marked as static, since it does not
change in the context of this visualization.
### 3D bounding boxes
Expand Down
2 changes: 1 addition & 1 deletion examples/python/human_pose_tracking/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
The [2D](recording://video/pose/points) and [3D skeletons](recording://person/pose/points) are also logged through a
similar combination of two entities.
First, a timeless
First, a static
[rr.ClassDescription](https://www.rerun.io/docs/reference/types/datatypes/class_description) is logged (note, that
this is equivalent to logging an
[rr.AnnotationContext archetype](https://www.rerun.io/docs/reference/types/archetypes/annotation_context) as in the
Expand Down
2 changes: 1 addition & 1 deletion examples/python/plots/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
archetypes respectively.
For the [parabola](recording://curves/parabola) the radius and color is changed over time,
the other plots use timeless for their styling properties where possible.
the other plots use static for their styling properties where possible.
[sin](recording://trig/sin) and [cos](recording://trig/cos) are logged with the same parent entity (i.e.,
`trig/{cos,sin}`) which will put them in the same view by default.
Expand Down
8 changes: 4 additions & 4 deletions examples/python/ros_node/rerun_urdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def load_urdf_from_msg(msg: String) -> URDF:
return URDF.load(f, filename_handler=ament_locate_package)


def log_scene(scene: trimesh.Scene, node: str, path: str | None = None, timeless: bool = False) -> None:
def log_scene(scene: trimesh.Scene, node: str, path: str | None = None, static: bool = False) -> None:
"""Log a trimesh scene to rerun."""
path = path + "/" + node if path else node

Expand All @@ -46,7 +46,7 @@ def log_scene(scene: trimesh.Scene, node: str, path: str | None = None, timeless
translation=world_from_mesh[3, 0:3],
mat3x3=world_from_mesh[0:3, 0:3],
),
timeless=timeless,
static=static,
)

# Log this node's mesh, if it has one.
Expand Down Expand Up @@ -82,9 +82,9 @@ def log_scene(scene: trimesh.Scene, node: str, path: str | None = None, timeless
vertex_normals=mesh.vertex_normals,
mesh_material=rr.Material(albedo_factor=albedo_factor),
),
timeless=timeless,
static=static,
)

if children:
for child in children:
log_scene(scene, child, path, timeless)
log_scene(scene, child, path, static)
2 changes: 1 addition & 1 deletion examples/python/signed_distance_fields/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def log_mesh(path: Path, mesh: Trimesh) -> None:

def log_sampled_sdf(points: npt.NDArray[np.float32], sdf: npt.NDArray[np.float32]) -> None:
rr.log("world", rr.ViewCoordinates.RIGHT_HAND_Z_UP, static=True)
rr.log("world/sdf", rr.AnnotationContext([(0, "inside", (255, 0, 0)), (1, "outside", (0, 255, 0))]), timeless=False)
rr.log("world/sdf", rr.AnnotationContext([(0, "inside", (255, 0, 0)), (1, "outside", (0, 255, 0))]), static=False)
rr.log("world/sdf/points", rr.Points3D(points, class_ids=np.array(sdf > 0, dtype=np.uint8)))

outside = points[sdf > 0]
Expand Down
6 changes: 3 additions & 3 deletions tests/python/test_api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def run_segmentation() -> None:
# Log an initial segmentation map with arbitrary colors
rr.set_time_seconds("sim_time", 2)

rr.log("seg_test", rr.AnnotationContext([(13, "label1"), (42, "label2"), (99, "label3")]), timeless=False)
rr.log("seg_test", rr.AnnotationContext([(13, "label1"), (42, "label2"), (99, "label3")]), static=False)

rr.log(
"logs/seg_test_log",
Expand All @@ -68,7 +68,7 @@ def run_segmentation() -> None:
rr.log(
"seg_test",
rr.AnnotationContext([(13, "label1", (255, 0, 0)), (42, "label2", (0, 255, 0)), (99, "label3", (0, 0, 255))]),
timeless=False,
static=False,
)
rr.log("logs/seg_test_log", rr.TextLog("points/rects with user specified colors"))

Expand All @@ -84,7 +84,7 @@ def run_segmentation() -> None:
rr.AnnotationInfo(99, label="label3"),
]
),
timeless=False,
static=False,
)
rr.log("logs/seg_test_log", rr.TextLog("label1 disappears and everything with label3 is now default colored again"))

Expand Down

0 comments on commit fc36677

Please sign in to comment.